Backed out bdf72cebcd85 to fix a CLOSED TREE.
authorMike Conley <mconley@mozilla.com>
Mon, 14 Jul 2014 12:20:16 -0400
changeset 193819 0295cdddbce79e859596f85cd15fed654b397fe4
parent 193818 161857889ed5dc7eed3f3036ea062f061573a000
child 193820 3a497072902b2f2aad50261421a78637847c130c
push id46213
push usermconley@mozilla.com
push dateMon, 14 Jul 2014 16:21:22 +0000
treeherdermozilla-inbound@0295cdddbce7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone33.0a1
backs outbdf72cebcd85962092b1cc6772c2d5afd839e441
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
Backed out bdf72cebcd85 to fix a CLOSED TREE.
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PContent.ipdl
dom/ipc/PScreenManager.ipdl
dom/ipc/ScreenManagerParent.cpp
dom/ipc/ScreenManagerParent.h
dom/ipc/TabParent.h
dom/ipc/moz.build
gfx/src/nsDeviceContext.cpp
widget/android/nsScreenManagerAndroid.cpp
widget/android/nsScreenManagerAndroid.h
widget/cocoa/nsScreenCocoa.h
widget/cocoa/nsScreenCocoa.mm
widget/cocoa/nsScreenManagerCocoa.mm
widget/cocoa/nsWidgetFactory.mm
widget/gonk/nsScreenManagerGonk.h
widget/gonk/nsWindow.cpp
widget/gtk/nsScreenGtk.cpp
widget/gtk/nsScreenGtk.h
widget/gtk/nsScreenManagerGtk.cpp
widget/gtk/nsWidgetFactory.cpp
widget/nsIScreen.idl
widget/nsIScreenManager.idl
widget/windows/nsScreenManagerWin.cpp
widget/windows/nsScreenWin.cpp
widget/windows/nsScreenWin.h
widget/windows/nsWidgetFactory.cpp
widget/xpwidgets/PuppetWidget.cpp
widget/xpwidgets/PuppetWidget.h
widget/xpwidgets/ScreenProxy.cpp
widget/xpwidgets/ScreenProxy.h
widget/xpwidgets/moz.build
widget/xpwidgets/nsContentProcessWidgetFactory.cpp
widget/xpwidgets/nsScreenManagerProxy.cpp
widget/xpwidgets/nsScreenManagerProxy.h
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -54,17 +54,16 @@
 #include "nsICycleCollectorListener.h"
 #include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIMemoryReporter.h"
 #include "nsIMemoryInfoDumper.h"
 #include "nsIMutable.h"
 #include "nsIObserverService.h"
 #include "nsIScriptSecurityManager.h"
-#include "nsScreenManagerProxy.h"
 #include "nsMemoryInfoDumper.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleSheetService.h"
 #include "nsXULAppAPI.h"
 #include "nsIScriptError.h"
 #include "nsIConsoleService.h"
 #include "nsJSEnvironment.h"
 #include "SandboxHal.h"
@@ -165,17 +164,16 @@ using namespace mozilla::dom::telephony;
 using namespace mozilla::hal_sandbox;
 using namespace mozilla::ipc;
 using namespace mozilla::layers;
 using namespace mozilla::net;
 using namespace mozilla::jsipc;
 #if defined(MOZ_WIDGET_GONK)
 using namespace mozilla::system;
 #endif
-using namespace mozilla::widget;
 
 #ifdef MOZ_NUWA_PROCESS
 static bool sNuwaForking = false;
 
 // The size of the reserved stack (in unsigned ints). It's used to reserve space
 // to push sigsetjmp() in NuwaCheckpointCurrentThread() to higher in the stack
 // so that after it returns and do other work we don't garble the stack we want
 // to preserve in NuwaCheckpointCurrentThread().
@@ -1197,38 +1195,16 @@ ContentChild::AllocPNeckoChild()
 
 bool
 ContentChild::DeallocPNeckoChild(PNeckoChild* necko)
 {
     delete necko;
     return true;
 }
 
