summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/gpu_channel_host.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-06 22:34:44 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-06 22:34:44 +0000
commit281d17a33e0d4059bffa3e4d85e563553d244f87 (patch)
tree2192ab8c43f21055fefd82d4ab5f9b3ea2239155 /chrome/renderer/gpu_channel_host.cc
parent5d1d6d841218a88cbfff5d65306331ae0beb2cfc (diff)
downloadchromium_src-281d17a33e0d4059bffa3e4d85e563553d244f87.zip
chromium_src-281d17a33e0d4059bffa3e4d85e563553d244f87.tar.gz
chromium_src-281d17a33e0d4059bffa3e4d85e563553d244f87.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61718 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/gpu_channel_host.cc')
-rw-r--r--chrome/renderer/gpu_channel_host.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc
index 0b576b8..c8def6c 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_(UNCONNECTED) {
+GpuChannelHost::GpuChannelHost() : state_(kUnconnected) {
}
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_ = CONNECTED;
+ state_ = kConnected;
}
void GpuChannelHost::set_gpu_info(const GPUInfo& gpu_info) {
@@ -53,7 +53,7 @@ void GpuChannelHost::OnChannelConnected(int32 peer_pid) {
}
void GpuChannelHost::OnChannelError() {
- state_ = LOST;
+ state_ = kLost;
// Channel is invalid and will be reinitialized if this host is requested
// again.
@@ -74,12 +74,13 @@ void GpuChannelHost::OnChannelError() {
}
bool GpuChannelHost::Send(IPC::Message* message) {
- if (!channel_.get()) {
- delete message;
- return false;
- }
+ if (channel_.get())
+ return channel_->Send(message);
- return channel_->Send(message);
+ // Callee takes ownership of message, regardless of whether Send is
+ // successful. See IPC::Message::Sender.
+ delete message;
+ return false;
}
CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer(