Bug 1380655: Look for the timeout and terminate GPU process only when we have a separate GPU process, not also when the browser is acting as one. r?dvander draft
authorMilan Sreckovic <milan@mozilla.com>
Fri, 14 Jul 2017 12:18:52 -0400
changeset 609027 d6586e2cd5e85cfffcaa87847f4922edbd111d07
parent 608448 5c3e7cb5a35e1e56c7eb24ca392d22309f7af9f5
child 637483 4cc4f437d281a432d5d0fbbf16d11dca3eee7a9c
push id68482
push userbmo:milan@mozilla.com
push dateFri, 14 Jul 2017 16:20:03 +0000
reviewersdvander
bugs1380655
milestone56.0a1
Bug 1380655: Look for the timeout and terminate GPU process only when we have a separate GPU process, not also when the browser is acting as one. r?dvander MozReview-Commit-ID: Fp4Dv5SArjX
gfx/layers/ipc/CompositorManagerChild.cpp
--- a/gfx/layers/ipc/CompositorManagerChild.cpp
+++ b/gfx/layers/ipc/CompositorManagerChild.cpp
@@ -253,27 +253,30 @@ CompositorManagerChild::GetSpecificMessa
 }
 
 void
 CompositorManagerChild::SetReplyTimeout()
 {
 #ifndef DEBUG
   // Add a timeout for release builds to kill GPU process when it hangs.
   // Don't apply timeout when using web render as it tend to timeout frequently.
-  if (XRE_IsParentProcess() && !gfxVars::UseWebRender()) {
+  if (XRE_IsParentProcess() &&
+      GPUProcessManager::Get()->GetGPUChild() &&
+      !gfxVars::UseWebRender()) {
     int32_t timeout = gfxPrefs::GPUProcessIPCReplyTimeoutMs();
     SetReplyTimeoutMs(timeout);
   }
 #endif
 }
 
 bool
 CompositorManagerChild::ShouldContinueFromReplyTimeout()
 {
   if (XRE_IsParentProcess()) {
     gfxCriticalNote << "Killing GPU process due to IPC reply timeout";
+    MOZ_DIAGNOSTIC_ASSERT(GPUProcessManager::Get()->GetGPUChild());
     GPUProcessManager::Get()->KillProcess();
   }
   return false;
 }
 
 } // namespace layers
 } // namespace mozilla