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 142659 dc923e44708ff41e5740f732e189dcfa23db60a4
parent 142658 ddb87b8697fb23cad3efefa00bb4c88e77fb9e1a
child 142660 ef0168b5cf1c6bb239ebbb59b0114bd4e13e203d
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, akeybl
bugs857883
milestone23.0a2
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
@@ -1435,17 +1435,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
@@ -4590,18 +4590,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);