diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 22:34:44 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 22:34:44 +0000 |
commit | 281d17a33e0d4059bffa3e4d85e563553d244f87 (patch) | |
tree | 2192ab8c43f21055fefd82d4ab5f9b3ea2239155 /chrome/browser/gpu_process_host.cc | |
parent | 5d1d6d841218a88cbfff5d65306331ae0beb2cfc (diff) | |
download | chromium_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/browser/gpu_process_host.cc')
-rw-r--r-- | chrome/browser/gpu_process_host.cc | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc index 8e2242e..3825c2f 100644 --- a/chrome/browser/gpu_process_host.cc +++ b/chrome/browser/gpu_process_host.cc @@ -91,6 +91,7 @@ bool GpuProcessHost::Init() { // Propagate relevant command line switches. static const char* const kSwitchNames[] = { switches::kUseGL, + switches::kDisableGpuWatchdog, switches::kDisableLogging, switches::kEnableLogging, switches::kGpuStartupDialog, @@ -122,14 +123,18 @@ GpuProcessHost* GpuProcessHost::Get() { return sole_instance_; } -// static void GpuProcessHost::SendAboutGpuCrash() { - Get()->Send(new GpuMsg_Crash()); + ChromeThread::PostTask( + ChromeThread::IO, + FROM_HERE, + NewRunnableFunction(&GpuProcessHost::SendAboutGpuCrashInternal)); } -// static void GpuProcessHost::SendAboutGpuHang() { - Get()->Send(new GpuMsg_Hang()); + ChromeThread::PostTask( + ChromeThread::IO, + FROM_HERE, + NewRunnableFunction(&GpuProcessHost::SendAboutGpuHangInternal)); } bool GpuProcessHost::Send(IPC::Message* msg) { @@ -348,3 +353,15 @@ URLRequestContext* GpuProcessHost::GetRequestContext( bool GpuProcessHost::CanShutdown() { return true; } + +// static +void GpuProcessHost::SendAboutGpuCrashInternal() { + DCHECK(Get()); + Get()->Send(new GpuMsg_Crash()); +} + +// static +void GpuProcessHost::SendAboutGpuHangInternal() { + DCHECK(Get()); + Get()->Send(new GpuMsg_Hang()); +} |