Bug 1131470 - Part 1: Rename existing use of ScreenOrientation to ScreenOrientationInternal. r=baku
authorWilliam Chen <wchen@mozilla.com>
Tue, 18 Aug 2015 14:55:09 -0700
changeset 258322 1d800ffe8ceb0f61c210672e18797b6ff891e980
parent 258321 4203e86db40a2fdcc52fa2f6ca263a1d9d704b91
child 258323 afee399c0f2ff1ff14441c8ac829a11170c0b210
push id29249
push userryanvm@gmail.com
push dateWed, 19 Aug 2015 11:17:27 +0000
treeherdermozilla-central@706b23a03d1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1131470
milestone43.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 1131470 - Part 1: Rename existing use of ScreenOrientation to ScreenOrientationInternal. r=baku
dom/base/ScreenOrientation.h
dom/base/nsScreen.cpp
dom/base/nsScreen.h
dom/ipc/PBrowser.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/media/webrtc/MediaEngineGonkVideoSource.cpp
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/composite/AsyncCompositionManager.cpp
gfx/layers/composite/AsyncCompositionManager.h
gfx/layers/ipc/LayersMessages.ipdlh
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/ipc/ShadowLayers.h
gfx/vr/gfxVRCardboard.cpp
hal/Hal.cpp
hal/Hal.h
hal/android/AndroidHal.cpp
hal/fallback/FallbackScreenConfiguration.cpp
hal/gonk/GonkHal.cpp
hal/sandbox/PHal.ipdl
hal/sandbox/SandboxHal.cpp
widget/android/AndroidBridge.cpp
widget/android/nsAppShell.cpp
widget/gonk/OrientationObserver.cpp
widget/gonk/OrientationObserver.h
widget/gonk/nsScreenManagerGonk.cpp
--- a/dom/base/ScreenOrientation.h
+++ b/dom/base/ScreenOrientation.h
@@ -5,25 +5,25 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_ScreenOrientation_h
 #define mozilla_dom_ScreenOrientation_h
 
 namespace mozilla {
 namespace dom {
 
-// Make sure that any change here is also made in
-// * mobile/android/base/GeckoScreenOrientationListener.java
-typedef uint32_t ScreenOrientation;
+// Make sure that any change to ScreenOrientationInternal values are
+// also made in mobile/android/base/GeckoScreenOrientation.java
+typedef uint32_t ScreenOrientationInternal;
 
-static const ScreenOrientation eScreenOrientation_None               = 0;
-static const ScreenOrientation eScreenOrientation_PortraitPrimary    = 1u << 0;
-static const ScreenOrientation eScreenOrientation_PortraitSecondary  = 1u << 1;
-static const ScreenOrientation eScreenOrientation_LandscapePrimary   = 1u << 2;
-static const ScreenOrientation eScreenOrientation_LandscapeSecondary = 1u << 3;
+static const ScreenOrientationInternal eScreenOrientation_None               = 0;
+static const ScreenOrientationInternal eScreenOrientation_PortraitPrimary    = 1u << 0;
+static const ScreenOrientationInternal eScreenOrientation_PortraitSecondary  = 1u << 1;
+static const ScreenOrientationInternal eScreenOrientation_LandscapePrimary   = 1u << 2;
+static const ScreenOrientationInternal eScreenOrientation_LandscapeSecondary = 1u << 3;
 //eScreenOrientation_Default will use the natural orientation for the deivce,
 //it could be PortraitPrimary or LandscapePrimary depends on display resolution
-static const ScreenOrientation eScreenOrientation_Default            = 1u << 4;
+static const ScreenOrientationInternal eScreenOrientation_Default            = 1u << 4;
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_ScreenOrientation_h
--- a/dom/base/nsScreen.cpp
+++ b/dom/base/nsScreen.cpp
@@ -35,17 +35,17 @@ nsScreen::Create(nsPIDOMWindow* aWindow)
     do_QueryInterface(static_cast<nsPIDOMWindow*>(aWindow));
   NS_ENSURE_TRUE(sgo, nullptr);
 
   nsRefPtr<nsScreen> screen = new nsScreen(aWindow);
 
   hal::RegisterScreenConfigurationObserver(screen);
   hal::ScreenConfiguration config;
   hal::GetCurrentScreenConfiguration(&config);
-  screen->mOrientation = config.orientation();
+  screen->mOrientationInternal = config.orientation();
 
   return screen.forget();
 }
 
 nsScreen::nsScreen(nsPIDOMWindow* aWindow)
   : DOMEventTargetHelper(aWindow)
   , mEventListener(nullptr)
 {
@@ -160,52 +160,52 @@ nsScreen::GetAvailRect(nsRect& aRect)
   aRect.width = nsPresContext::AppUnitsToIntCSSPixels(aRect.width);
 
   return NS_OK;
 }
 
 void
 nsScreen::Notify(const hal::ScreenConfiguration& aConfiguration)
 {
-  ScreenOrientation previousOrientation = mOrientation;
-  mOrientation = aConfiguration.orientation();
+  ScreenOrientationInternal previousOrientation = mOrientationInternal;
+  mOrientationInternal = aConfiguration.orientation();
 
-  NS_ASSERTION(mOrientation == eScreenOrientation_PortraitPrimary ||
-               mOrientation == eScreenOrientation_PortraitSecondary ||
-               mOrientation == eScreenOrientation_LandscapePrimary ||
-               mOrientation == eScreenOrientation_LandscapeSecondary,
+  NS_ASSERTION(mOrientationInternal == eScreenOrientation_PortraitPrimary ||
+               mOrientationInternal == eScreenOrientation_PortraitSecondary ||
+               mOrientationInternal == eScreenOrientation_LandscapePrimary ||
+               mOrientationInternal == eScreenOrientation_LandscapeSecondary,
                "Invalid orientation value passed to notify method!");
 
-  if (mOrientation != previousOrientation) {
+  if (mOrientationInternal != previousOrientation) {
     DispatchTrustedEvent(NS_LITERAL_STRING("mozorientationchange"));
   }
 }
 
 void
 nsScreen::GetMozOrientation(nsString& aOrientation)
 {
   if (ShouldResistFingerprinting()) {
     aOrientation.AssignLiteral("landscape-primary");
   } else {
-    switch (mOrientation) {
+    switch (mOrientationInternal) {
     case eScreenOrientation_PortraitPrimary:
       aOrientation.AssignLiteral("portrait-primary");
       break;
     case eScreenOrientation_PortraitSecondary:
       aOrientation.AssignLiteral("portrait-secondary");
       break;
     case eScreenOrientation_LandscapePrimary:
       aOrientation.AssignLiteral("landscape-primary");
       break;
     case eScreenOrientation_LandscapeSecondary:
       aOrientation.AssignLiteral("landscape-secondary");
       break;
     case eScreenOrientation_None:
     default:
-      MOZ_CRASH("Unacceptable mOrientation value");
+      MOZ_CRASH("Unacceptable mOrientationInternal value");
     }
   }
 }
 
 NS_IMETHODIMP
 nsScreen::GetSlowMozOrientation(nsAString& aOrientation)
 {
   nsString orientation;
@@ -254,17 +254,17 @@ nsScreen::MozLockOrientation(const nsASt
   }
   return MozLockOrientation(orientations, aRv);
 }
 
 bool
 nsScreen::MozLockOrientation(const Sequence<nsString>& aOrientations,
                              ErrorResult& aRv)
 {
-  ScreenOrientation orientation = eScreenOrientation_None;
+  ScreenOrientationInternal orientation = eScreenOrientation_None;
 
   for (uint32_t i = 0; i < aOrientations.Length(); ++i) {
     const nsString& item = aOrientations[i];
 
     if (item.EqualsLiteral("portrait")) {
       orientation |= eScreenOrientation_PortraitPrimary |
                      eScreenOrientation_PortraitSecondary;
     } else if (item.EqualsLiteral("portrait-primary")) {
--- a/dom/base/nsScreen.h
+++ b/dom/base/nsScreen.h
@@ -128,17 +128,17 @@ public:
   void Notify(const mozilla::hal::ScreenConfiguration& aConfiguration) override;
 
 protected:
   nsDeviceContext* GetDeviceContext();
   nsresult GetRect(nsRect& aRect);
   nsresult GetAvailRect(nsRect& aRect);
   nsresult GetWindowInnerRect(nsRect& aRect);
 
-  mozilla::dom::ScreenOrientation mOrientation;
+  mozilla::dom::ScreenOrientationInternal mOrientationInternal;
 
 private:
   class FullScreenEventListener final : public nsIDOMEventListener
   {
     ~FullScreenEventListener() {}
   public:
     FullScreenEventListener() {}
 
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -48,17 +48,17 @@ using class mozilla::ContentCache from "
 using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
 using struct nsRect from "nsRect.h";
 using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
 using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
-using mozilla::dom::ScreenOrientation from "mozilla/dom/ScreenOrientation.h";
+using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
 using mozilla::CSSPoint from "Units.h";
 using mozilla::CSSToScreenScale from "Units.h";
 using mozilla::CommandInt from "mozilla/EventForwards.h";
 using mozilla::Modifiers from "mozilla/EventForwards.h";
 using mozilla::layers::GeckoContentController::APZStateChange from "mozilla/layers/GeckoContentController.h";
 using mozilla::WritingMode from "mozilla/WritingModes.h";
 using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/APZUtils.h";
@@ -573,17 +573,18 @@ child:
          uint64_t layersId,
          nullable PRenderFrame renderFrame,
          bool parentIsActive);
 
     LoadURL(nsCString uri, BrowserConfiguration config);
 
     CacheFileDescriptor(nsString path, FileDescriptor fd);
 
-    UpdateDimensions(CSSRect rect, CSSSize size, ScreenOrientation orientation,
+    UpdateDimensions(CSSRect rect, CSSSize size,
+                     ScreenOrientationInternal orientation,
                      LayoutDeviceIntPoint chromeDisp) compressall;
 
     UpdateFrame(FrameMetrics frame);
 
     // The following methods correspond to functions on the GeckoContentController
     // interface in gfx/layers/apz/public/GeckoContentController.h. Refer to documentation
     // in that file for these functions.
     RequestFlingSnap(ViewID aScrollID, CSSPoint aDestination);
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1649,17 +1649,17 @@ TabChild::RecvShow(const ScreenIntSize& 
     ApplyShowInfo(aInfo);
     RecvParentActivated(aParentIsActive);
 
     return res;
 }
 
 bool
 TabChild::RecvUpdateDimensions(const CSSRect& rect, const CSSSize& size,
-                               const ScreenOrientation& orientation,
+                               const ScreenOrientationInternal& orientation,
                                const LayoutDeviceIntPoint& chromeDisp)
 {
     if (!mRemoteFrame) {
         return true;
     }
 
     mUnscaledOuterRect = rect;
     mChromeDisp = chromeDisp;
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -298,17 +298,17 @@ public:
     virtual bool RecvShow(const ScreenIntSize& aSize,
                           const ShowInfo& aInfo,
                           const TextureFactoryIdentifier& aTextureFactoryIdentifier,
                           const uint64_t& aLayersId,
                           PRenderFrameChild* aRenderFrame,
                           const bool& aParentIsActive) override;
     virtual bool RecvUpdateDimensions(const CSSRect& rect,
                                       const CSSSize& size,
-                                      const ScreenOrientation& orientation,
+                                      const ScreenOrientationInternal& orientation,
                                       const LayoutDeviceIntPoint& chromeDisp) override;
     virtual bool RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
     virtual bool RecvRequestFlingSnap(const ViewID& aScrollId,
                                       const CSSPoint& aDestination) override;
     virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
                                              const uint32_t& aScrollGeneration) override;
     virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
                                      const Modifiers& aModifiers,
@@ -414,17 +414,17 @@ public:
     virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
 
     /** Return the DPI of the widget this TabChild draws to. */
     void GetDPI(float* aDPI);
     void GetDefaultScale(double *aScale);
 
     void GetMaxTouchPoints(uint32_t* aTouchPoints);
 
-    ScreenOrientation GetOrientation() { return mOrientation; }
+    ScreenOrientationInternal GetOrientation() const { return mOrientation; }
 
     void SetBackgroundColor(const nscolor& aColor);
 
     void NotifyPainted();
 
     void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
                                   WidgetKeyboardEvent* aEvent);
 
@@ -623,17 +623,17 @@ private:
     bool mAppPackageFileDescriptorRecved;
     // At present only 1 of these is really expected.
     nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
         mCachedFileDescriptorInfos;
     nscolor mLastBackgroundColor;
     bool mDidFakeShow;
     bool mNotified;
     bool mTriedBrowserInit;
-    ScreenOrientation mOrientation;
+    ScreenOrientationInternal mOrientation;
     bool mUpdateHitRegion;
 
     bool mIgnoreKeyPressEvent;
     nsRefPtr<APZEventState> mAPZEventState;
     nsRefPtr<SetAllowedTouchBehaviorCallback> mSetAllowedTouchBehaviorCallback;
     bool mHasValidInnerSize;
     bool mDestroyed;
     // Position of tab, relative to parent widget (typically the window)
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1001,17 +1001,17 @@ TabParent::UpdatePosition()
 void
 TabParent::UpdateDimensions(const nsIntRect& rect, const ScreenIntSize& size)
 {
   if (mIsDestroyed) {
     return;
   }
   hal::ScreenConfiguration config;
   hal::GetCurrentScreenConfiguration(&config);
-  ScreenOrientation orientation = config.orientation();
+  ScreenOrientationInternal orientation = config.orientation();
   LayoutDeviceIntPoint chromeOffset = -GetChildProcessOffset();
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     NS_WARNING("No widget found in TabParent::UpdateDimensions");
     return;
   }
   nsIntRect contentRect = rect;
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -477,17 +477,17 @@ protected:
                                   BrowserConfiguration& aConfiguration);
 
     void SetHasContentOpener(bool aHasContentOpener);
 
     ContentCacheInParent mContentCache;
 
     nsIntRect mRect;
     ScreenIntSize mDimensions;
-    ScreenOrientation mOrientation;
+    ScreenOrientationInternal mOrientation;
     float mDPI;
     CSSToLayoutDeviceScale mDefaultScale;
     bool mUpdatedDimensions;
     LayoutDeviceIntPoint mChromeOffset;
 
 private:
     already_AddRefed<nsFrameLoader> GetFrameLoader(bool aUseCachedFrameLoaderAfterDestroy = false) const;
     nsRefPtr<nsIContentParent> mManager;
--- a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
@@ -405,17 +405,17 @@ MediaEngineGonkVideoSource::DeallocImpl(
   MOZ_ASSERT(NS_IsMainThread());
 
   mCameraControl = nullptr;
   mTextureClientAllocator = nullptr;
 }
 
 // The same algorithm from bug 840244
 static int
-GetRotateAmount(ScreenOrientation aScreen, int aCameraMountAngle, bool aBackCamera) {
+GetRotateAmount(ScreenOrientationInternal aScreen, int aCameraMountAngle, bool aBackCamera) {
   int screenAngle = 0;
   switch (aScreen) {
     case eScreenOrientation_PortraitPrimary:
       screenAngle = 0;
       break;
     case eScreenOrientation_PortraitSecondary:
       screenAngle = 180;
       break;
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -189,17 +189,17 @@ ClientLayerManager::BeginTransactionWith
   mPhase = PHASE_CONSTRUCTION;
 
   MOZ_ASSERT(mKeepAlive.IsEmpty(), "uncommitted txn?");
   nsRefPtr<gfxContext> targetContext = aTarget;
 
   // If the last transaction was incomplete (a failed DoEmptyTransaction),
   // don't signal a new transaction to ShadowLayerForwarder. Carry on adding
   // to the previous transaction.
-  dom::ScreenOrientation orientation;
+  dom::ScreenOrientationInternal orientation;
   if (dom::TabChild* window = mWidget->GetOwningTabChild()) {
     orientation = window->GetOrientation();
   } else {
     hal::ScreenConfiguration currentConfig;
     hal::GetCurrentScreenConfiguration(&currentConfig);
     orientation = currentConfig.orientation();
   }
   IntRect targetBounds = mWidget->GetNaturalBounds();
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -46,17 +46,17 @@ struct nsCSSValueSharedList;
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::gfx;
 
 enum Op { Resolve, Detach };
 
 static bool
-IsSameDimension(dom::ScreenOrientation o1, dom::ScreenOrientation o2)
+IsSameDimension(dom::ScreenOrientationInternal o1, dom::ScreenOrientationInternal o2)
 {
   bool isO1portrait = (o1 == dom::eScreenOrientation_PortraitPrimary || o1 == dom::eScreenOrientation_PortraitSecondary);
   bool isO2portrait = (o2 == dom::eScreenOrientation_PortraitPrimary || o2 == dom::eScreenOrientation_PortraitSecondary);
   return !(isO1portrait ^ isO2portrait);
 }
 
 static bool
 ContentMightReflowOnOrientationChange(const IntRect& rect)
@@ -69,18 +69,18 @@ static void
 WalkTheTree(Layer* aLayer,
             bool& aReady,
             const TargetConfig& aTargetConfig)
 {
   if (RefLayer* ref = aLayer->AsRefLayer()) {
     if (const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(ref->GetReferentId())) {
       if (Layer* referent = state->mRoot) {
         if (!ref->GetVisibleRegion().IsEmpty()) {
-          dom::ScreenOrientation chromeOrientation = aTargetConfig.orientation();
-          dom::ScreenOrientation contentOrientation = state->mTargetConfig.orientation();
+          dom::ScreenOrientationInternal chromeOrientation = aTargetConfig.orientation();
+          dom::ScreenOrientationInternal contentOrientation = state->mTargetConfig.orientation();
           if (!IsSameDimension(chromeOrientation, contentOrientation) &&
               ContentMightReflowOnOrientationChange(aTargetConfig.naturalBounds())) {
             aReady = false;
           }
         }
 
         if (OP == Resolve) {
           ref->ConnectReferentLayer(referent);
--- a/gfx/layers/composite/AsyncCompositionManager.h
+++ b/gfx/layers/composite/AsyncCompositionManager.h
@@ -104,17 +104,17 @@ public:
     mIsFirstPaint |= isFirstPaint;
     mLayersUpdated = true;
     mTargetConfig = aTargetConfig;
     if (aPaintSyncId) {
       mPaintSyncId = aPaintSyncId;
     }
   }
 
-  bool RequiresReorientation(mozilla::dom::ScreenOrientation aOrientation)
+  bool RequiresReorientation(mozilla::dom::ScreenOrientationInternal aOrientation) const
   {
     return mTargetConfig.orientation() != aOrientation;
   }
 
   // True if the underlying layer tree is ready to be composited.
   bool ReadyForCompose() { return mReadyForCompose; }
 
   // Returns true if the next composition will be the first for a
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -24,17 +24,17 @@ using mozilla::gfx::IntPoint from "mozil
 using class mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
 using nscoord from "nsCoord.h";
 using struct nsRect from "nsRect.h";
 using struct nsPoint from "nsPoint.h";
 using class mozilla::TimeDuration from "mozilla/TimeStamp.h";
 using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
 using mozilla::ScreenRotation from "mozilla/WidgetUtils.h";
 using nsCSSProperty from "nsCSSProperty.h";
-using mozilla::dom::ScreenOrientation from "mozilla/dom/ScreenOrientation.h";
+using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
 using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
 using mozilla::LayerMargin from "Units.h";
 using mozilla::LayerPoint from "Units.h";
 using mozilla::LayerRect from "Units.h";
 using mozilla::ParentLayerIntRect from "Units.h";
 using mozilla::layers::ScaleMode from "mozilla/layers/LayersTypes.h";
 using mozilla::layers::EventRegions from "mozilla/layers/LayersTypes.h";
 using mozilla::layers::EventRegionsOverride from "mozilla/layers/LayersTypes.h";
@@ -45,17 +45,17 @@ using struct mozilla::layers::FenceHandl
 using std::string from "string";
 
 namespace mozilla {
 namespace layers {
 
 struct TargetConfig {
   IntRect naturalBounds;
   ScreenRotation rotation;
-  ScreenOrientation orientation;
+  ScreenOrientationInternal orientation;
   nsIntRegion clearRegion;
 };
 
 // Create a shadow layer for |layer|
 struct OpCreatePaintedLayer    { PLayer layer; };
 struct OpCreateContainerLayer  { PLayer layer; };
 struct OpCreateImageLayer      { PLayer layer; };
 struct OpCreateColorLayer      { PLayer layer; };
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -55,17 +55,17 @@ public:
   Transaction()
     : mTargetRotation(ROTATION_0)
     , mSwapRequired(false)
     , mOpen(false)
     , mRotationChanged(false)
   {}
 
   void Begin(const gfx::IntRect& aTargetBounds, ScreenRotation aRotation,
-             dom::ScreenOrientation aOrientation)
+             dom::ScreenOrientationInternal aOrientation)
   {
     mOpen = true;
     mTargetBounds = aTargetBounds;
     if (aRotation != mTargetRotation) {
       // the first time this is called, mRotationChanged will be false if
       // aRotation is 0, but we should be OK because for the first transaction
       // we should only compose if it is non-empty. See the caller(s) of
       // RotationChanged.
@@ -133,17 +133,17 @@ public:
 
   bool Opened() const { return mOpen; }
 
   EditVector mCset;
   EditVector mPaints;
   ShadowableLayerSet mMutants;
   gfx::IntRect mTargetBounds;
   ScreenRotation mTargetRotation;
-  dom::ScreenOrientation mTargetOrientation;
+  dom::ScreenOrientationInternal mTargetOrientation;
   bool mSwapRequired;
 
 private:
   bool mOpen;
   bool mRotationChanged;
 
   // disabled
   Transaction(const Transaction&);
@@ -180,17 +180,17 @@ ShadowLayerForwarder::~ShadowLayerForwar
     mShadowManager->SetForwarder(nullptr);
     mShadowManager->Destroy();
   }
 }
 
 void
 ShadowLayerForwarder::BeginTransaction(const gfx::IntRect& aTargetBounds,
                                        ScreenRotation aRotation,
-                                       dom::ScreenOrientation aOrientation)
+                                       dom::ScreenOrientationInternal aOrientation)
 {
   MOZ_ASSERT(HasShadowManager(), "no manager to forward to");
   MOZ_ASSERT(mTxn->Finished(), "uncommitted txn?");
   mTxn->Begin(aTargetBounds, aRotation, aOrientation);
 }
 
 static PLayerChild*
 Shadow(ShadowableLayer* aLayer)
--- a/gfx/layers/ipc/ShadowLayers.h
+++ b/gfx/layers/ipc/ShadowLayers.h
@@ -150,17 +150,17 @@ public:
                                ShadowableLayer* aLayer);
 
   /**
    * Begin recording a transaction to be forwarded atomically to a
    * LayerManagerComposite.
    */
   void BeginTransaction(const gfx::IntRect& aTargetBounds,
                         ScreenRotation aRotation,
-                        mozilla::dom::ScreenOrientation aOrientation);
+                        mozilla::dom::ScreenOrientationInternal aOrientation);
 
   /**
    * The following methods may only be called after BeginTransaction()
    * but before EndTransaction().  They mirror the LayerManager
    * interface in Layers.h.
    */
 
   /**
--- a/gfx/vr/gfxVRCardboard.cpp
+++ b/gfx/vr/gfxVRCardboard.cpp
@@ -37,17 +37,17 @@ using namespace mozilla::gfx::impl;
 
 namespace {
 // some utility functions
 
 // This remaps axes in the given matrix to a new configuration based on the
 // screen orientation.  Similar to what Android SensorManager.remapCoordinateSystem
 // does, except only for a fixed number of transforms that we need.
 Matrix4x4
-RemapMatrixForOrientation(ScreenOrientation screenConfig, const Matrix4x4& aMatrix)
+RemapMatrixForOrientation(ScreenOrientationInternal screenConfig, const Matrix4x4& aMatrix)
 {
   Matrix4x4 out;
   const float *in = &aMatrix._11;
   float *o = &out._11;
 
   if (screenConfig == eScreenOrientation_LandscapePrimary) {
     // remap X,Y -> Y,-X
     o[0] = -in[1]; o[1] = in[0]; o[2] = in[2];
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -704,17 +704,17 @@ GetCurrentScreenConfiguration(ScreenConf
 void
 NotifyScreenConfigurationChange(const ScreenConfiguration& aScreenConfiguration)
 {
   sScreenConfigurationObservers.CacheInformation(aScreenConfiguration);
   sScreenConfigurationObservers.BroadcastCachedInformation();
 }
 
 bool
-LockScreenOrientation(const dom::ScreenOrientation& aOrientation)
+LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation)
 {
   AssertMainThread();
   RETURN_PROXY_IF_SANDBOXED(LockScreenOrientation(aOrientation), false);
 }
 
 void
 UnlockScreenOrientation()
 {
--- a/hal/Hal.h
+++ b/hal/Hal.h
@@ -389,17 +389,17 @@ void GetCurrentScreenConfiguration(hal::
  * @param aScreenConfiguration The new screen orientation.
  */
 void NotifyScreenConfigurationChange(const hal::ScreenConfiguration& aScreenConfiguration);
 
 /**
  * Lock the screen orientation to the specific orientation.
  * @return Whether the lock has been accepted.
  */
-bool LockScreenOrientation(const dom::ScreenOrientation& aOrientation);
+bool LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation);
 
 /**
  * Unlock the screen orientation.
  */
 void UnlockScreenOrientation();
 
 /**
  * Register an observer for the switch of given SwitchDevice.
--- a/hal/android/AndroidHal.cpp
+++ b/hal/android/AndroidHal.cpp
@@ -118,31 +118,31 @@ GetCurrentScreenConfiguration(ScreenConf
     do_GetService("@mozilla.org/gfx/screenmanager;1", &rv);
   if (NS_FAILED(rv)) {
     NS_ERROR("Can't find nsIScreenManager!");
     return;
   }
 
   nsIntRect rect;
   int32_t colorDepth, pixelDepth;
-  ScreenOrientation orientation;
+  ScreenOrientationInternal orientation;
   nsCOMPtr<nsIScreen> screen;
 
   screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
   screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
   screen->GetColorDepth(&colorDepth);
   screen->GetPixelDepth(&pixelDepth);
-  orientation = static_cast<ScreenOrientation>(bridge->GetScreenOrientation());
+  orientation = static_cast<ScreenOrientationInternal>(bridge->GetScreenOrientation());
 
   *aScreenConfiguration =
     hal::ScreenConfiguration(rect, orientation, colorDepth, pixelDepth);
 }
 
 bool
-LockScreenOrientation(const ScreenOrientation& aOrientation)
+LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
 {
   switch (aOrientation) {
     // The Android backend only supports these orientations.
     case eScreenOrientation_PortraitPrimary:
     case eScreenOrientation_PortraitSecondary:
     case eScreenOrientation_PortraitPrimary | eScreenOrientation_PortraitSecondary:
     case eScreenOrientation_LandscapePrimary:
     case eScreenOrientation_LandscapeSecondary:
--- a/hal/fallback/FallbackScreenConfiguration.cpp
+++ b/hal/fallback/FallbackScreenConfiguration.cpp
@@ -28,33 +28,33 @@ GetCurrentScreenConfiguration(hal::Scree
     do_GetService("@mozilla.org/gfx/screenmanager;1", &rv);
   if (NS_FAILED(rv)) {
     NS_ERROR("Can't find nsIScreenManager!");
     return;
   }
 
   nsIntRect rect;
   int32_t colorDepth, pixelDepth;
-  dom::ScreenOrientation orientation;
+  dom::ScreenOrientationInternal orientation;
   nsCOMPtr<nsIScreen> screen;
 
   screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
   screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
   screen->GetColorDepth(&colorDepth);
   screen->GetPixelDepth(&pixelDepth);
   orientation = rect.width >= rect.height
                 ? dom::eScreenOrientation_LandscapePrimary
                 : dom::eScreenOrientation_PortraitPrimary;
 
   *aScreenConfiguration =
       hal::ScreenConfiguration(rect, orientation, colorDepth, pixelDepth);
 }
 
 bool
-LockScreenOrientation(const dom::ScreenOrientation& aOrientation)
+LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation)
 {
   return false;
 }
 
 void
 UnlockScreenOrientation()
 {
 }
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -1025,17 +1025,17 @@ DisableScreenConfigurationNotifications(
 void
 GetCurrentScreenConfiguration(hal::ScreenConfiguration* aScreenConfiguration)
 {
   nsRefPtr<nsScreenGonk> screen = nsScreenManagerGonk::GetPrimaryScreen();
   *aScreenConfiguration = screen->GetConfiguration();
 }
 
 bool
-LockScreenOrientation(const dom::ScreenOrientation& aOrientation)
+LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation)
 {
   return OrientationObserver::GetInstance()->LockScreenOrientation(aOrientation);
 }
 
 void
 UnlockScreenOrientation()
 {
   OrientationObserver::GetInstance()->UnlockScreenOrientation();
--- a/hal/sandbox/PHal.ipdl
+++ b/hal/sandbox/PHal.ipdl
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PContent;
 include protocol PBrowser;
 
 include "mozilla/GfxMessageUtils.h";
 
-using mozilla::dom::ScreenOrientation from "mozilla/dom/ScreenOrientation.h";
+using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
 using mozilla::hal::SensorType from "mozilla/HalSensor.h";
 using mozilla::hal::SensorAccuracyType from "mozilla/HalSensor.h";
 using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h";
 using mozilla::hal::SwitchState from "mozilla/HalTypes.h";
 using mozilla::hal::SwitchDevice from "mozilla/HalTypes.h";
 using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
 using nsIntRect from "nsRect.h";
 using PRTime from "prtime.h";
@@ -53,17 +53,17 @@ struct WakeLockInformation {
   nsString topic;
   uint32_t numLocks;
   uint32_t numHidden;
   uint64_t[] lockingProcesses;
 };
 
 struct ScreenConfiguration {
   nsIntRect rect;
-  ScreenOrientation orientation;
+  ScreenOrientationInternal orientation;
   uint32_t colorDepth;
   uint32_t pixelDepth;
 };
 
 struct FMRadioOperationInformation {
   FMRadioOperation operation;
   FMRadioOperationStatus status;
   uint32_t frequency;
@@ -152,17 +152,17 @@ parent:
     DisableWakeLockNotifications();
     sync GetWakeLockInfo(nsString aTopic)
       returns (WakeLockInformation aWakeLockInfo);
 
     EnableScreenConfigurationNotifications();
     DisableScreenConfigurationNotifications();
     prio(urgent) sync GetCurrentScreenConfiguration()
       returns (ScreenConfiguration aScreenConfiguration);
-    sync LockScreenOrientation(ScreenOrientation aOrientation)
+    sync LockScreenOrientation(ScreenOrientationInternal aOrientation)
       returns (bool allowed);
     UnlockScreenOrientation();
  
     EnableSwitchNotifications(SwitchDevice aDevice);
     DisableSwitchNotifications(SwitchDevice aDevice);
     sync GetCurrentSwitchState(SwitchDevice aDevice)
       returns (SwitchState aState);
 
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -117,17 +117,17 @@ DisableScreenConfigurationNotifications(
 
 void
 GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration)
 {
   Hal()->SendGetCurrentScreenConfiguration(aScreenConfiguration);
 }
 
 bool
-LockScreenOrientation(const dom::ScreenOrientation& aOrientation)
+LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation)
 {
   bool allowed;
   Hal()->SendLockScreenOrientation(aOrientation, &allowed);
   return allowed;
 }
 
 void
 UnlockScreenOrientation()
@@ -587,17 +587,17 @@ public:
 
   virtual bool
   RecvGetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) override {
     hal::GetCurrentScreenConfiguration(aScreenConfiguration);
     return true;
   }
 
   virtual bool
-  RecvLockScreenOrientation(const dom::ScreenOrientation& aOrientation, bool* aAllowed) override
+  RecvLockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation, bool* aAllowed) override
   {
     // FIXME/bug 777980: unprivileged content may only lock
     // orientation while fullscreen.  We should check whether the
     // request comes from an actor in a process that might be
     // fullscreen.  We don't have that information currently.
     *aAllowed = hal::LockScreenOrientation(aOrientation);
     return true;
   }
--- a/widget/android/AndroidBridge.cpp
+++ b/widget/android/AndroidBridge.cpp
@@ -1573,17 +1573,17 @@ AndroidBridge::GetScreenOrientation()
 {
     ALOG_BRIDGE("AndroidBridge::GetScreenOrientation");
 
     int16_t orientation = GeckoAppShell::GetScreenOrientationWrapper();
 
     if (!orientation)
         return dom::eScreenOrientation_None;
 
-    return static_cast<dom::ScreenOrientation>(orientation);
+    return static_cast<dom::ScreenOrientationInternal>(orientation);
 }
 
 void
 AndroidBridge::InvalidateAndScheduleComposite()
 {
     nsWindow::InvalidateAndScheduleComposite();
 }
 
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -583,25 +583,25 @@ nsAppShell::ProcessNextNativeEvent(bool 
             do_GetService("@mozilla.org/gfx/screenmanager;1", &rv);
         if (NS_FAILED(rv)) {
             NS_ERROR("Can't find nsIScreenManager!");
             break;
         }
 
         nsIntRect rect;
         int32_t colorDepth, pixelDepth;
-        dom::ScreenOrientation orientation;
+        dom::ScreenOrientationInternal orientation;
         nsCOMPtr<nsIScreen> screen;
 
         screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
         screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
         screen->GetColorDepth(&colorDepth);
         screen->GetPixelDepth(&pixelDepth);
         orientation =
-            static_cast<dom::ScreenOrientation>(curEvent->ScreenOrientation());
+            static_cast<dom::ScreenOrientationInternal>(curEvent->ScreenOrientation());
 
         hal::NotifyScreenConfigurationChange(
             hal::ScreenConfiguration(rect, orientation, colorDepth, pixelDepth));
         break;
     }
 
     case AndroidGeckoEvent::CALL_OBSERVER:
     {
--- a/widget/gonk/OrientationObserver.cpp
+++ b/widget/gonk/OrientationObserver.cpp
@@ -28,17 +28,17 @@
 
 using namespace mozilla;
 using namespace dom;
 
 namespace {
 
 struct OrientationMapping {
   uint32_t mScreenRotation;
-  ScreenOrientation mDomOrientation;
+  ScreenOrientationInternal mDomOrientation;
 };
 
 static OrientationMapping sOrientationMappings[] = {
   {nsIScreen::ROTATION_0_DEG,   eScreenOrientation_PortraitPrimary},
   {nsIScreen::ROTATION_180_DEG, eScreenOrientation_PortraitSecondary},
   {nsIScreen::ROTATION_90_DEG,  eScreenOrientation_LandscapePrimary},
   {nsIScreen::ROTATION_270_DEG, eScreenOrientation_LandscapeSecondary},
 };
@@ -101,17 +101,17 @@ DetectDefaultOrientation()
  * conversion.
  *
  * @param aOrientation DOM orientation e.g.
  *        dom::eScreenOrientation_PortraitPrimary.
  * @param aResult output nsIScreen rotation e.g. nsIScreen::ROTATION_0_DEG.
  * @return NS_OK on success. NS_ILLEGAL_VALUE on failure.
  */
 static nsresult
-ConvertToScreenRotation(ScreenOrientation aOrientation, uint32_t *aResult)
+ConvertToScreenRotation(ScreenOrientationInternal aOrientation, uint32_t *aResult)
 {
   for (int i = 0; i < ArrayLength(sOrientationMappings); i++) {
     if (aOrientation & sOrientationMappings[i].mDomOrientation) {
       // Shift the mappings in sOrientationMappings so devices with default
       // landscape orientation map landscape-primary to 0 degree and so forth.
       int adjusted = (i + sOrientationOffset) %
                      ArrayLength(sOrientationMappings);
       *aResult = sOrientationMappings[adjusted].mScreenRotation;
@@ -127,17 +127,17 @@ ConvertToScreenRotation(ScreenOrientatio
  * Converts nsIScreen rotation to DOM orientation.
  *
  * @param aRotation nsIScreen rotation e.g. nsIScreen::ROTATION_0_DEG.
  * @param aResult output DOM orientation e.g.
  *        dom::eScreenOrientation_PortraitPrimary.
  * @return NS_OK on success. NS_ILLEGAL_VALUE on failure.
  */
 nsresult
-ConvertToDomOrientation(uint32_t aRotation, ScreenOrientation *aResult)
+ConvertToDomOrientation(uint32_t aRotation, ScreenOrientationInternal *aResult)
 {
   for (int i = 0; i < ArrayLength(sOrientationMappings); i++) {
     if (aRotation == sOrientationMappings[i].mScreenRotation) {
       // Shift the mappings in sOrientationMappings so devices with default
       // landscape orientation map 0 degree to landscape-primary and so forth.
       int adjusted = (i + sOrientationOffset) %
                      ArrayLength(sOrientationMappings);
       *aResult = sOrientationMappings[adjusted].mDomOrientation;
@@ -212,17 +212,17 @@ OrientationObserver::Notify(const hal::S
     return;
   }
 
   int rotation = mOrientation->OnSensorChanged(aSensorData, static_cast<int>(currRotation));
   if (rotation < 0 || rotation == currRotation) {
     return;
   }
 
-  ScreenOrientation orientation;
+  ScreenOrientationInternal orientation;
   if (NS_FAILED(ConvertToDomOrientation(rotation, &orientation))) {
     return;
   }
 
   if ((mAllowedOrientations & orientation) == eScreenOrientation_None) {
     // The orientation from sensor is not allowed.
     return;
   }
@@ -254,17 +254,17 @@ OrientationObserver::DisableAutoOrientat
 {
   MOZ_ASSERT(NS_IsMainThread() && mAutoOrientationEnabled);
 
   hal::UnregisterSensorObserver(hal::SENSOR_ACCELERATION, this);
   mAutoOrientationEnabled = false;
 }
 
 bool
-OrientationObserver::LockScreenOrientation(ScreenOrientation aOrientation)
+OrientationObserver::LockScreenOrientation(ScreenOrientationInternal aOrientation)
 {
   MOZ_ASSERT(aOrientation | (eScreenOrientation_PortraitPrimary |
                              eScreenOrientation_PortraitSecondary |
                              eScreenOrientation_LandscapePrimary |
                              eScreenOrientation_LandscapeSecondary |
                              eScreenOrientation_Default));
 
   if (aOrientation == eScreenOrientation_Default) {
@@ -290,17 +290,17 @@ OrientationObserver::LockScreenOrientati
 
   nsCOMPtr<nsIScreen> screen = GetPrimaryScreen();
   NS_ENSURE_TRUE(screen, false);
 
   uint32_t currRotation;
   nsresult rv = screen->GetRotation(&currRotation);
   NS_ENSURE_SUCCESS(rv, false);
 
-  ScreenOrientation currOrientation = eScreenOrientation_None;
+  ScreenOrientationInternal currOrientation = eScreenOrientation_None;
   rv = ConvertToDomOrientation(currRotation, &currOrientation);
   NS_ENSURE_SUCCESS(rv, false);
 
   // Don't rotate if the current orientation matches one of the
   // requested orientations.
   if (currOrientation & aOrientation) {
     return true;
   }
@@ -309,17 +309,17 @@ OrientationObserver::LockScreenOrientati
   uint32_t rotation;
   rv = ConvertToScreenRotation(aOrientation, &rotation);
   NS_ENSURE_SUCCESS(rv, false);
 
   rv = screen->SetRotation(rotation);
   NS_ENSURE_SUCCESS(rv, false);
 
   // This conversion will disambiguate aOrientation.
-  ScreenOrientation orientation;
+  ScreenOrientationInternal orientation;
   rv = ConvertToDomOrientation(rotation, &orientation);
   NS_ENSURE_SUCCESS(rv, false);
 
   return true;
 }
 
 void
 OrientationObserver::UnlockScreenOrientation()
--- a/widget/gonk/OrientationObserver.h
+++ b/widget/gonk/OrientationObserver.h
@@ -27,17 +27,17 @@ class ProcessOrientation;
 namespace hal {
 class SensorData;
 typedef mozilla::Observer<SensorData> ISensorObserver;
 } // namespace hal
 } // namespace mozilla
 
 using mozilla::hal::ISensorObserver;
 using mozilla::hal::SensorData;
-using mozilla::dom::ScreenOrientation;
+using mozilla::dom::ScreenOrientationInternal;
 
 class OrientationObserver : public ISensorObserver {
 public:
   OrientationObserver();
   ~OrientationObserver();
 
   // Call DisableAutoOrientation on the existing OrientatiOnobserver singleton,
   // if it exists.  If no OrientationObserver exists, do nothing.
@@ -46,17 +46,17 @@ public:
   // Notification from sensor.
   void Notify(const SensorData& aSensorData);
 
   // Methods to enable/disable automatic orientation.
   void EnableAutoOrientation();
   void DisableAutoOrientation();
 
   // Methods called by methods in hal_impl namespace.
-  bool LockScreenOrientation(ScreenOrientation aOrientation);
+  bool LockScreenOrientation(ScreenOrientationInternal aOrientation);
   void UnlockScreenOrientation();
 
   static OrientationObserver* GetInstance();
 
 private:
   bool mAutoOrientationEnabled;
   uint32_t mAllowedOrientations;
   mozilla::UniquePtr<mozilla::ProcessOrientation> mOrientation;
--- a/widget/gonk/nsScreenManagerGonk.cpp
+++ b/widget/gonk/nsScreenManagerGonk.cpp
@@ -290,17 +290,17 @@ nsScreenGonk::GetNaturalBounds()
 uint32_t
 nsScreenGonk::EffectiveScreenRotation()
 {
     return (mScreenRotation + mPhysicalScreenRotation) % (360 / 90);
 }
 
 // NB: This isn't gonk-specific, but gonk is the only widget backend
 // that does this calculation itself, currently.
-static ScreenOrientation
+static ScreenOrientationInternal
 ComputeOrientation(uint32_t aRotation, const nsIntSize& aScreenSize)
 {
     bool naturallyPortrait = (aScreenSize.height > aScreenSize.width);
     switch (aRotation) {
     case nsIScreen::ROTATION_0_DEG:
         return (naturallyPortrait ? eScreenOrientation_PortraitPrimary :
                 eScreenOrientation_LandscapePrimary);
     case nsIScreen::ROTATION_90_DEG:
@@ -317,18 +317,18 @@ ComputeOrientation(uint32_t aRotation, c
     default:
         MOZ_CRASH("Gonk screen must always have a known rotation");
     }
 }
 
 ScreenConfiguration
 nsScreenGonk::GetConfiguration()
 {
-    ScreenOrientation orientation = ComputeOrientation(mScreenRotation,
-                                                       mNaturalBounds.Size());
+    ScreenOrientationInternal orientation = ComputeOrientation(mScreenRotation,
+                                                               mNaturalBounds.Size());
 
     // NB: perpetuating colorDepth == pixelDepth illusion here, for
     // consistency.
     return ScreenConfiguration(mVirtualBounds, orientation,
                                mColorDepth, mColorDepth);
 }
 
 void