Bug 1329200: Remove unused FrameManager global generation counter. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 06 Jan 2017 16:03:41 +0100
changeset 456939 5ab986e7cce8cfdd70b91fa9affaefaa6c9806b0
parent 456938 cbbf0caa1b29788f939f9acad0474754dcc1f8ff
child 541364 5645a178130fb4d053e8da1cfb771b0e9fba35ce
push id40650
push userbmo:emilio+bugs@crisal.io
push dateFri, 06 Jan 2017 15:05:49 +0000
reviewersxidorn
bugs1329200
milestone53.0a1
Bug 1329200: Remove unused FrameManager global generation counter. r?xidorn MozReview-Commit-ID: AXkaZYxpK2y
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.cpp
layout/base/nsFrameManagerBase.h
layout/base/nsPresContext.h
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8751,17 +8751,16 @@ nsCSSFrameConstructor::BeginUpdate() {
                "Someone forgot a script blocker");
 
   nsRootPresContext* rootPresContext =
     mPresShell->GetPresContext()->GetRootPresContext();
   if (rootPresContext) {
     rootPresContext->IncrementDOMGeneration();
   }
 
-  ++sGlobalGenerationNumber;
 #ifdef DEBUG
   ++mUpdateCount;
 #endif
 }
 
 void
 nsCSSFrameConstructor::EndUpdate()
 {
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -830,10 +830,8 @@ RemoveUndisplayedEntry(PLHashEntry* he, 
 }
 
 void
 nsFrameManagerBase::UndisplayedMap::Clear(void)
 {
   mLastLookup = nullptr;
   PL_HashTableEnumerateEntries(mTable, RemoveUndisplayedEntry, 0);
 }
-
-uint32_t nsFrameManagerBase::sGlobalGenerationNumber;
--- a/layout/base/nsFrameManagerBase.h
+++ b/layout/base/nsFrameManagerBase.h
@@ -40,33 +40,21 @@ public:
    */
   nsIFrame* GetRootFrame() const { return mRootFrame; }
   void      SetRootFrame(nsIFrame* aRootFrame)
   {
     NS_ASSERTION(!mRootFrame, "already have a root frame");
     mRootFrame = aRootFrame;
   }
 
-  static uint32_t GetGlobalGenerationNumber() { return sGlobalGenerationNumber; }
-
 protected:
   class UndisplayedMap;
 
   // weak link, because the pres shell owns us
   nsIPresShell* MOZ_NON_OWNING_REF mPresShell;
   nsIFrame*                       mRootFrame;
   PLDHashTable                    mPlaceholderMap;
   UndisplayedMap*                 mUndisplayedMap;
   UndisplayedMap*                 mDisplayContentsMap;
   bool                            mIsDestroyingFrames;  // The frame manager is destroying some frame(s).
-
-  // The frame tree generation number
-  // We use this to avoid unnecessary screenshotting
-  // on Android. Unfortunately, this is static to match
-  // the single consumer which is also static. Keeping
-  // this the same greatly simplifies lifetime issues and
-  // makes sure we always using the correct number.
-  // A per PresContext generation number is available
-  // via nsPresContext::GetDOMGeneration
-  static uint32_t                 sGlobalGenerationNumber;
 };
 
 #endif
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1536,19 +1536,16 @@ public:
    * Increment DOM-modification generation counter to indicate that
    * the DOM has changed in a way that might lead to style changes/
    * reflows/frame creation and destruction.
    */
   void IncrementDOMGeneration() { mDOMGeneration++; }
 
   /**
    * Get the current DOM generation counter.
-   *
-   * See nsFrameManagerBase::GetGlobalGenerationNumber() for a
-   * global generation number.
    */
   uint32_t GetDOMGeneration() { return mDOMGeneration; }
 
   /**
    * Add a runnable that will get called before the next paint. They will get
    * run eventually even if painting doesn't happen. They might run well before
    * painting happens.
    */