summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gpu_process_host.cc
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-15 21:41:15 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-15 21:41:15 +0000
commitb2277bea8f33c4c346914cf81c628aac2a15f79b (patch)
treee29c7bc1441947a8347c25e5a9c4cec2edc9d888 /chrome/browser/gpu_process_host.cc
parentee5feb9fa3859299c6be22a34f42be3b6e235bfd (diff)
downloadchromium_src-b2277bea8f33c4c346914cf81c628aac2a15f79b.zip
chromium_src-b2277bea8f33c4c346914cf81c628aac2a15f79b.tar.gz
chromium_src-b2277bea8f33c4c346914cf81c628aac2a15f79b.tar.bz2
Fixed a hang in the renderer process. If the renderer process requests for a channel synchronously and the channel could not be established, the renderer thread would keep waiting for the reply to synchronization request.
BUG=61771 TEST=Manually tested pages that require hardware acceleration to make sure they still render correctly Review URL: http://codereview.chromium.org/4884002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gpu_process_host.cc')
-rw-r--r--chrome/browser/gpu_process_host.cc30
1 files changed, 23 insertions, 7 deletions
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc
index 171c404..e7bcf01 100644
--- a/chrome/browser/gpu_process_host.cc
+++ b/chrome/browser/gpu_process_host.cc
@@ -152,17 +152,20 @@ void GpuProcessHost::EstablishGpuChannel(int renderer_id,
if (Send(new GpuMsg_EstablishChannel(renderer_id))) {
sent_requests_.push(ChannelRequest(filter));
} else {
- ReplyToRenderer(IPC::ChannelHandle(), GPUInfo(), filter);
+ SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), filter);
}
}
void GpuProcessHost::Synchronize(IPC::Message* reply,
ResourceMessageFilter* filter) {
- queued_synchronization_replies_.push(SynchronizationRequest(reply, filter));
- Send(new GpuMsg_Synchronize());
+ if (Send(new GpuMsg_Synchronize())) {
+ queued_synchronization_replies_.push(SynchronizationRequest(reply, filter));
+ } else {
+ SendSynchronizationReply(reply, filter);
+ }
}
-GPUInfo GpuProcessHost::gpu_info() const {
+const GPUInfo& GpuProcessHost::gpu_info() const {
return gpu_info_;
}
@@ -203,7 +206,7 @@ void GpuProcessHost::OnChannelEstablished(
const IPC::ChannelHandle& channel_handle,
const GPUInfo& gpu_info) {
const ChannelRequest& request = sent_requests_.front();
- ReplyToRenderer(channel_handle, gpu_info, request.filter);
+ SendEstablishChannelReply(channel_handle, gpu_info, request.filter);
sent_requests_.pop();
gpu_info_ = gpu_info;
child_process_logging::SetGpuInfo(gpu_info);
@@ -212,7 +215,7 @@ void GpuProcessHost::OnChannelEstablished(
void GpuProcessHost::OnSynchronizeReply() {
const SynchronizationRequest& request =
queued_synchronization_replies_.front();
- request.filter->Send(request.reply);
+ SendSynchronizationReply(request.reply, request.filter);
queued_synchronization_replies_.pop();
}
@@ -344,7 +347,7 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
}
#endif
-void GpuProcessHost::ReplyToRenderer(
+void GpuProcessHost::SendEstablishChannelReply(
const IPC::ChannelHandle& channel,
const GPUInfo& gpu_info,
ResourceMessageFilter* filter) {
@@ -357,6 +360,13 @@ void GpuProcessHost::ReplyToRenderer(
filter->Send(message);
}
+// Sends the response for synchronization request to the renderer.
+void GpuProcessHost::SendSynchronizationReply(
+ IPC::Message* reply,
+ ResourceMessageFilter* filter) {
+ filter->Send(reply);
+}
+
URLRequestContext* GpuProcessHost::GetRequestContext(
uint32 request_id,
const ViewHostMsg_Resource_Request& request_data) {
@@ -366,3 +376,9 @@ URLRequestContext* GpuProcessHost::GetRequestContext(
bool GpuProcessHost::CanShutdown() {
return true;
}
+
+void GpuProcessHost::OnProcessCrashed() {
+ // TODO(alokp): Update gpu process crash rate.
+ BrowserChildProcessHost::OnProcessCrashed();
+}
+