Bug 782707 - Move waiting-on-channel bailout to after we potentially close it in nsObjectLoadingContent. r=josh
authorJohn Schoenick <jschoenick@mozilla.com>
Wed, 15 Aug 2012 12:16:17 -0700
changeset 102677 9d10b718c9a87953eb24f80485237653b4986eb9
parent 102676 882ce0d4a2946952ff96f5f9d5596ce72e1bec31
child 102678 57de8dafdf2d6246ca391f74bbf626813a59c7e3
push id23301
push userryanvm@gmail.com
push dateSat, 18 Aug 2012 02:17:26 +0000
treeherdermozilla-central@812ea773f166 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh
bugs782707
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 782707 - Move waiting-on-channel bailout to after we potentially close it in nsObjectLoadingContent. r=josh
content/base/src/nsObjectLoadingContent.cpp
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -1520,19 +1520,17 @@ nsObjectLoadingContent::LoadObject(bool 
   }
 
   // Save these for NotifyStateChanged();
   nsEventStates oldState = ObjectState();
   ObjectType oldType = mType;
 
   ParameterUpdateFlags stateChange = UpdateObjectParameters();
 
-  // If nothing changed and we are not force-loading, or we're in state loading
-  // but continuing to wait on a channel, we're done
-  if ((!stateChange && !aForceLoad) || (mType == eType_Loading && mChannel)) {
+  if (!stateChange && !aForceLoad) {
     return NS_OK;
   }
 
   ///
   /// State has changed, unload existing content and attempt to load new type
   ///
   LOG(("OBJLC [%p]: LoadObject - plugin state changed (%u)",
        this, stateChange));
@@ -1565,27 +1563,32 @@ nsObjectLoadingContent::LoadObject(bool 
   // event loop. Note that we check for still-open channels below
   UnloadObject(false); // Don't reset state
   if (!mIsLoading) {
     // The event loop must've spun and re-entered into LoadObject, which
     // finished the load
     return NS_OK;
   }
 
+  // Determine what's going on with our channel
   if (stateChange & eParamChannelChanged) {
     // If the channel params changed, throw away the channel, but unset
     // mChannelLoaded so we'll still try to open a new one for this load if
     // necessary
     CloseChannel();
     mChannelLoaded = false;
   } else if (mType == eType_Null && mChannel) {
     // If we opened a channel but then failed to find a loadable state, throw it
     // away. mChannelLoaded will indicate that we tried to load a channel at one
     // point so we wont recurse
     CloseChannel();
+  } else if (mType == eType_Loading && mChannel) {
+    // We're still waiting on a channel load, already opened one, and
+    // channel parameters didn't change
+    return NS_OK;
   } else if (mChannelLoaded && mChannel != aLoadingChannel) {
     // The only time we should have a loaded channel with a changed state is
     // when the channel has just opened -- in which case this call should
     // have originated from OnStartRequest
     NS_NOTREACHED("Loading with a channel, but state doesn't make sense");
     return NS_OK;
   }