diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 17:57:31 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 17:57:31 +0000 |
commit | 7709e715faacd39b61a68bda1d476219febfc768 (patch) | |
tree | 424bc9dfcf3da195c995e2edb011f45ec928eea6 /chrome/gpu/gpu_thread.h | |
parent | caa62f477849e63abfc28770f2d8173c166fa74b (diff) | |
download | chromium_src-7709e715faacd39b61a68bda1d476219febfc768.zip chromium_src-7709e715faacd39b61a68bda1d476219febfc768.tar.gz chromium_src-7709e715faacd39b61a68bda1d476219febfc768.tar.bz2 |
Re-land of http://codereview.chromium.org/6094009 with Mac build fix.
Perform GPU-related initialization in GPU process in response to an
IPC from the browser. Because Chromium's child process host detects
that the child has crashed by watching for IPC channel errors, it is
imperative that the GPU process's IPC channel be set up before it does
any work that might cause it to crash. If initialization fails, the
GPU process quits its message loop and cooperatively exits.
Fixed a bug in the GpuProcessHost where it would not unblock renderers
waiting for GPU process initialization if the GPU process exited.
BUG=65369
TEST=ran test case from bug on machine with no GPU hardware and
verified that it no longer hangs the renderer, and that the GPU
process exits
Review URL: http://codereview.chromium.org/6124002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_thread.h')
-rw-r--r-- | chrome/gpu/gpu_thread.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/gpu/gpu_thread.h b/chrome/gpu/gpu_thread.h index 07302d3..1d0f434 100644 --- a/chrome/gpu/gpu_thread.h +++ b/chrome/gpu/gpu_thread.h @@ -7,6 +7,7 @@ #pragma once #include "base/basictypes.h" +#include "base/command_line.h" #include "base/scoped_ptr.h" #include "base/time.h" #include "build/build_config.h" @@ -21,12 +22,15 @@ namespace IPC { struct ChannelHandle; } +class GpuWatchdogThread; + class GpuThread : public ChildThread { public: - GpuThread(); + explicit GpuThread(const CommandLine& command_line); ~GpuThread(); void Init(const base::Time& process_start_time); + void StopWatchdog(); // Remove the channel for a particular renderer. void RemoveChannel(int renderer_id); @@ -36,6 +40,7 @@ class GpuThread : public ChildThread { virtual bool OnControlMessageReceived(const IPC::Message& msg); // Message handlers. + void OnInitialize(); void OnEstablishChannel(int renderer_id); void OnCloseChannel(const IPC::ChannelHandle& channel_handle); void OnSynchronize(); @@ -53,6 +58,10 @@ class GpuThread : public ChildThread { static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); #endif + CommandLine command_line_; + base::Time process_start_time_; + scoped_refptr<GpuWatchdogThread> watchdog_thread_; + typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; GpuChannelMap gpu_channels_; |