From 9876476a3a3d99ab52a7705d3038363b7eab30fb Mon Sep 17 00:00:00 2001 From: "mnissler@chromium.org" Date: Thu, 7 Oct 2010 11:09:52 +0000 Subject: Revert 61718 - GPU process terminates on hang. I added a watchdog thread that intermitently checks the main thread can respond to tasks posted on its message queue. I fixed some bugs that preventede GGL from failing when the GPU channel was lost. Added a command line swith to disable the watchdog thread for debugging purposes. TEST=try, check WebGL works, check about:gpuhang terminates process. BUG=38739,53871 Review URL: http://codereview.chromium.org/3528012 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/3616011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61782 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/gpu_channel_host.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'chrome/renderer/gpu_channel_host.cc') diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc index c8def6c..0b576b8 100644 --- a/chrome/renderer/gpu_channel_host.cc +++ b/chrome/renderer/gpu_channel_host.cc @@ -9,7 +9,7 @@ #include "chrome/renderer/command_buffer_proxy.h" #include "chrome/renderer/gpu_video_service_host.h" -GpuChannelHost::GpuChannelHost() : state_(kUnconnected) { +GpuChannelHost::GpuChannelHost() : state_(UNCONNECTED) { } GpuChannelHost::~GpuChannelHost() { @@ -25,7 +25,7 @@ void GpuChannelHost::Connect(const std::string& channel_name) { // It is safe to send IPC messages before the channel completes the connection // and receives the hello message from the GPU process. The messages get // cached. - state_ = kConnected; + state_ = CONNECTED; } void GpuChannelHost::set_gpu_info(const GPUInfo& gpu_info) { @@ -53,7 +53,7 @@ void GpuChannelHost::OnChannelConnected(int32 peer_pid) { } void GpuChannelHost::OnChannelError() { - state_ = kLost; + state_ = LOST; // Channel is invalid and will be reinitialized if this host is requested // again. @@ -74,13 +74,12 @@ void GpuChannelHost::OnChannelError() { } bool GpuChannelHost::Send(IPC::Message* message) { - if (channel_.get()) - return channel_->Send(message); + if (!channel_.get()) { + delete message; + return false; + } - // Callee takes ownership of message, regardless of whether Send is - // successful. See IPC::Message::Sender. - delete message; - return false; + return channel_->Send(message); } CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( -- cgit v1.1