Bug 1404297 - Temporarily assert that we don't re-enter this function. r=bzbarsky
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 10 Jan 2018 18:48:26 -0500
changeset 450397 438c2b58ffca0817526a6629f31ada85a7be0e15
parent 450396 9b2d90369dd303e4a7ea4dc2cb0fd89efc84cca7
child 450398 ff6e9d3a6441aa4510ed47d5383e79fe5a412576
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1404297
milestone59.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 1404297 - Temporarily assert that we don't re-enter this function. r=bzbarsky MozReview-Commit-ID: FoQGVDWtwN1
dom/base/nsDocument.cpp
dom/base/nsIDocument.h
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1491,19 +1491,17 @@ nsIDocument::nsIDocument()
 #ifdef MOZILLA_INTERNAL_API
     mVisibilityState(dom::VisibilityState::Hidden),
 #else
     mDummy(0),
 #endif
     mType(eUnknown),
     mDefaultElementType(0),
     mAllowXULXBL(eTriUnset),
-#ifdef DEBUG
     mIsLinkUpdateRegistrationsForbidden(false),
-#endif
     mBidiOptions(IBMBIDI_DEFAULT_BIDI_OPTIONS),
     mSandboxFlags(0),
     mPartID(0),
     mMarkedCCGeneration(0),
     mPresShell(nullptr),
     mSubtreeModifiedDepth(0),
     mEventsSuppressed(0),
     mIgnoreDestructiveWritesCounter(0),
@@ -10112,17 +10110,17 @@ nsIDocument::EnumerateActivityObservers(
        iter.Next()) {
     aEnumerator(iter.Get()->GetKey(), aData);
   }
 }
 
 void
 nsIDocument::RegisterPendingLinkUpdate(Link* aLink)
 {
-  MOZ_ASSERT(!mIsLinkUpdateRegistrationsForbidden);
+  MOZ_RELEASE_ASSERT(!mIsLinkUpdateRegistrationsForbidden);
 
   if (aLink->HasPendingLinkUpdate()) {
     return;
   }
 
   aLink->SetHasPendingLinkUpdate();
 
   if (!mHasLinksToUpdateRunnable) {
@@ -10151,24 +10149,22 @@ nsIDocument::FlushPendingLinkUpdatesFrom
   MOZ_ASSERT(mHasLinksToUpdateRunnable);
   mHasLinksToUpdateRunnable = false;
   FlushPendingLinkUpdates();
 }
 
 void
 nsIDocument::FlushPendingLinkUpdates()
 {
-  MOZ_ASSERT(!mIsLinkUpdateRegistrationsForbidden);
+  MOZ_RELEASE_ASSERT(!mIsLinkUpdateRegistrationsForbidden);
   if (!mHasLinksToUpdate)
     return;
 
-#ifdef DEBUG
   AutoRestore<bool> saved(mIsLinkUpdateRegistrationsForbidden);
   mIsLinkUpdateRegistrationsForbidden = true;
-#endif
   for (auto iter = mLinksToUpdate.Iter(); !iter.Done(); iter.Next()) {
     Link* link = iter.Get();
     Element* element = link->GetElement();
     if (element->OwnerDoc() == this) {
       link->ClearHasPendingLinkUpdate();
       if (element->IsInComposedDoc()) {
         element->UpdateLinkState(link->LinkState());
       }
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3616,23 +3616,21 @@ protected:
   enum Tri {
     eTriUnset = 0,
     eTriFalse,
     eTriTrue
   };
 
   Tri mAllowXULXBL;
 
-#ifdef DEBUG
   /**
    * This is true while FlushPendingLinkUpdates executes.  Calls to
    * [Un]RegisterPendingLinkUpdate will assert when this is true.
    */
   bool mIsLinkUpdateRegistrationsForbidden;
-#endif
 
   // The document's script global object, the object from which the
   // document can get its script context and scope. This is the
   // *inner* window object.
   nsCOMPtr<nsIScriptGlobalObject> mScriptGlobalObject;
 
   // If mIsStaticDocument is true, mOriginalDocument points to the original
   // document.