Bug 857883 - Don't assert about readyState when not needed. r=bz, a=akeybl
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 15 May 2013 14:35:41 +0300
changeset 110163 2d5a85d7d3ae
parent 110162 41359154af81
child 110164 ef7a8f39085e
push id222
push userryanvm@gmail.com
push date2013-05-16 19:13 +0000
reviewersbz, akeybl
bugs857883
milestone17.0.6
Bug 857883 - Don't assert about readyState when not needed. r=bz, a=akeybl
content/base/src/nsContentSink.cpp
docshell/base/nsDocShell.cpp
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -1444,17 +1444,18 @@ nsContentSink::EndUpdate(nsIDocument *aD
     UpdateChildCounts();
   }
 }
 
 void
 nsContentSink::DidBuildModelImpl(bool aTerminated)
 {
   if (mDocument) {
-    MOZ_ASSERT(mDocument->GetReadyStateEnum() ==
+    MOZ_ASSERT(aTerminated ||
+               mDocument->GetReadyStateEnum() ==
                nsIDocument::READYSTATE_LOADING, "Bad readyState");
     mDocument->SetReadyStateInternal(nsIDocument::READYSTATE_INTERACTIVE);
   }
 
   if (mScriptLoader) {
     mScriptLoader->ParsingComplete(aTerminated);
   }
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -4531,18 +4531,20 @@ nsDocShell::Stop(uint32_t aStopFlags)
         }
 
         mFailedChannel = nullptr;
         mFailedURI = nullptr;
     }
 
     if (nsIWebNavigation::STOP_CONTENT & aStopFlags) {
         // Stop the document loading
-        if (mContentViewer)
-            mContentViewer->Stop();
+        if (mContentViewer) {
+            nsCOMPtr<nsIContentViewer> cv = mContentViewer;
+            cv->Stop();
+        }
     }
 
     if (nsIWebNavigation::STOP_NETWORK & aStopFlags) {
         // Suspend any timers that were set for this loader.  We'll clear
         // them out for good in CreateContentViewer.
         if (mRefreshURIList) {
             SuspendRefreshURIs();
             mSavedRefreshURIList.swap(mRefreshURIList);