Bug 1516368 - De-virtualize nsIPresShell::IsResolutionUpdated and SetResolutionUpdated. r=botond
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sun, 30 Dec 2018 02:17:30 +0000
changeset 452134 592d38d2892f86e768f64ffcbf93878a2d0e8b61
parent 452133 ff2870cad3e63128f93cbadc227ed6a7b3b2146e
child 452157 19fc512f3c95b2f24edefbf6ee87a7bf63e618d1
child 452158 a22cf2ec4f2dbfa6f860ba317c24ee1079d24653
push id35286
push usercsabou@mozilla.com
push dateSun, 30 Dec 2018 09:30:25 +0000
treeherdermozilla-central@592d38d2892f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1516368
milestone66.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 1516368 - De-virtualize nsIPresShell::IsResolutionUpdated and SetResolutionUpdated. r=botond Depends on D15342 Differential Revision: https://phabricator.services.mozilla.com/D15343
layout/base/PresShell.cpp
layout/base/PresShell.h
layout/base/nsIPresShell.h
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -796,16 +796,17 @@ nsIPresShell::nsIPresShell()
       mObservingLayoutFlushes(false),
       mResizeEventPending(false),
       mNeedThrottledAnimationFlush(true),
       mFontSizeInflationForceEnabled(false),
       mFontSizeInflationDisabledInMasterProcess(false),
       mFontSizeInflationEnabled(false),
       mPaintingIsFrozen(false),
       mIsNeverPainting(false),
+      mResolutionUpdated(false),
       mPresShellId(0),
       mFontSizeInflationEmPerLine(0),
       mFontSizeInflationMinTwips(0),
       mFontSizeInflationLineThreshold(0),
       mInFlush(false),
       mCurrentEventFrame(nullptr) {
 }
 
@@ -834,17 +835,16 @@ PresShell::PresShell()
       mShouldUnsuppressPainting(false),
       mApproximateFrameVisibilityVisited(false),
       mNextPaintCompressed(false),
       mHasCSSBackgroundColor(false),
       mIsLastChromeOnlyEscapeKeyConsumed(false),
       mHasReceivedPaintMessage(false),
       mIsLastKeyDownCanceled(false),
       mHasHandledUserInput(false),
-      mResolutionUpdated(false),
       mForceDispatchKeyPressEventsForNonPrintableKeys(false),
       mForceUseLegacyKeyCodeAndCharCodeValues(false),
       mInitializedWithKeyPressEventDispatchingBlacklist(false) {
   MOZ_LOG(gLog, LogLevel::Debug, ("PresShell::PresShell this=%p", this));
 
 #ifdef MOZ_REFLOW_PERF
   mReflowCountMgr = MakeUnique<ReflowCountMgr>();
   mReflowCountMgr->SetPresContext(mPresContext);
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -192,20 +192,16 @@ class PresShell final : public nsIPresSh
   LayerManager* GetLayerManager() override;
 
   bool AsyncPanZoomEnabled() override;
 
   void SetIgnoreViewportScrolling(bool aIgnore) override;
 
   nsresult SetResolutionAndScaleTo(float aResolution,
                                    ChangeOrigin aOrigin) override;
-  bool IsResolutionUpdated() const override { return mResolutionUpdated; }
-  void SetResolutionUpdated(bool aUpdated) override {
-    mResolutionUpdated = aUpdated;
-  }
   float GetCumulativeResolution() override;
   float GetCumulativeNonRootScaleResolution() override;
   void SetRestoreResolution(float aResolution,
                             LayoutDeviceIntSize aDisplaySize) override;
 
   // nsIViewObserver interface
 
   void Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
@@ -822,20 +818,16 @@ class PresShell final : public nsIPresSh
   // Whether the widget has received a paint message yet.
   bool mHasReceivedPaintMessage : 1;
 
   bool mIsLastKeyDownCanceled : 1;
 
   // Whether we have ever handled a user input event
   bool mHasHandledUserInput : 1;
 
-  // Whether the most recent change to the pres shell resolution was
-  // originated by the main thread.
-  bool mResolutionUpdated : 1;
-
   // Whether we should dispatch keypress events even for non-printable keys
   // for keeping backward compatibility.
   bool mForceDispatchKeyPressEventsForNonPrintableKeys : 1;
   // Whether we should set keyCode or charCode value of keypress events whose
   // value is zero to the other value or not.  When this is set to true, we
   // should keep using legacy keyCode and charCode values (i.e., one of them
   // is always 0).
   bool mForceUseLegacyKeyCodeAndCharCodeValues : 1;
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -1383,18 +1383,18 @@ class nsIPresShell : public nsStubDocume
                                            ChangeOrigin aOrigin) = 0;
   float GetResolution() const { return mResolution.valueOr(1.0); }
   virtual float GetCumulativeResolution() = 0;
 
   /**
    * Accessors for a flag that tracks whether the most recent change to
    * the pres shell's resolution was originated by the main thread.
    */
-  virtual bool IsResolutionUpdated() const = 0;
-  virtual void SetResolutionUpdated(bool aUpdated) = 0;
+  bool IsResolutionUpdated() const { return mResolutionUpdated; }
+  void SetResolutionUpdated(bool aUpdated) { mResolutionUpdated = aUpdated; }
 
   /**
    * Calculate the cumulative scale resolution from this document up to
    * but not including the root document.
    */
   virtual float GetCumulativeNonRootScaleResolution() = 0;
 
   /**
@@ -1862,16 +1862,20 @@ class nsIPresShell : public nsStubDocume
 
   bool mPaintingIsFrozen : 1;
 
   // If a document belongs to an invisible DocShell, this flag must be set
   // to true, so we can avoid any paint calls for widget related to this
   // presshell.
   bool mIsNeverPainting : 1;
 
+  // Whether the most recent change to the pres shell resolution was
+  // originated by the main thread.
+  bool mResolutionUpdated : 1;
+
   uint32_t mPresShellId;
 
   static nsIContent* gKeyDownTarget;
 
   // Cached font inflation values. This is done to prevent changing of font
   // inflation until a page is reloaded.
   uint32_t mFontSizeInflationEmPerLine;
   uint32_t mFontSizeInflationMinTwips;