| Index: gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
| diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
| index 1ced5d09fe883c99e9e6531bd40af9c9056e4e24..6acf91e9b5067f236f4de6e2fe21c95605c06f90 100644
|
| --- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
| +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
| @@ -183,9 +183,19 @@ gfx::SwapResult ImageTransportSurfaceOverlayMac::SwapBuffersInternal(
|
| // Mac, leading to high CPU usage. Instead we poll with a 1ms delay. This
|
| // should have minimal impact, as we will only hit this path when we are
|
| // more than one frame (16ms) behind.
|
| - while (!previous_frame_fence_->HasCompleted()) {
|
| + //
|
| + // Note that on some platforms (10.9), fences appear to sometimes get
|
| + // lost and will never pass. Add a 32ms timout to prevent these
|
| + // situations from causing a GPU process hang. crbug.com/618075
|
| + int timeout_msec = 32;
|
| + while (!previous_frame_fence_->HasCompleted() && timeout_msec > 0) {
|
| + --timeout_msec;
|
| base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
|
| }
|
| + if (!previous_frame_fence_->HasCompleted()) {
|
| + // We timed out waiting for the above fence, just issue a glFinish.
|
| + glFinish();
|
| + }
|
| }
|
|
|
| // Create a fence for the current frame's work and save the context.
|
|
|