Bug 1516368 - Unite ChangeOrigin::eRestore and eOther as ChangeOrigin::eMainThread. r=botond
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sun, 30 Dec 2018 02:45:47 +0000
changeset 509235 a17c856e81b5ab876db8bc26bc89ebcf78dfaf30
parent 509234 f11eea40912a16a004d9e71f2ec2d3faffd5d8c8
child 509236 ff2870cad3e63128f93cbadc227ed6a7b3b2146e
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [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 - Unite ChangeOrigin::eRestore and eOther as ChangeOrigin::eMainThread. r=botond Depends on D15340 Differential Revision: https://phabricator.services.mozilla.com/D15341
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDocument.cpp
layout/base/MobileViewportManager.cpp
layout/base/nsIPresShell.h
layout/generic/nsGfxScrollFrame.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -544,17 +544,17 @@ nsDOMWindowUtils::SetDisplayPortBaseForE
 NS_IMETHODIMP
 nsDOMWindowUtils::SetResolutionAndScaleTo(float aResolution) {
   nsIPresShell* presShell = GetPresShell();
   if (!presShell) {
     return NS_ERROR_FAILURE;
   }
 
   presShell->SetResolutionAndScaleTo(aResolution,
-                                     nsIPresShell::ChangeOrigin::eOther);
+                                     nsIPresShell::ChangeOrigin::eMainThread);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SetRestoreResolution(float aResolution,
                                        uint32_t aDisplayWidth,
                                        uint32_t aDisplayHeight) {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -10144,17 +10144,17 @@ void nsIDocument::CleanupFullscreenState
   }
   mFullscreenStack.Clear();
   mFullscreenRoot = nullptr;
 
   // Restore the zoom level that was in place prior to entering fullscreen.
   if (nsIPresShell* shell = GetShell()) {
     if (shell->GetMobileViewportManager()) {
       shell->SetResolutionAndScaleTo(mSavedResolution,
-                                     nsIPresShell::ChangeOrigin::eRestore);
+                                     nsIPresShell::ChangeOrigin::eMainThread);
     }
   }
 
   UpdateViewportScrollbarOverrideForFullscreen(this);
 }
 
 bool nsIDocument::FullscreenStackPush(Element* aElement) {
   NS_ASSERTION(aElement, "Must pass non-null to FullscreenStackPush()");
@@ -10542,17 +10542,17 @@ bool nsIDocument::ApplyFullscreen(Unique
     // This also ensures that things like video controls aren't zoomed in
     // when in fullscreen mode.
     if (nsIPresShell* shell = child->GetShell()) {
       if (RefPtr<MobileViewportManager> manager =
               shell->GetMobileViewportManager()) {
         // Save the previous resolution so it can be restored.
         child->mSavedResolution = shell->GetResolution();
         shell->SetResolutionAndScaleTo(manager->ComputeIntrinsicResolution(),
-                                       nsIPresShell::ChangeOrigin::eOther);
+                                       nsIPresShell::ChangeOrigin::eMainThread);
       }
     }
 
     NS_ASSERTION(child->GetFullscreenRoot() == fullScreenRootDoc,
                  "Fullscreen root should be set!");
     if (child == fullScreenRootDoc) {
       break;
     }
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -324,18 +324,18 @@ void MobileViewportManager::UpdateResolu
       }
     }
   }
 
   // If the zoom has changed, update the pres shell resolution accordingly.
   if (newZoom) {
     LayoutDeviceToLayerScale resolution = ZoomToResolution(*newZoom, cssToDev);
     MVM_LOG("%p: setting resolution %f\n", this, resolution.scale);
-    mPresShell->SetResolutionAndScaleTo(resolution.scale,
-                                        nsIPresShell::ChangeOrigin::eOther);
+    mPresShell->SetResolutionAndScaleTo(
+        resolution.scale, nsIPresShell::ChangeOrigin::eMainThread);
 
     MVM_LOG("%p: New zoom is %f\n", this, newZoom->scale);
   }
 
   // The visual viewport size depends on both the zoom and the display size,
   // and needs to be updated if either might have changed.
   if (newZoom || aType == UpdateType::ViewportSize) {
     UpdateVisualViewportSize(aDisplaySize, newZoom ? *newZoom : zoom);
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -1367,23 +1367,22 @@ class nsIPresShell : public nsStubDocume
    *
    * Also increase the scale of the content by the same amount
    * (that's the "AndScaleTo" part).
    *
    * The resolution defaults to 1.0.
    *
    * |aOrigin| specifies who originated the resolution change. For changes
    * sent by APZ, pass ChangeOrigin::eApz. For changes sent by the main thread,
-   * use pass ChangeOrigin::Other or ChangeOrigin::Restore (similar to the
-   * |aOrigin| parameter of nsIScrollableFrame::ScrollToCSSPixels()).
+   * use pass ChangeOrigin::eMainThread (similar to the |aOrigin| parameter of
+   * nsIScrollableFrame::ScrollToCSSPixels()).
    */
   enum class ChangeOrigin : uint8_t {
     eApz,
-    eRestore,
-    eOther,
+    eMainThread,
   };
   virtual nsresult SetResolutionAndScaleTo(float aResolution,
                                            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
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -6157,17 +6157,17 @@ void ScrollFrameHelper::RestoreState(Pre
   mLastPos = mScrolledFrame ? GetLogicalScrollPosition() : nsPoint(0, 0);
 
   // Resolution properties should only exist on root scroll frames.
   MOZ_ASSERT(mIsRoot || aState->resolution() == 1.0);
 
   if (mIsRoot) {
     nsIPresShell* presShell = mOuter->PresShell();
     presShell->SetResolutionAndScaleTo(aState->resolution(),
-                                       nsIPresShell::ChangeOrigin::eRestore);
+                                       nsIPresShell::ChangeOrigin::eMainThread);
   }
 }
 
 void ScrollFrameHelper::PostScrolledAreaEvent() {
   if (mScrolledAreaEvent.IsPending()) {
     return;
   }
   mScrolledAreaEvent = new ScrolledAreaEvent(this);