Bug 1431474: Try to assert nice things about what's going on on our flushes. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 19 Jan 2018 23:45:52 +0100
changeset 722776 9e82da5260c130dbef1f7b5201746afcbb5caf3c
parent 722775 9abd9aee0f75ac47974ffbf93309336eeb5e9fae
child 722777 fdb65693fe671de96bff3654dbeeef0b6e6c4ba4
push id96244
push userbmo:emilio@crisal.io
push dateFri, 19 Jan 2018 22:47:16 +0000
reviewersbz
bugs1431474
milestone59.0a1
Bug 1431474: Try to assert nice things about what's going on on our flushes. r?bz This is green on try... Let's see on the wild. MozReview-Commit-ID: C9Gam0s42pO
layout/base/PresShell.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -4097,16 +4097,18 @@ PresShell::DoFlushPendingNotifications(m
   /**
    * VERY IMPORTANT: If you add some sort of new flushing to this
    * method, make sure to add the relevant SetNeedLayoutFlush or
    * SetNeedStyleFlush calls on the shell.
    */
   FlushType flushType = aFlush.mFlushType;
 
   MOZ_ASSERT(NeedFlush(flushType), "Why did we get called?");
+  MOZ_DIAGNOSTIC_ASSERT(mDocument->HasShellOrBFCacheEntry());
+  MOZ_DIAGNOSTIC_ASSERT(mDocument->GetShell() == this);
 
 #ifdef MOZ_GECKO_PROFILER
   static const EnumeratedArray<FlushType,
                                FlushType::Count,
                                const char*> flushTypeNames = {
     "",
     "Event",
     "Content",
@@ -4118,20 +4120,20 @@ PresShell::DoFlushPendingNotifications(m
     "InterruptibleLayout",
     "Layout",
     "Display"
   };
   AUTO_PROFILER_LABEL_DYNAMIC_CSTR("PresShell::DoFlushPendingNotifications",
                                    GRAPHICS, flushTypeNames[flushType]);
 #endif
 
+
 #ifdef ACCESSIBILITY
 #ifdef DEBUG
-  nsAccessibilityService* accService = GetAccService();
-  if (accService) {
+  if (nsAccessibilityService* accService = GetAccService()) {
     NS_ASSERTION(!accService->IsProcessingRefreshDriverNotification(),
                  "Flush during accessible tree update!");
   }
 #endif
 #endif
 
   NS_ASSERTION(flushType >= FlushType::Frames, "Why did we get called?");