summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/gpu_channel_host.cc
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 11:09:52 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 11:09:52 +0000
commit9876476a3a3d99ab52a7705d3038363b7eab30fb (patch)
treed24f174e1361668a6aedbf688a5d36aa7a5ca899 /chrome/renderer/gpu_channel_host.cc
parent03eb8e9122528a2c35da2c3d0bc2694918f8b574 (diff)
downloadchromium_src-9876476a3a3d99ab52a7705d3038363b7eab30fb.zip
chromium_src-9876476a3a3d99ab52a7705d3038363b7eab30fb.tar.gz
chromium_src-9876476a3a3d99ab52a7705d3038363b7eab30fb.tar.bz2
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
Diffstat (limited to 'chrome/renderer/gpu_channel_host.cc')
-rw-r--r--chrome/renderer/gpu_channel_host.cc17
1 files changed, 8 insertions, 9 deletions
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(