-PScreenManagerChild*
-ContentChild::AllocPScreenManagerChild(uint32_t* aNumberOfScreens,
-                                       float* aSystemDefaultScale,
-                                       bool* aSuccess)
-{
-    // The ContentParent should never attempt to allocate the
-    // nsScreenManagerProxy. Instead, the nsScreenManagerProxy
-    // service is requested and instantiated via XPCOM, and the
-    // constructor of nsScreenManagerProxy sets up the IPC connection.
-    NS_NOTREACHED("Should never get here!");
-    return nullptr;
-}
-
-bool
-ContentChild::DeallocPScreenManagerChild(PScreenManagerChild* aService)
-{
-    // nsScreenManagerProxy is AddRef'd in its constructor.
-    nsScreenManagerProxy *child = static_cast<nsScreenManagerProxy*>(aService);
-    child->Release();
-    return true;
-}
-
 PExternalHelperAppChild*
 ContentChild::AllocPExternalHelperAppChild(const OptionalURIParams& uri,
                                            const nsCString& aMimeContentType,
                                            const nsCString& aContentDisposition,
                                            const uint32_t& aContentDispositionHint,
                                            const nsString& aContentDispositionFilename,
                                            const bool& aForceSave,
                                            const int64_t& aContentLength,
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -188,22 +188,16 @@ public:
     virtual PTestShellChild* AllocPTestShellChild() MOZ_OVERRIDE;
     virtual bool DeallocPTestShellChild(PTestShellChild*) MOZ_OVERRIDE;
     virtual bool RecvPTestShellConstructor(PTestShellChild*) MOZ_OVERRIDE;
     jsipc::JavaScriptChild *GetCPOWManager();
 
     virtual PNeckoChild* AllocPNeckoChild() MOZ_OVERRIDE;
     virtual bool DeallocPNeckoChild(PNeckoChild*) MOZ_OVERRIDE;
 
-    virtual PScreenManagerChild*
-    AllocPScreenManagerChild(uint32_t* aNumberOfScreens,
-                             float* aSystemDefaultScale,
-                             bool* aSuccess) MOZ_OVERRIDE;
-    virtual bool DeallocPScreenManagerChild(PScreenManagerChild*) MOZ_OVERRIDE;
-
     virtual PExternalHelperAppChild *AllocPExternalHelperAppChild(
             const OptionalURIParams& uri,
             const nsCString& aMimeContentType,
             const nsCString& aContentDisposition,
             const uint32_t& aContentDispositionHint,
             const nsString& aContentDispositionFilename,
             const bool& aForceSave,
             const int64_t& aContentLength,
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -108,17 +108,16 @@
 #include "nsServiceManagerUtils.h"
 #include "nsStyleSheetService.h"
 #include "nsThreadUtils.h"
 #include "nsToolkitCompsCID.h"
 #include "nsWidgetsCID.h"
 #include "PreallocatedProcessManager.h"
 #include "ProcessPriorityManager.h"
 #include "SandboxHal.h"
-#include "ScreenManagerParent.h"
 #include "StructuredCloneUtils.h"
 #include "TabParent.h"
 #include "URIUtils.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIDocShell.h"
 #include "mozilla/net/NeckoMessageUtils.h"
 #include "gfxPrefs.h"
 #include "prio.h"
@@ -185,17 +184,16 @@ using namespace mozilla::dom::indexedDB;
 using namespace mozilla::dom::power;
 using namespace mozilla::dom::mobilemessage;
 using namespace mozilla::dom::telephony;
 using namespace mozilla::hal;
 using namespace mozilla::ipc;
 using namespace mozilla::layers;
 using namespace mozilla::net;
 using namespace mozilla::jsipc;
-using namespace mozilla::widget;
 
 #ifdef ENABLE_TESTS
 
 class BackgroundTester MOZ_FINAL : public nsIIPCBackgroundChildCreateCallback,
                                    public nsIObserver
 {
     static uint32_t sCallbackCount;
 
@@ -2900,31 +2898,16 @@ ContentParent::AllocPNeckoParent()
 
 bool
 ContentParent::DeallocPNeckoParent(PNeckoParent* necko)
 {
     delete necko;
     return true;
 }
 
-PScreenManagerParent*
-ContentParent::AllocPScreenManagerParent(uint32_t* aNumberOfScreens,
-                                         float* aSystemDefaultScale,
-                                         bool* aSuccess)
-{
-    return new ScreenManagerParent(aNumberOfScreens, aSystemDefaultScale, aSuccess);
-}
-
-bool
-ContentParent::DeallocPScreenManagerParent(PScreenManagerParent* aActor)
-{
-    delete aActor;
-    return true;
-}
-
 PExternalHelperAppParent*
 ContentParent::AllocPExternalHelperAppParent(const OptionalURIParams& uri,
                                              const nsCString& aMimeContentType,
                                              const nsCString& aContentDisposition,
                                              const uint32_t& aContentDispositionHint,
                                              const nsString& aContentDispositionFilename,
                                              const bool& aForceSave,
                                              const int64_t& aContentLength,
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -225,22 +225,16 @@ public:
                                   const NativeThreadId& tid,
                                   const uint32_t& processType) MOZ_OVERRIDE;
 
     virtual PNeckoParent* AllocPNeckoParent() MOZ_OVERRIDE;
     virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) MOZ_OVERRIDE {
         return PContentParent::RecvPNeckoConstructor(aActor);
     }
 
-    virtual PScreenManagerParent*
-    AllocPScreenManagerParent(uint32_t* aNumberOfScreens,
-                              float* aSystemDefaultScale,
-                              bool* aSuccess) MOZ_OVERRIDE;
-    virtual bool DeallocPScreenManagerParent(PScreenManagerParent* aActor) MOZ_OVERRIDE;
-
     virtual PHalParent* AllocPHalParent() MOZ_OVERRIDE;
     virtual bool RecvPHalConstructor(PHalParent* aActor) MOZ_OVERRIDE {
         return PContentParent::RecvPHalConstructor(aActor);
     }
 
     virtual PStorageParent* AllocPStorageParent() MOZ_OVERRIDE;
     virtual bool RecvPStorageConstructor(PStorageParent* aActor) MOZ_OVERRIDE {
         return PContentParent::RecvPStorageConstructor(aActor);
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -18,17 +18,16 @@ include protocol PDeviceStorageRequest;
 include protocol PFileDescriptorSet;
 include protocol PFMRadio;
 include protocol PFileSystemRequest;
 include protocol PHal;
 include protocol PImageBridge;
 include protocol PIndexedDB;
 include protocol PMemoryReportRequest;
 include protocol PNecko;
-include protocol PScreenManager;
 include protocol PSharedBufferManager;
 include protocol PSms;
 include protocol PSpeechSynthesis;
 include protocol PStorage;
 include protocol PTelephony;
 include protocol PTestShell;
 include protocol PJavaScript;
 include DOMTypes;
@@ -299,17 +298,16 @@ intr protocol PContent
     manages PFileSystemRequest;
     manages PExternalHelperApp;
     manages PFileDescriptorSet;
     manages PFMRadio;
     manages PHal;
     manages PIndexedDB;
     manages PMemoryReportRequest;
     manages PNecko;
-    manages PScreenManager;
     manages PSms;
     manages PSpeechSynthesis;
     manages PStorage;
     manages PTelephony;
     manages PTestShell;
     manages PJavaScript;
 
 both:
@@ -476,21 +474,16 @@ parent:
     async GetSystemMemory(uint64_t getterId);
 
     PHal();
 
     PIndexedDB();
 
     PNecko();
 
-    sync PScreenManager()
-        returns (uint32_t numberOfScreens,
-                 float systemDefaultScale,
-                 bool success);
-
     PSms();
 
     PSpeechSynthesis();
 
     PStorage();
 
     PTelephony();
 
deleted file mode 100644
--- a/dom/ipc/PScreenManager.ipdl
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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 PBrowser;
-include protocol PContent;
-
-using struct nsIntRect from "nsRect.h";
-
-namespace mozilla {
-namespace dom {
-
-struct ScreenDetails {
-  uint32_t id;
-  nsIntRect rect;
-  nsIntRect availRect;
-  int32_t pixelDepth;
-  int32_t colorDepth;
-  double contentsScaleFactor;
-};
-
-sync protocol PScreenManager
-{
-  manager PContent;
-
-parent:
-    sync Refresh()
-      returns (uint32_t numberOfScreens,
-               float systemDefaultScale,
-               bool success);
-
-    sync ScreenRefresh(uint32_t aId)
-      returns (ScreenDetails screen,
-               bool success);
-
-    sync GetPrimaryScreen()
-      returns (ScreenDetails screen,
-               bool success);
-
-    sync ScreenForRect(int32_t aLeft,
-                       int32_t aTop,
-                       int32_t aWidth,
-                       int32_t aHeight)
-      returns (ScreenDetails screen,
-               bool success);
-
-    sync ScreenForBrowser(PBrowser aBrowser)
-      returns (ScreenDetails screen,
-               bool success);
-
-child:
-    __delete__();
-};
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/ScreenManagerParent.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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 "mozilla/dom/TabParent.h"
-#include "mozilla/unused.h"
-#include "nsIWidget.h"
-#include "nsServiceManagerUtils.h"
-#include "ScreenManagerParent.h"
-
-namespace mozilla {
-namespace dom {
-
-static const char *sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1";
-
-ScreenManagerParent::ScreenManagerParent(uint32_t* aNumberOfScreens,
-                                         float* aSystemDefaultScale,
-                                         bool* aSuccess)
-{
-  mScreenMgr = do_GetService(sScreenManagerContractID);
-  if (!mScreenMgr) {
-    MOZ_CRASH("Couldn't get nsIScreenManager from ScreenManagerParent.");
-  }
-
-  unused << RecvRefresh(aNumberOfScreens, aSystemDefaultScale, aSuccess);
-}
-
-bool
-ScreenManagerParent::RecvRefresh(uint32_t* aNumberOfScreens,
-                                 float* aSystemDefaultScale,
-                                 bool* aSuccess)
-{
-  *aSuccess = false;
-
-  nsresult rv = mScreenMgr->GetNumberOfScreens(aNumberOfScreens);
-  if (NS_FAILED(rv)) {
-    return true;
-  }
-
-  rv = mScreenMgr->GetSystemDefaultScale(aSystemDefaultScale);
-  if (NS_FAILED(rv)) {
-    return true;
-  }
-
-  *aSuccess = true;
-  return true;
-}
-
-bool
-ScreenManagerParent::RecvScreenRefresh(const uint32_t& aId,
-                                       ScreenDetails* aRetVal,
-                                       bool* aSuccess)
-{
-  *aSuccess = false;
-
-  nsCOMPtr<nsIScreen> screen;
-  nsresult rv = mScreenMgr->ScreenForId(aId, getter_AddRefs(screen));
-  if (NS_FAILED(rv)) {
-    return true;
-  }
-
-  ScreenDetails details;
-  unused << ExtractScreenDetails(screen, details);
-
-  *aRetVal = details;
-  *aSuccess = true;
-  return true;
-}
-
-bool
-ScreenManagerParent::RecvGetPrimaryScreen(ScreenDetails* aRetVal,
-                                          bool* aSuccess)
-{
-  *aSuccess = false;
-
-  nsCOMPtr<nsIScreen> screen;
-  nsresult rv = mScreenMgr->GetPrimaryScreen(getter_AddRefs(screen));
-
-  NS_ENSURE_SUCCESS(rv, true);
-
-  ScreenDetails details;
-  if (!ExtractScreenDetails(screen, details)) {
-    return true;
-  }
-
-  *aRetVal = details;
-  *aSuccess = true;
-  return true;
-}
-
-bool
-ScreenManagerParent::RecvScreenForRect(const int32_t& aLeft,
-                                       const int32_t& aTop,
-                                       const int32_t& aWidth,
-                                       const int32_t& aHeight,
-                                       ScreenDetails* aRetVal,
-                                       bool* aSuccess)
-{
-  *aSuccess = false;
-
-  nsCOMPtr<nsIScreen> screen;
-  nsresult rv = mScreenMgr->ScreenForRect(aLeft, aTop, aWidth, aHeight, getter_AddRefs(screen));
-
-  NS_ENSURE_SUCCESS(rv, true);
-
-  ScreenDetails details;
-  if (!ExtractScreenDetails(screen, details)) {
-    return true;
-  }
-
-  *aRetVal = details;
-  *aSuccess = true;
-  return true;
-}
-
-bool
-ScreenManagerParent::RecvScreenForBrowser(PBrowserParent* aBrowser,
-                                          ScreenDetails* aRetVal,
-                                          bool* aSuccess)
-{
-  *aSuccess = false;
-
-  // Find the mWidget associated with the tabparent, and then return
-  // the nsIScreen it's on.
-  TabParent* tabParent = static_cast<TabParent*>(aBrowser);
-  nsCOMPtr<nsIWidget> widget = tabParent->GetWidget();
-  if (!widget) {
-    return true;
-  }
-
-  nsCOMPtr<nsIScreen> screen;
-  if (widget->GetNativeData(NS_NATIVE_WINDOW)) {
-    mScreenMgr->ScreenForNativeWidget(widget->GetNativeData(NS_NATIVE_WINDOW),
-                                      getter_AddRefs(screen));
-  }
-
-  NS_ENSURE_TRUE(screen, true);
-
-  ScreenDetails details;
-  if (!ExtractScreenDetails(screen, details)) {
-    return true;
-  }
-
-  *aRetVal = details;
-  *aSuccess = true;
-  return true;
-}
-
-bool
-ScreenManagerParent::ExtractScreenDetails(nsIScreen* aScreen, ScreenDetails &aDetails)
-{
-  uint32_t id;
-  nsresult rv = aScreen->GetId(&id);
-  NS_ENSURE_SUCCESS(rv, false);
-  aDetails.id() = id;
-
-  nsIntRect rect;
-  rv = aScreen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
-  NS_ENSURE_SUCCESS(rv, false);
-  aDetails.rect() = rect;
-
-  nsIntRect availRect;
-  rv = aScreen->GetAvailRect(&availRect.x, &availRect.y, &availRect.width,
-                             &availRect.height);
-  NS_ENSURE_SUCCESS(rv, false);
-  aDetails.availRect() = availRect;
-
-  int32_t pixelDepth = 0;
-  rv = aScreen->GetPixelDepth(&pixelDepth);
-  NS_ENSURE_SUCCESS(rv, false);
-  aDetails.pixelDepth() = pixelDepth;
-
-  int32_t colorDepth = 0;
-  rv = aScreen->GetColorDepth(&colorDepth);
-  NS_ENSURE_SUCCESS(rv, false);
-  aDetails.colorDepth() = colorDepth;
-
-  double contentsScaleFactor = 1.0;
-  rv = aScreen->GetContentsScaleFactor(&contentsScaleFactor);
-  NS_ENSURE_SUCCESS(rv, false);
-  aDetails.contentsScaleFactor() = contentsScaleFactor;
-
-  return true;
-}
-
-void
-ScreenManagerParent::ActorDestroy(ActorDestroyReason why)
-{
-}
-
-} // namespace dom
-} // namespace mozilla
-
deleted file mode 100644
--- a/dom/ipc/ScreenManagerParent.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#ifndef mozilla_dom_ScreenManagerParent_h
-#define mozilla_dom_ScreenManagerParent_h
-
-#include "mozilla/dom/PScreenManagerParent.h"
-#include "nsIScreenManager.h"
-
-namespace mozilla {
-namespace dom {
-
-class ScreenManagerParent : public PScreenManagerParent
-{
- public:
-  ScreenManagerParent(uint32_t* aNumberOfScreens,
-                      float* aSystemDefaultScale,
-                      bool* aSuccess);
-  ~ScreenManagerParent() {};
-
-  virtual bool RecvRefresh(uint32_t* aNumberOfScreens,
-                           float* aSystemDefaultScale,
-                           bool* aSuccess) MOZ_OVERRIDE;
-
-  virtual bool RecvScreenRefresh(const uint32_t& aId,
-                                 ScreenDetails* aRetVal,
-                                 bool* aSuccess) MOZ_OVERRIDE;
-
-  virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
-
-  virtual bool RecvGetPrimaryScreen(ScreenDetails* aRetVal,
-                                    bool* aSuccess) MOZ_OVERRIDE;
-
-  virtual bool RecvScreenForRect(const int32_t& aLeft,
-                                 const int32_t& aTop,
-                                 const int32_t& aWidth,
-                                 const int32_t& aHeight,
-                                 ScreenDetails* aRetVal,
-                                 bool* aSuccess) MOZ_OVERRIDE;
-
-  virtual bool RecvScreenForBrowser(PBrowserParent* aBrowser,
-                                    ScreenDetails* aRetVal,
-                                    bool* aSuccess);
-
- private:
-  bool ExtractScreenDetails(nsIScreen* aScreen, ScreenDetails &aDetails);
-  nsCOMPtr<nsIScreenManager> mScreenMgr;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ScreenManagerParent_h
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -304,18 +304,16 @@ public:
     nsIContentParent* Manager() { return mManager; }
 
     /**
      * Let managees query if Destroy() is already called so they don't send out
      * messages when the PBrowser actor is being destroyed.
      */
     bool IsDestroyed() const { return mIsDestroyed; }
 
-    already_AddRefed<nsIWidget> GetWidget() const;
-
 protected:
     bool ReceiveMessage(const nsString& aMessage,
                         bool aSync,
                         const StructuredCloneData* aCloneData,
                         CpowHolder* aCpows,
                         nsIPrincipal* aPrincipal,
                         InfallibleTArray<nsString>* aJSONRetVal = nullptr);
 
@@ -377,16 +375,17 @@ protected:
     ScreenOrientation mOrientation;
     float mDPI;
     CSSToLayoutDeviceScale mDefaultScale;
     bool mShown;
     bool mUpdatedDimensions;
 
 private:
     already_AddRefed<nsFrameLoader> GetFrameLoader() const;
+    already_AddRefed<nsIWidget> GetWidget() const;
     layout::RenderFrameParent* GetRenderFrame();
     nsRefPtr<nsIContentParent> mManager;
     void TryCacheDPIAndScale();
 
     CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
 
     // When true, we create a pan/zoom controller for our frame and
     // notify it of input events targeting us.
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -54,17 +54,16 @@ UNIFIED_SOURCES += [
     'FileDescriptorSetChild.cpp',
     'FileDescriptorSetParent.cpp',
     'FilePickerParent.cpp',
     'nsIContentChild.cpp',
     'nsIContentParent.cpp',
     'PermissionMessageUtils.cpp',
     'PreallocatedProcessManager.cpp',
     'ProcessPriorityManager.cpp',
-    'ScreenManagerParent.cpp',
     'StructuredCloneUtils.cpp',
     'TabChild.cpp',
     'TabContext.cpp',
     'TabMessageUtils.cpp',
     'TabParent.cpp',
 ]
 
 # Blob.cpp cannot be compiled in unified mode because it triggers a fatal gcc warning.
@@ -88,17 +87,16 @@ IPDL_SOURCES += [
     'PContentPermission.ipdlh',
     'PContentPermissionRequest.ipdl',
     'PCrashReporter.ipdl',
     'PCycleCollectWithLogs.ipdl',
     'PDocumentRenderer.ipdl',
     'PFileDescriptorSet.ipdl',
     'PFilePicker.ipdl',
     'PMemoryReportRequest.ipdl',
-    'PScreenManager.ipdl',
     'PTabContext.ipdlh',
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -626,27 +626,21 @@ nsDeviceContext::ComputeFullAreaUsingScr
 //
 // FindScreen
 //
 // Determines which screen intersects the largest area of the given surface.
 //
 void
 nsDeviceContext::FindScreen(nsIScreen** outScreen)
 {
-    if (mWidget && mWidget->GetOwningTabChild()) {
-        mScreenManager->ScreenForNativeWidget((void *)mWidget->GetOwningTabChild(),
-                                              outScreen);
-    }
-    else if (mWidget && mWidget->GetNativeData(NS_NATIVE_WINDOW)) {
+    if (mWidget && mWidget->GetNativeData(NS_NATIVE_WINDOW))
         mScreenManager->ScreenForNativeWidget(mWidget->GetNativeData(NS_NATIVE_WINDOW),
                                               outScreen);
-    }
-    else {
+    else
         mScreenManager->GetPrimaryScreen(outScreen);
-    }
 }
 
 void
 nsDeviceContext::CalcPrintingSize()
 {
     if (!mPrintingSurface)
         return;
 
--- a/widget/android/nsScreenManagerAndroid.cpp
+++ b/widget/android/nsScreenManagerAndroid.cpp
@@ -15,23 +15,16 @@ nsScreenAndroid::nsScreenAndroid(void *n
 {
 }
 
 nsScreenAndroid::~nsScreenAndroid()
 {
 }
 
 NS_IMETHODIMP
-nsScreenAndroid::GetId(uint32_t *outId)
-{
-    *outId = 1;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
 {
     gfxIntSize sz = nsWindow::GetAndroidScreenBounds();
 
     *outLeft = 0;
     *outTop = 0;
 
     *outWidth = sz.width;
@@ -83,23 +76,16 @@ nsScreenManagerAndroid::~nsScreenManager
 NS_IMETHODIMP
 nsScreenManagerAndroid::GetPrimaryScreen(nsIScreen **outScreen)
 {
     NS_IF_ADDREF(*outScreen = mOneScreen.get());
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsScreenManagerAndroid::ScreenForId(uint32_t aId,
-                                    nsIScreen **outScreen)
-{
-    return GetPrimaryScreen(outScreen);
-}
-
-NS_IMETHODIMP
 nsScreenManagerAndroid::ScreenForRect(int32_t inLeft,
                                       int32_t inTop,
                                       int32_t inWidth,
                                       int32_t inHeight,
                                       nsIScreen **outScreen)
 {
     return GetPrimaryScreen(outScreen);
 }
--- a/widget/android/nsScreenManagerAndroid.h
+++ b/widget/android/nsScreenManagerAndroid.h
@@ -13,17 +13,16 @@
 #include "WidgetUtils.h"
 
 class nsScreenAndroid MOZ_FINAL : public nsBaseScreen
 {
 public:
     nsScreenAndroid(void *nativeScreen);
     ~nsScreenAndroid();
 
-    NS_IMETHOD GetId(uint32_t* aId);
     NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
     NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
 
 protected:
     virtual void ApplyMinimumBrightness(uint32_t aBrightness) MOZ_OVERRIDE;
 };
--- a/widget/cocoa/nsScreenCocoa.h
+++ b/widget/cocoa/nsScreenCocoa.h
@@ -11,27 +11,25 @@
 #include "nsBaseScreen.h"
 
 class nsScreenCocoa : public nsBaseScreen
 {
 public:
     nsScreenCocoa (NSScreen *screen);
     ~nsScreenCocoa ();
 
-    NS_IMETHOD GetId(uint32_t* outId);
     NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetRectDisplayPix(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetAvailRectDisplayPix(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
     NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
     NS_IMETHOD GetContentsScaleFactor(double* aContentsScaleFactor);
 
     NSScreen *CocoaScreen() { return mScreen; }
 
 private:
     CGFloat BackingScaleFactor();
 
     NSScreen *mScreen;
-    uint32_t mId;
 };
 
 #endif // nsScreenCocoa_h_
--- a/widget/cocoa/nsScreenCocoa.mm
+++ b/widget/cocoa/nsScreenCocoa.mm
@@ -2,49 +2,35 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "nsScreenCocoa.h"
 #include "nsObjCExceptions.h"
 #include "nsCocoaUtils.h"
 
-static uint32_t sScreenId = 0;
-
 nsScreenCocoa::nsScreenCocoa (NSScreen *screen)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   mScreen = [screen retain];
-  mId = ++sScreenId;
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 nsScreenCocoa::~nsScreenCocoa ()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   [mScreen release];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 NS_IMETHODIMP
-nsScreenCocoa::GetId(uint32_t *outId)
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
-
-  *outId = mId;
-  return NS_OK;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK;
-}
-
-NS_IMETHODIMP
 nsScreenCocoa::GetRect(int32_t *outX, int32_t *outY, int32_t *outWidth, int32_t *outHeight)
 {
   NSRect frame = [mScreen frame];
 
   nsIntRect r = nsCocoaUtils::CocoaRectToGeckoRectDevPix(frame, BackingScaleFactor());
 
   *outX = r.x;
   *outY = r.y;
--- a/widget/cocoa/nsScreenManagerCocoa.mm
+++ b/widget/cocoa/nsScreenManagerCocoa.mm
@@ -31,40 +31,16 @@ nsScreenManagerCocoa::ScreenForCocoaScre
 
     // didn't find it; create and insert
     nsRefPtr<nsScreenCocoa> sc = new nsScreenCocoa(screen);
     mScreenList.AppendElement(sc);
     return sc.get();
 }
 
 NS_IMETHODIMP
-nsScreenManagerCocoa::ScreenForId (uint32_t aId, nsIScreen **outScreen)
-{
-    NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
-
-    *outScreen = nullptr;
-
-    for (uint32_t i = 0; i < mScreenList.Length(); ++i) {
-        nsScreenCocoa* sc = mScreenList[i];
-        uint32_t id;
-        nsresult rv = sc->GetId(&id);
-
-        if (NS_SUCCEEDED(rv) && id == aId) {
-            *outScreen = sc;
-            NS_ADDREF(*outScreen);
-            return NS_OK;
-        }
-    }
-
-    return NS_ERROR_FAILURE;
-
-    NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
-}
-
-NS_IMETHODIMP
 nsScreenManagerCocoa::ScreenForRect (int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight,
                                      nsIScreen **outScreen)
 {
     NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
     NSEnumerator *screenEnum = [[NSScreen screens] objectEnumerator];
     NSRect inRect = nsCocoaUtils::GeckoRectToCocoaRect(nsIntRect(aX, aY, aWidth, aHeight));
     NSScreen *screenWindowIsOn = [NSScreen mainScreen];
--- a/widget/cocoa/nsWidgetFactory.mm
+++ b/widget/cocoa/nsWidgetFactory.mm
@@ -129,18 +129,17 @@ static const mozilla::Module::CIDEntry k
   { &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor },
   { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
   { &kNS_DRAGSERVICE_CID, false, NULL, nsDragServiceConstructor,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { &kNS_BIDIKEYBOARD_CID, false, NULL, nsBidiKeyboardConstructor },
   { &kNS_THEMERENDERER_CID, false, NULL, nsNativeThemeCocoaConstructor },
-  { &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerCocoaConstructor,
-    mozilla::Module::MAIN_PROCESS_ONLY },
+  { &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerCocoaConstructor },
   { &kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecXConstructor,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { &kNS_PRINTSESSION_CID, false, NULL, nsPrintSessionConstructor,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { &kNS_PRINTSETTINGSSERVICE_CID, false, NULL, nsPrintOptionsXConstructor },
   { &kNS_PRINTDIALOGSERVICE_CID, false, NULL, nsPrintDialogServiceXConstructor,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceXConstructor },
@@ -168,18 +167,17 @@ static const mozilla::Module::ContractID
   { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
   { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
   { "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID },
   { "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
-  { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID,
-    mozilla::Module::MAIN_PROCESS_ONLY },
+  { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
   { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID },
   { NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID,
     mozilla::Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
--- a/widget/gonk/nsScreenManagerGonk.h
+++ b/widget/gonk/nsScreenManagerGonk.h
@@ -26,17 +26,16 @@
 class nsScreenGonk : public nsBaseScreen
 {
     typedef mozilla::hal::ScreenConfiguration ScreenConfiguration;
 
 public:
     nsScreenGonk(void* nativeScreen);
     ~nsScreenGonk();
 
-    NS_IMETHOD GetId(uint32_t* aId);
     NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
     NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
     NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
     NS_IMETHOD GetRotation(uint32_t* aRotation);
     NS_IMETHOD SetRotation(uint32_t  aRotation);
 
     static uint32_t GetRotation();
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -605,23 +605,16 @@ nsScreenGonk::nsScreenGonk(void *nativeS
 {
 }
 
 nsScreenGonk::~nsScreenGonk()
 {
 }
 
 NS_IMETHODIMP
-nsScreenGonk::GetId(uint32_t *outId)
-{
-    *outId = 1;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenGonk::GetRect(int32_t *outLeft,  int32_t *outTop,
                       int32_t *outWidth, int32_t *outHeight)
 {
     *outLeft = sVirtualBounds.x;
     *outTop = sVirtualBounds.y;
 
     *outWidth = sVirtualBounds.width;
     *outHeight = sVirtualBounds.height;
@@ -757,23 +750,16 @@ nsScreenManagerGonk::~nsScreenManagerGon
 NS_IMETHODIMP
 nsScreenManagerGonk::GetPrimaryScreen(nsIScreen **outScreen)
 {
     NS_IF_ADDREF(*outScreen = mOneScreen.get());
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsScreenManagerGonk::ScreenForId(uint32_t aId,
-                                 nsIScreen **outScreen)
-{
-    return GetPrimaryScreen(outScreen);
-}
-
-NS_IMETHODIMP
 nsScreenManagerGonk::ScreenForRect(int32_t inLeft,
                                    int32_t inTop,
                                    int32_t inWidth,
                                    int32_t inHeight,
                                    nsIScreen **outScreen)
 {
     return GetPrimaryScreen(outScreen);
 }
--- a/widget/gtk/nsScreenGtk.cpp
+++ b/widget/gtk/nsScreenGtk.cpp
@@ -7,47 +7,29 @@
 
 #include <gdk/gdk.h>
 #ifdef MOZ_X11
 #include <gdk/gdkx.h>
 #include <X11/Xatom.h>
 #endif
 #include <gtk/gtk.h>
 
-static uint32_t sScreenId = 0;
-
-
 nsScreenGtk :: nsScreenGtk (  )
   : mScreenNum(0),
     mRect(0, 0, 0, 0),
-    mAvailRect(0, 0, 0, 0),
-    mId(++sScreenId)
+    mAvailRect(0, 0, 0, 0)
 {
 }
 
 
 nsScreenGtk :: ~nsScreenGtk()
 {
 }
 
 
-nsScreenGtk :: GetId(uint32_t *aId)
-{
-  *aId = mId;
-  return NS_OK;
-} // GetId
-
-NS_IMETHODIMP
-nsScreenGtk :: GetId(uint32_t *aId)
-{
-  *aId = mId;
-  return NS_OK;
-} // GetId
-
-
 NS_IMETHODIMP
 nsScreenGtk :: GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
 {
   *outLeft = mRect.x;
   *outTop = mRect.y;
   *outWidth = mRect.width;
   *outHeight = mRect.height;
 
--- a/widget/gtk/nsScreenGtk.h
+++ b/widget/gtk/nsScreenGtk.h
@@ -25,27 +25,25 @@ typedef struct {
 //------------------------------------------------------------------------
 
 class nsScreenGtk : public nsBaseScreen
 {
 public:
   nsScreenGtk();
   ~nsScreenGtk();
 
-  NS_IMETHOD GetId(uint32_t* aId);
   NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
   NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
   NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
   NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
 
   void Init(GdkWindow *aRootWindow);
 #ifdef MOZ_X11
   void Init(XineramaScreenInfo *aScreenInfo);
 #endif /* MOZ_X11 */
 
 private:
   uint32_t mScreenNum;
   nsIntRect mRect;
   nsIntRect mAvailRect;
-  uint32_t mId;
 };
 
 #endif  // nsScreenGtk_h___ 
--- a/widget/gtk/nsScreenManagerGtk.cpp
+++ b/widget/gtk/nsScreenManagerGtk.cpp
@@ -183,40 +183,16 @@ nsScreenManagerGtk :: Init()
   if (screenInfo) {
     XFree(screenInfo);
   }
 #endif
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsScreenManagerGtk :: ScreenForId ( uint32_t aId, nsIScreen **outScreen )
-{
-  *outScreen = nullptr;
-
-  nsresult rv;
-  rv = EnsureInit();
-  if (NS_FAILED(rv)) {
-    NS_ERROR("nsScreenManagerGtk::EnsureInit() failed from ScreenForId");
-    return rv;
-  }
-
-  for (int32_t i = 0, i_end = mCachedScreenArray.Count(); i < i_end; ++i) {
-    uint32_t id;
-    rv = mCachedScreenArray[i]->GetId(&id);
-    if (NS_SUCCEEDED(rv) && id == aId) {
-      NS_IF_ADDREF(*outScreen = mCachedScreenArray[i]);
-      return NS_OK;
-    }
-  }
-
-  return NS_ERROR_FAILURE;
-}
-
 
 //
 // ScreenForRect 
 //
 // Returns the screen that contains the rectangle. If the rect overlaps
 // multiple screens, it picks the screen with the greatest area of intersection.
 //
 // The coordinates are in pixels (not app units) and in screen coordinates.
--- a/widget/gtk/nsWidgetFactory.cpp
+++ b/widget/gtk/nsWidgetFactory.cpp
@@ -209,18 +209,17 @@ static const mozilla::Module::CIDEntry k
     { &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
 #ifdef MOZ_X11
     { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor, Module::MAIN_PROCESS_ONLY },
     { &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor },
     { &kNS_DRAGSERVICE_CID, false, nullptr, nsDragServiceConstructor, Module::MAIN_PROCESS_ONLY },
 #endif
     { &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor },
     { &kNS_BIDIKEYBOARD_CID, false, nullptr, nsBidiKeyboardConstructor },
-    { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerGtkConstructor,
-      Module::MAIN_PROCESS_ONLY },
+    { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerGtkConstructor },
     { &kNS_THEMERENDERER_CID, false, nullptr, nsNativeThemeGTKConstructor },
 #ifdef NS_PRINTING
     { &kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, nsPrintOptionsGTKConstructor },
     { &kNS_PRINTER_ENUMERATOR_CID, false, nullptr, nsPrinterEnumeratorGTKConstructor,
       Module::MAIN_PROCESS_ONLY },
     { &kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor,
       Module::MAIN_PROCESS_ONLY },
     { &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecGTKConstructor,
@@ -246,18 +245,17 @@ static const mozilla::Module::ContractID
     { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
 #ifdef MOZ_X11
     { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, Module::MAIN_PROCESS_ONLY },
     { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
     { "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID, Module::MAIN_PROCESS_ONLY },
 #endif
     { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
     { "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID },
-    { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID,
-      Module::MAIN_PROCESS_ONLY },
+    { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
     { "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
 #ifdef NS_PRINTING
     { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID },
     { "@mozilla.org/gfx/printerenumerator;1", &kNS_PRINTER_ENUMERATOR_CID,
       Module::MAIN_PROCESS_ONLY },
     { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID,
       Module::MAIN_PROCESS_ONLY },
     { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID,
--- a/widget/nsIScreen.idl
+++ b/widget/nsIScreen.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "nsISupports.idl"
 
-[scriptable, uuid(826e80c8-d70f-42e2-8aa9-82c05f2a370a)]
+[scriptable, uuid(D6F13AF4-8ACA-4A10-8687-3F99C3692AC0)]
 interface nsIScreen : nsISupports
 {
   /**
    * Levels of brightness for the screen, from off to full brightness.
    */
   const unsigned long BRIGHTNESS_DIM = 0;
   const unsigned long BRIGHTNESS_FULL = 1;
 
@@ -25,22 +25,16 @@ interface nsIScreen : nsISupports
    * ROTATION_0_DEG is the default, unrotated configuration.
    */
   const unsigned long   ROTATION_0_DEG = 0;
   const unsigned long  ROTATION_90_DEG = 1;
   const unsigned long ROTATION_180_DEG = 2;
   const unsigned long ROTATION_270_DEG = 3;
 
   /**
-   * A unique identifier for this device, useful for requerying
-   * for it via nsIScreenManager.
-   */
-  readonly attribute unsigned long id;
-
-  /**
    * These report screen dimensions in (screen-specific) device pixels
    */
   void GetRect(out long left, out long top, out long width, out long height);
   void GetAvailRect(out long left, out long top, out long width, out long height);
 
   /**
    * And these report in global display pixels
    */
--- a/widget/nsIScreenManager.idl
+++ b/widget/nsIScreenManager.idl
@@ -2,38 +2,31 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "nsISupports.idl"
 #include "nsIScreen.idl"
 
-[scriptable, uuid(e8a96e60-6b61-4a14-bacc-53891604b502)]
+[scriptable, uuid(1C195990-FF9E-412B-AFE7-67D1C660BB27)]
 interface nsIScreenManager : nsISupports
 {
     //
     // Returns the screen that contains the rectangle. If the rect overlaps
     // multiple screens, it picks the screen with the greatest area of intersection.
     //
     // The coordinates are in pixels (not twips) and in screen coordinates.
     //
   nsIScreen screenForRect ( in long left, in long top, in long width, in long height ) ;
-
-    //
-    // Returns the screen corresponding to the id. If no such screen exists,
-    // this will throw NS_ERROR_FAILURE. The id is a unique numeric value
-    // assigned to each screen, and is an attribute available on the nsIScreen
-    // interface.
-  nsIScreen screenForId ( in unsigned long id ) ;
-
+  
     // The screen with the menubar/taskbar. This shouldn't be needed very
     // often.
   readonly attribute nsIScreen primaryScreen;
-
+  
     // Holds the number of screens that are available
   readonly attribute unsigned long numberOfScreens;
 
     // The default DPI scaling factor of the screen environment (number of
     // screen pixels corresponding to 1 CSS px, at the default zoom level).
     //
     // This is currently fixed at 1.0 on most platforms, but varies on Windows
     // if the "logical DPI" scaling option in the Display control panel is set
--- a/widget/windows/nsScreenManagerWin.cpp
+++ b/widget/windows/nsScreenManagerWin.cpp
@@ -54,33 +54,16 @@ nsScreenManagerWin :: CreateNewScreenObj
  
   retScreen = new nsScreenWin(inScreen);
   mScreenList.AppendElement ( ScreenListItem ( inScreen, retScreen ) );
 
   NS_IF_ADDREF(retScreen);
   return retScreen;
 }
 
-NS_IMETHODIMP
-nsScreenManagerWin::ScreenForId(uint32_t aId, nsIScreen **outScreen)
-{
-  *outScreen = nullptr;
-
-  for (unsigned i = 0; i < mScreenList.Length(); ++i) {
-    ScreenListItem& curr = mScreenList[i];
-    uint32_t id;
-    nsresult rv = curr.mScreen->GetId(&id);
-    if (NS_SUCCEEDED(rv) && id == aId) {
-      NS_IF_ADDREF(*outScreen = curr.mScreen.get());
-      return NS_OK;
-    }
-  }
-
-  return NS_ERROR_FAILURE;
-}
 
 //
 // ScreenForRect 
 //
 // Returns the screen that contains the rectangle. If the rect overlaps
 // multiple screens, it picks the screen with the greatest area of intersection.
 //
 // The coordinates are in pixels (not twips) and in logical screen coordinates.
--- a/widget/windows/nsScreenWin.cpp
+++ b/widget/windows/nsScreenWin.cpp
@@ -3,21 +3,19 @@
  * 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 "nsScreenWin.h"
 #include "nsCoord.h"
 #include "gfxWindowsPlatform.h"
 #include "nsIWidget.h"
 
-static uint32_t sScreenId;
 
 nsScreenWin :: nsScreenWin ( HMONITOR inScreen )
   : mScreen(inScreen)
-  , mId(++sScreenId)
 {
 #ifdef DEBUG
   HDC hDCScreen = ::GetDC(nullptr);
   NS_ASSERTION(hDCScreen,"GetDC Failure");
   NS_ASSERTION ( ::GetDeviceCaps(hDCScreen, TECHNOLOGY) == DT_RASDISPLAY, "Not a display screen");
   ::ReleaseDC(nullptr,hDCScreen);
 #endif
 
@@ -29,24 +27,16 @@ nsScreenWin :: nsScreenWin ( HMONITOR in
 
 nsScreenWin :: ~nsScreenWin()
 {
   // nothing to see here.
 }
 
 
 NS_IMETHODIMP
-nsScreenWin::GetId(uint32_t *outId)
-{
-  *outId = mId;
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
 nsScreenWin :: GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
 {
   BOOL success = FALSE;
   if ( mScreen ) {
     MONITORINFO info;
     info.cbSize = sizeof(MONITORINFO);
     success = ::GetMonitorInfoW( mScreen, &info );
     if ( success ) {
--- a/widget/windows/nsScreenWin.h
+++ b/widget/windows/nsScreenWin.h
@@ -12,18 +12,16 @@
 //------------------------------------------------------------------------
 
 class nsScreenWin : public nsBaseScreen
 {
 public:
   nsScreenWin ( HMONITOR inScreen );
   ~nsScreenWin();
 
-  NS_IMETHOD GetId(uint32_t* aId);
-
   // These methods return the size in device (physical) pixels
   NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
   NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
 
   // And these methods get the screen size in 'display pixels' (AKA 'logical pixels')
   // that are dependent on the logical DPI setting in windows
   NS_IMETHOD GetRectDisplayPix(int32_t *outLeft,  int32_t *outTop,
                                int32_t *outWidth, int32_t *outHeight);
@@ -31,12 +29,11 @@ public:
                                     int32_t *outWidth, int32_t *outHeight);
 
   NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
   NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
 
 private:
 
   HMONITOR mScreen;
-  uint32_t mId;
 };
 
 #endif  // nsScreenWin_h___ 
--- a/widget/windows/nsWidgetFactory.cpp
+++ b/widget/windows/nsWidgetFactory.cpp
@@ -216,18 +216,17 @@ NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SP
 
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
   { &kNS_WINDOW_CID, false, nullptr, WindowConstructor },
   { &kNS_CHILD_CID, false, nullptr, ChildWindowConstructor },
   { &kNS_FILEPICKER_CID, false, nullptr, FilePickerConstructor, Module::MAIN_PROCESS_ONLY },
   { &kNS_COLORPICKER_CID, false, nullptr, ColorPickerConstructor, Module::MAIN_PROCESS_ONLY },
   { &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor },
-  { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerWinConstructor,
-    Module::MAIN_PROCESS_ONLY },
+  { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerWinConstructor },
   { &kNS_GFXINFO_CID, false, nullptr, GfxInfoConstructor },
   { &kNS_THEMERENDERER_CID, false, nullptr, NS_NewNativeTheme },
   { &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceWinConstructor },
   { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor, Module::MAIN_PROCESS_ONLY },
   { &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor },
   { &kNS_SOUND_CID, false, nullptr, nsSoundConstructor, Module::MAIN_PROCESS_ONLY },
   { &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
   { &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor },
@@ -255,17 +254,17 @@ static const mozilla::Module::CIDEntry k
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
   { "@mozilla.org/widgets/window/win;1", &kNS_WINDOW_CID },
   { "@mozilla.org/widgets/child_window/win;1", &kNS_CHILD_CID },
   { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/widget/appshell/win;1", &kNS_APPSHELL_CID },
-  { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID, Module::MAIN_PROCESS_ONLY },
+  { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
   { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
   { "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
   { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
   { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
   { "@mozilla.org/sound;1", &kNS_SOUND_CID, Module::MAIN_PROCESS_ONLY },
   { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
   { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
--- a/widget/xpwidgets/PuppetWidget.cpp
+++ b/widget/xpwidgets/PuppetWidget.cpp
@@ -799,23 +799,16 @@ static ScreenConfiguration
 ScreenConfig()
 {
   ScreenConfiguration config;
   hal::GetCurrentScreenConfiguration(&config);
   return config;
 }
 
 NS_IMETHODIMP
-PuppetScreen::GetId(uint32_t *outId)
-{
-  *outId = 1;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 PuppetScreen::GetRect(int32_t *outLeft,  int32_t *outTop,
                       int32_t *outWidth, int32_t *outHeight)
 {
   nsIntRect r = ScreenConfig().rect();
   *outLeft = r.x;
   *outTop = r.y;
   *outWidth = r.width;
   *outHeight = r.height;
@@ -824,16 +817,17 @@ PuppetScreen::GetRect(int32_t *outLeft, 
 
 NS_IMETHODIMP
 PuppetScreen::GetAvailRect(int32_t *outLeft,  int32_t *outTop,
                            int32_t *outWidth, int32_t *outHeight)
 {
   return GetRect(outLeft, outTop, outWidth, outHeight);
 }
 
+
 NS_IMETHODIMP
 PuppetScreen::GetPixelDepth(int32_t *aPixelDepth)
 {
   *aPixelDepth = ScreenConfig().pixelDepth();
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -864,24 +858,16 @@ PuppetScreenManager::PuppetScreenManager
     mOneScreen = new PuppetScreen(nullptr);
 }
 
 PuppetScreenManager::~PuppetScreenManager()
 {
 }
 
 NS_IMETHODIMP
-PuppetScreenManager::ScreenForId(uint32_t aId,
-                                 nsIScreen** outScreen)
-{
-  NS_IF_ADDREF(*outScreen = mOneScreen.get());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 PuppetScreenManager::GetPrimaryScreen(nsIScreen** outScreen)
 {
   NS_IF_ADDREF(*outScreen = mOneScreen.get());
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PuppetScreenManager::ScreenForRect(int32_t inLeft,
--- a/widget/xpwidgets/PuppetWidget.h
+++ b/widget/xpwidgets/PuppetWidget.h
@@ -300,17 +300,16 @@ private:
 };
 
 class PuppetScreen : public nsBaseScreen
 {
 public:
     PuppetScreen(void* nativeScreen);
     ~PuppetScreen();
 
-    NS_IMETHOD GetId(uint32_t* aId) MOZ_OVERRIDE;
     NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight) MOZ_OVERRIDE;
     NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight) MOZ_OVERRIDE;
     NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) MOZ_OVERRIDE;
     NS_IMETHOD GetColorDepth(int32_t* aColorDepth) MOZ_OVERRIDE;
     NS_IMETHOD GetRotation(uint32_t* aRotation) MOZ_OVERRIDE;
     NS_IMETHOD SetRotation(uint32_t  aRotation) MOZ_OVERRIDE;
 };
 
deleted file mode 100644
--- a/widget/xpwidgets/ScreenProxy.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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 "mozilla/unused.h"
-#include "nsIAppShell.h"
-#include "nsScreenManagerProxy.h"
-#include "nsServiceManagerUtils.h"
-#include "nsWidgetsCID.h"
-#include "ScreenProxy.h"
-
-namespace mozilla {
-namespace widget {
-
-using namespace mozilla::dom;
-
-static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
-
-ScreenProxy::ScreenProxy(nsScreenManagerProxy* aScreenManager, ScreenDetails aDetails)
-  : mScreenManager(aScreenManager)
-  , mCacheValid(false)
-  , mCacheWillInvalidate(false)
-{
-  PopulateByDetails(aDetails);
-}
-
-NS_IMETHODIMP
-ScreenProxy::GetId(uint32_t *outId)
-{
-  *outId = mId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ScreenProxy::GetRect(int32_t *outLeft,
-                     int32_t *outTop,
-                     int32_t *outWidth,
-                     int32_t *outHeight)
-{
-  if (!EnsureCacheIsValid()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *outLeft = mRect.x;
-  *outTop = mRect.y;
-  *outWidth = mRect.width;
-  *outHeight = mRect.height;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ScreenProxy::GetAvailRect(int32_t *outLeft,
-                          int32_t *outTop,
-                          int32_t *outWidth,
-                          int32_t *outHeight)
-{
-  if (!EnsureCacheIsValid()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *outLeft = mAvailRect.x;
-  *outTop = mAvailRect.y;
-  *outWidth = mAvailRect.width;
-  *outHeight = mAvailRect.height;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ScreenProxy::GetPixelDepth(int32_t *aPixelDepth)
-{
-  if (!EnsureCacheIsValid()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *aPixelDepth = mPixelDepth;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ScreenProxy::GetColorDepth(int32_t *aColorDepth)
-{
-  if (!EnsureCacheIsValid()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *aColorDepth = mColorDepth;
-  return NS_OK;
-}
-
-void
-ScreenProxy::PopulateByDetails(ScreenDetails aDetails)
-{
-  mId = aDetails.id();
-  mRect = nsIntRect(aDetails.rect());
-  mAvailRect = nsIntRect(aDetails.availRect());
-  mPixelDepth = aDetails.pixelDepth();
-  mColorDepth = aDetails.colorDepth();
-  mContentsScaleFactor = aDetails.contentsScaleFactor();
-}
-
-bool
-ScreenProxy::EnsureCacheIsValid()
-{
-  if (mCacheValid) {
-    return true;
-  }
-
-  bool success = false;
-  // Kick off a synchronous IPC call to the parent to get the
-  // most up-to-date information.
-  ScreenDetails details;
-  unused << mScreenManager->SendScreenRefresh(mId, &details, &success);
-  if (!success) {
-    NS_WARNING("Updating a ScreenProxy in the child process failed on parent side.");
-    return false;
-  }
-
-  PopulateByDetails(details);
-  mCacheValid = true;
-
-  InvalidateCacheOnNextTick();
-  return true;
-}
-
-void
-ScreenProxy::InvalidateCacheOnNextTick()
-{
-  if (mCacheWillInvalidate) {
-    return;
-  }
-
-  mCacheWillInvalidate = true;
-
-  nsCOMPtr<nsIAppShell> appShell = do_GetService(kAppShellCID);
-  if (appShell) {
-    appShell->RunInStableState(
-      NS_NewRunnableMethod(this, &ScreenProxy::InvalidateCache)
-    );
-  } else {
-    // It's pretty bad news if we can't get the appshell. In that case,
-    // let's just invalidate the cache right away.
-    InvalidateCache();
-  }
-}
-
-void
-ScreenProxy::InvalidateCache()
-{
-  mCacheValid = false;
-  mCacheWillInvalidate = false;
-}
-
-} // namespace widget
-} // namespace mozilla
-
deleted file mode 100644
--- a/widget/xpwidgets/ScreenProxy.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#ifndef mozilla_widget_ScreenProxy_h
-#define mozilla_widget_ScreenProxy_h
-
-#include "nsBaseScreen.h"
-#include "mozilla/dom/PScreenManagerChild.h"
-#include "mozilla/dom/TabChild.h"
-
-class nsScreenManagerProxy;
-
-namespace mozilla {
-namespace widget {
-
-class ScreenProxy : public nsBaseScreen
-{
-public:
-    ScreenProxy(nsScreenManagerProxy* aScreenManager,
-                mozilla::dom::ScreenDetails aDetails);
-    ~ScreenProxy() {};
-
-    NS_IMETHOD GetId(uint32_t* aId) MOZ_OVERRIDE;
-
-    NS_IMETHOD GetRect(int32_t* aLeft,
-                       int32_t* aTop,
-                       int32_t* aWidth,
-                       int32_t* aHeight) MOZ_OVERRIDE;
-    NS_IMETHOD GetAvailRect(int32_t* aLeft,
-                            int32_t* aTop,
-                            int32_t* aWidth,
-                            int32_t* aHeight) MOZ_OVERRIDE;
-    NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) MOZ_OVERRIDE;
-    NS_IMETHOD GetColorDepth(int32_t* aColorDepth) MOZ_OVERRIDE;
-
-private:
-
-    void PopulateByDetails(mozilla::dom::ScreenDetails aDetails);
-    bool EnsureCacheIsValid();
-    void InvalidateCacheOnNextTick();
-    void InvalidateCache();
-
-    double mContentsScaleFactor;
-    nsRefPtr<nsScreenManagerProxy> mScreenManager;
-    uint32_t mId;
-    int32_t mPixelDepth;
-    int32_t mColorDepth;
-    nsIntRect mRect;
-    nsIntRect mAvailRect;
-    bool mCacheValid;
-    bool mCacheWillInvalidate;
-};
-
-} // namespace widget
-} // namespace mozilla
-#endif
-
--- a/widget/xpwidgets/moz.build
+++ b/widget/xpwidgets/moz.build
@@ -29,21 +29,19 @@ UNIFIED_SOURCES += [
     'nsFilePickerProxy.cpp',
     'nsHTMLFormatConverter.cpp',
     'nsIdleService.cpp',
     'nsIWidgetListener.cpp',
     'nsPrimitiveHelpers.cpp',
     'nsPrintOptionsImpl.cpp',
     'nsPrintSession.cpp',
     'nsPrintSettingsImpl.cpp',
-    'nsScreenManagerProxy.cpp',
     'nsTransferable.cpp',
     'nsXPLookAndFeel.cpp',
     'PuppetWidget.cpp',
-    'ScreenProxy.cpp',
     'WidgetUtils.cpp',
 ]
 
 # nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
 SOURCES += [
     'nsBaseWidget.cpp',
 ]
 
--- a/widget/xpwidgets/nsContentProcessWidgetFactory.cpp
+++ b/widget/xpwidgets/nsContentProcessWidgetFactory.cpp
@@ -5,49 +5,43 @@
  * 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 "mozilla/ModuleUtils.h"
 #include "nsWidgetsCID.h"
 #include "nsClipboardProxy.h"
 #include "nsColorPickerProxy.h"
 #include "nsFilePickerProxy.h"
-#include "nsScreenManagerProxy.h"
 
 using namespace mozilla;
 
 #ifndef MOZ_B2G
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardProxy)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsColorPickerProxy)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePickerProxy)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerProxy)
 
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
-NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
     { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardProxyConstructor,
       Module::CONTENT_PROCESS_ONLY },
     { &kNS_COLORPICKER_CID, false, nullptr, nsColorPickerProxyConstructor,
       Module::CONTENT_PROCESS_ONLY },
     { &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerProxyConstructor,
       Module::CONTENT_PROCESS_ONLY },
-    { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerProxyConstructor,
-      Module::CONTENT_PROCESS_ONLY },
     { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
     { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, Module::CONTENT_PROCESS_ONLY },
     { "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::CONTENT_PROCESS_ONLY },
     { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, Module::CONTENT_PROCESS_ONLY },
-    { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID, Module::CONTENT_PROCESS_ONLY },
     { nullptr }
 };
 
 static const mozilla::Module kWidgetModule = {
     mozilla::Module::kVersion,
     kWidgetCIDs,
     kWidgetContracts
 };
deleted file mode 100644
--- a/widget/xpwidgets/nsScreenManagerProxy.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * 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 "mozilla/unused.h"
-#include "mozilla/dom/ContentChild.h"
-#include "nsScreenManagerProxy.h"
-#include "nsServiceManagerUtils.h"
-#include "nsIAppShell.h"
-#include "nsIScreen.h"
-#include "nsIScreenManager.h"
-#include "nsWidgetsCID.h"
-
-static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::widget;
-
-NS_IMPL_ISUPPORTS(nsScreenManagerProxy, nsIScreenManager)
-
-nsScreenManagerProxy::nsScreenManagerProxy()
-  : mNumberOfScreens(-1)
-  , mSystemDefaultScale(1.0)
-  , mCacheValid(true)
-  , mCacheWillInvalidate(false)
-{
-  bool success = false;
-  unused << ContentChild::GetSingleton()->SendPScreenManagerConstructor(
-                                            this,
-                                            &mNumberOfScreens,
-                                            &mSystemDefaultScale,
-                                            &success);
-
-  if (!success) {
-    // We're in bad shape. We'll return the default values, but we'll basically
-    // be lying.
-    NS_WARNING("Setting up communications with the parent nsIScreenManager failed.");
-  }
-
-  InvalidateCacheOnNextTick();
-
-  // nsScreenManagerProxy is a service, which will always have a reference
-  // held to it by the Component Manager once the service is requested.
-  // However, nsScreenManagerProxy also implements PScreenManagerChild, and
-  // that means that the manager of the PScreenManager protocol (PContent
-  // in this case) needs to know how to deallocate this actor. We AddRef here
-  // so that in the event that PContent tries to deallocate us either before
-  // or after process shutdown, we don't try to do a double-free.
-  AddRef();
-}
-
-/**
- * nsIScreenManager
- **/
-
-NS_IMETHODIMP
-nsScreenManagerProxy::GetPrimaryScreen(nsIScreen** outScreen)
-{
-  InvalidateCacheOnNextTick();
-
-  if (!mPrimaryScreen) {
-    ScreenDetails details;
-    bool success = false;
-    unused << SendGetPrimaryScreen(&details, &success);
-    if (!success) {
-      return NS_ERROR_FAILURE;
-    }
-
-    mPrimaryScreen = new ScreenProxy(this, details);
-  }
-  NS_ADDREF(*outScreen = mPrimaryScreen);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerProxy::ScreenForId(uint32_t aId, nsIScreen** outScreen)
-{
-  // At this time, there's no need for child processes to query for
-  // screens by ID.
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsScreenManagerProxy::ScreenForRect(int32_t inLeft,
-                                    int32_t inTop,
-                                    int32_t inWidth,
-                                    int32_t inHeight,
-                                    nsIScreen** outScreen)
-{
-  bool success = false;
-  ScreenDetails details;
-  unused << SendScreenForRect(inLeft, inTop, inWidth, inHeight, &details, &success);
-  if (!success) {
-    return NS_ERROR_FAILURE;
-  }
-
-  nsRefPtr<ScreenProxy> screen = new ScreenProxy(this, details);
-  NS_ADDREF(*outScreen = screen);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerProxy::ScreenForNativeWidget(void* aWidget,
-                                            nsIScreen** outScreen)
-{
-  // Because ScreenForNativeWidget can be called numerous times
-  // indirectly from content via the DOM Screen API, we cache the
-  // results for this tick of the event loop.
-  TabChild* tabChild = static_cast<TabChild*>(aWidget);
-
-  // Enumerate the cached screen array, looking for one that has
-  // the TabChild that we're looking for...
-  for (uint32_t i = 0; i < mScreenCache.Length(); ++i) {
-      ScreenCacheEntry& curr = mScreenCache[i];
-      if (curr.mTabChild == aWidget) {
-          NS_ADDREF(*outScreen = static_cast<nsIScreen*>(curr.mScreenProxy));
-          return NS_OK;
-      }
-  }
-
-  // Never cached this screen, so we have to ask the parent process
-  // for it.
-  bool success = false;
-  ScreenDetails details;
-  unused << SendScreenForBrowser(tabChild, &details, &success);
-  if (!success) {
-    return NS_ERROR_FAILURE;
-  }
-
-  ScreenCacheEntry newEntry;
-  nsRefPtr<ScreenProxy> screen = new ScreenProxy(this, details);
-
-  newEntry.mScreenProxy = screen;
-  newEntry.mTabChild = tabChild;
-
-  mScreenCache.AppendElement(newEntry);
-
-  NS_ADDREF(*outScreen = screen);
-
-  InvalidateCacheOnNextTick();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerProxy::GetNumberOfScreens(uint32_t* aNumberOfScreens)
-{
-  if (!EnsureCacheIsValid()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *aNumberOfScreens = mNumberOfScreens;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerProxy::GetSystemDefaultScale(float *aSystemDefaultScale)
-{
-  if (!EnsureCacheIsValid()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  *aSystemDefaultScale = mSystemDefaultScale;
-  return NS_OK;
-}
-
-bool
-nsScreenManagerProxy::EnsureCacheIsValid()
-{
-  if (mCacheValid) {
-    return true;
-  }
-
-  bool success = false;
-  // Kick off a synchronous IPC call to the parent to get the
-  // most up-to-date information.
-  unused << SendRefresh(&mNumberOfScreens, &mSystemDefaultScale, &success);
-  if (!success) {
-    NS_WARNING("Refreshing nsScreenManagerProxy failed in the parent process.");
-    return false;
-  }
-
-  mCacheValid = true;
-
-  InvalidateCacheOnNextTick();
-  return true;
-}
-
-void
-nsScreenManagerProxy::InvalidateCacheOnNextTick()
-{
-  if (mCacheWillInvalidate) {
-    return;
-  }
-
-  mCacheWillInvalidate = true;
-
-  nsCOMPtr<nsIAppShell> appShell = do_GetService(kAppShellCID);
-  if (appShell) {
-    appShell->RunInStableState(
-      NS_NewRunnableMethod(this, &nsScreenManagerProxy::InvalidateCache)
-    );
-  } else {
-    // It's pretty bad news if we can't get the appshell. In that case,
-    // let's just invalidate the cache right away.
-    InvalidateCache();
-  }
-}
-
-void
-nsScreenManagerProxy::InvalidateCache()
-{
-  mCacheValid = false;
-  mCacheWillInvalidate = false;
-
-  if (mPrimaryScreen) {
-    mPrimaryScreen = nullptr;
-  }
-  for (int32_t i = mScreenCache.Length() - 1; i >= 0; --i) {
-    mScreenCache.RemoveElementAt(i);
-  }
-}
-
deleted file mode 100644
--- a/widget/xpwidgets/nsScreenManagerProxy.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#ifndef nsScreenManagerProxy_h
-#define nsScreenManagerProxy_h
-
-#include "nsIScreenManager.h"
-#include "mozilla/dom/PScreenManagerChild.h"
-#include "mozilla/dom/TabChild.h"
-#include "ScreenProxy.h"
-
-/**
- * The nsScreenManagerProxy is used by the content process to get
- * information about system screens. It uses the PScreenManager protocol
- * to communicate with a PScreenManagerParent to get this information,
- * and also caches the information it gets back.
- *
- * We cache both the system screen information that nsIScreenManagers
- * provide, as well as the nsIScreens that callers can query for.
- *
- * Both of these caches are invalidated on the next tick of the event
- * loop.
- */
-class nsScreenManagerProxy MOZ_FINAL : public nsIScreenManager,
-                                       public mozilla::dom::PScreenManagerChild
-{
-public:
-  nsScreenManagerProxy();
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSISCREENMANAGER
-
-private:
-  ~nsScreenManagerProxy() {};
-
-  bool EnsureCacheIsValid();
-  void InvalidateCacheOnNextTick();
-  void InvalidateCache();
-
-  uint32_t mNumberOfScreens;
-  float mSystemDefaultScale;
-  bool mCacheValid;
-  bool mCacheWillInvalidate;
-
-  nsRefPtr<mozilla::widget::ScreenProxy> mPrimaryScreen;
-
-  // nsScreenManagerProxy caches the results to repeated calls to
-  // ScreenForNativeWidget, which can be triggered indirectly by
-  // web content using the DOM Screen API. This allows us to bypass
-  // a lot of IPC traffic.
-  //
-  // The cache stores ScreenProxy's mapped to the TabChild that
-  // asked for the ScreenForNativeWidget was called with via
-  // ScreenCacheEntry's. The cache is cleared on the next tick of
-  // the event loop.
-  struct ScreenCacheEntry
-  {
-    nsRefPtr<mozilla::widget::ScreenProxy> mScreenProxy;
-    nsRefPtr<mozilla::dom::TabChild> mTabChild;
-  };
-
-  nsTArray<ScreenCacheEntry> mScreenCache;
-};
-
-#endif // nsScreenManagerProxy_h