Bug 675722: Reduce severity of "Expecting to be paused for pagehide before disconnect" SMIL assertion, and catch it earlier in ~nsDocument. r=bz
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 02 Aug 2011 16:12:32 -0700
changeset 73695 4bf9b8abb862aa94a962b9fe6c6a7d5ebb6b2630
parent 73694 a5932b9082826bfa120da02bf904e1fecae35327
child 73696 feda6619295c168a15f20a8d77f4e083297131f0
push id929
push userdholbert@mozilla.com
push dateTue, 02 Aug 2011 23:12:57 +0000
treeherdermozilla-inbound@4bf9b8abb862 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs675722
milestone8.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 675722: Reduce severity of "Expecting to be paused for pagehide before disconnect" SMIL assertion, and catch it earlier in ~nsDocument. r=bz
content/base/src/nsDocument.cpp
content/smil/nsSMILAnimationController.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -1575,16 +1575,18 @@ nsDocument::~nsDocument()
     PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
            ("DOCUMENT %p destroyed", this));
 #endif
 
 #ifdef DEBUG
   nsCycleCollector_DEBUG_wasFreed(static_cast<nsIDocument*>(this));
 #endif
 
+  NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
+
   mInDestructor = PR_TRUE;
   mInUnlinkOrDeletion = PR_TRUE;
 
   // Clear mObservers to keep it in sync with the mutationobserver list
   mObservers.Clear();
 
   if (mStyleSheetSetList) {
     mStyleSheetSetList->Disconnect();
--- a/content/smil/nsSMILAnimationController.cpp
+++ b/content/smil/nsSMILAnimationController.cpp
@@ -89,18 +89,18 @@ nsSMILAnimationController::~nsSMILAnimat
 }
 
 void
 nsSMILAnimationController::Disconnect()
 {
   NS_ABORT_IF_FALSE(mDocument, "disconnecting when we weren't connected...?");
   NS_ABORT_IF_FALSE(mRefCnt.get() == 1,
                     "Expecting to disconnect when doc is sole remaining owner");
-  NS_ABORT_IF_FALSE(mPauseState & nsSMILTimeContainer::PAUSE_PAGEHIDE,
-                    "Expecting to be paused for pagehide before disconnect");
+  NS_ASSERTION(mPauseState & nsSMILTimeContainer::PAUSE_PAGEHIDE,
+               "Expecting to be paused for pagehide before disconnect");
 
   StopSampling(GetRefreshDriver());
 
   mDocument = nsnull; // (raw pointer)
 }
 
 //----------------------------------------------------------------------
 // nsSMILTimeContainer methods: