Don't propagate simulated device resets to child processes. (bug 1245765 part 3, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Mon, 29 Feb 2016 01:53:13 -0500
changeset 322392 fe3b4dabf0b045c245c23bd5de660a360ff8918a
parent 322391 6fcea9ec83505069544ad8671b468dff7bd87aea
child 322393 9dc48884674b54f7cd096767dcc9b3c6edeee50c
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1245765
milestone47.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
Don't propagate simulated device resets to child processes. (bug 1245765 part 3, r=mattwoodrow)
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/PContent.ipdl
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxWindowsPlatform.cpp
gfx/thebes/gfxWindowsPlatform.h
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -3250,25 +3250,16 @@ ContentChild::RecvEndDragSession(const b
       }
     }
     dragService->EndDragSession(aDoneDrag);
   }
   return true;
 }
 
 bool
-ContentChild::RecvTestGraphicsDeviceReset(const uint32_t& aResetReason)
-{
-#if defined(XP_WIN)
-  gfxPlatform::GetPlatform()->TestDeviceReset(DeviceResetReason(aResetReason));
-#endif
-  return true;
-}
-
-bool
 ContentChild::RecvPush(const nsCString& aScope,
                        const IPC::Principal& aPrincipal)
 {
 #ifndef MOZ_SIMPLEPUSH
   nsCOMPtr<nsIPushNotifier> pushNotifierIface =
       do_GetService("@mozilla.org/push/Notifier;1");
   if (NS_WARN_IF(!pushNotifierIface)) {
       return true;
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -605,18 +605,16 @@ public:
   AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
                                       const IPC::Principal& aPrincipal,
                                       const TabId& aTabId) override;
   virtual bool
   DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor) override;
 
   virtual bool RecvGamepadUpdate(const GamepadChangeEvent& aGamepadEvent) override;
 
-  virtual bool RecvTestGraphicsDeviceReset(const uint32_t& aResetReason) override;
-
 private:
   virtual void ActorDestroy(ActorDestroyReason why) override;
 
   virtual void ProcessingError(Result aCode, const char* aReason) override;
 
   /**
    * Exit *now*.  Do not shut down XPCOM, do not pass Go, do not run
    * static destructors, do not collect $200.
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -706,22 +706,16 @@ child:
     async UpdateWindow(uintptr_t aChildId);
 
     /**
      * Send gamepad status update to child.
      */
     async GamepadUpdate(GamepadChangeEvent aGamepadEvent);
 
     /**
-     * Tell the child that for testing purposes, a graphics device reset has
-     * occurred.
-     */
-    async TestGraphicsDeviceReset(uint32_t aReason);
-
-    /**
      * Notify the child that presentation receiver has been launched with the
      * correspondent iframe.
      */
     async NotifyPresentationReceiverLaunched(PBrowser aIframe, nsString aSessionId);
 
     /**
      * Notify the child that the info about a presentation receiver needs to be
      * cleaned up.
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -630,20 +630,16 @@ public:
      */
     static bool PerfWarnings();
 
     void NotifyCompositorCreated(mozilla::layers::LayersBackend aBackend);
     mozilla::layers::LayersBackend GetCompositorBackend() const {
       return mCompositorBackend;
     }
 
-    // Trigger a test-driven graphics device reset.
-    virtual void TestDeviceReset(DeviceResetReason aReason)
-    {}
-
     // Return information on how child processes should initialize graphics
     // devices. Currently this is only used on Windows.
     virtual void GetDeviceInitData(mozilla::gfx::DeviceInitData* aOut);
 
     // Plugin async drawing support.
     virtual bool SupportsPluginDirectBitmapDrawing() {
       return false;
     }
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -465,27 +465,17 @@ gfxWindowsPlatform::InitDWriteSupport()
 bool
 gfxWindowsPlatform::HandleDeviceReset()
 {
   DeviceResetReason resetReason = DeviceResetReason::OK;
   if (!DidRenderingDeviceReset(&resetReason)) {
     return false;
   }
 
-  if (mHasFakeDeviceReset) {
-    if (XRE_IsParentProcess()) {
-      // Notify child processes that we got a device reset.
-      nsTArray<dom::ContentParent*> processes;
-      dom::ContentParent::GetAll(processes);
-
-      for (size_t i = 0; i < processes.Length(); i++) {
-        processes[i]->SendTestGraphicsDeviceReset(uint32_t(resetReason));
-      }
-    }
-  } else {
+  if (!mHasFakeDeviceReset) {
     Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason));
   }
 
   // Remove devices and adapters.
   ResetD3D11Devices();
   mAdapter = nullptr;
 
   // Reset local state. Note: we leave feature status variables as-is. They
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -267,17 +267,17 @@ public:
 
     // Return the diagnostic status of DirectX initialization. If
     // initialization has not been attempted, this returns
     // FeatureStatus::Unused.
     mozilla::gfx::FeatureStatus GetD3D11Status() const;
     mozilla::gfx::FeatureStatus GetD2D1Status() const;
     unsigned GetD3D11Version();
 
-    void TestDeviceReset(DeviceResetReason aReason) override;
+    void TestDeviceReset(DeviceResetReason aReason);
 
     virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
     static mozilla::Atomic<size_t> sD3D11MemoryUsed;
     static mozilla::Atomic<size_t> sD3D9MemoryUsed;
     static mozilla::Atomic<size_t> sD3D9SharedTextureUsed;
 
     void GetDeviceInitData(mozilla::gfx::DeviceInitData* aOut) override;