Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index 2f26a7324f43a18604553f3be8257b5d242e7d66..2b8b2ff13e4da7b449fef9bcadd8ae6a1637a5e8 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -24,6 +24,7 @@ |
#include "base/bind_helpers.h" |
#include "base/callback.h" |
#include "base/command_line.h" |
+#include "base/debug/trace_event.h" |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/metrics/field_trial.h" |
@@ -923,6 +924,14 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { |
reply->set_reply_error(); |
Send(reply); |
} |
+ |
+ // If this is a SwapBuffers, we need to ack it if we're not going to handle |
+ // it so that the GPU process doesn't get stuck in unscheduled state. |
+ bool msg_is_ok = true; |
+ IPC_BEGIN_MESSAGE_MAP_EX(RenderProcessHostImpl, msg, msg_is_ok) |
+ IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, |
+ OnCompositorSurfaceBuffersSwappedNoHost) |
+ IPC_END_MESSAGE_MAP_EX() |
return true; |
} |
return RenderWidgetHostImpl::From(rwh)->OnMessageReceived(msg); |
@@ -1341,3 +1350,14 @@ void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { |
void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); |
} |
+ |
+void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost( |
+ int32 surface_id, |
+ uint64 surface_handle, |
+ int32 route_id, |
+ int32 gpu_process_host_id) { |
+ TRACE_EVENT0("renderer_host", |
+ "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
+ RenderWidgetHostImpl::AcknowledgeSwapBuffers(route_id, |
+ gpu_process_host_id); |
+} |