diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gpu_process_host.cc | 25 | ||||
-rw-r--r-- | chrome/browser/gpu_process_host.h | 7 |
3 files changed, 28 insertions, 8 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 69ad244..0395051 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -1162,11 +1162,11 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) { // Handle URLs to wreck the gpu process. if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutGpuCrashURL)) { - GpuProcessHost::SendAboutGpuCrash(); + GpuProcessHost::Get()->SendAboutGpuCrash(); return true; } if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutGpuHangURL)) { - GpuProcessHost::SendAboutGpuHang(); + GpuProcessHost::Get()->SendAboutGpuHang(); return true; } 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()); +} diff --git a/chrome/browser/gpu_process_host.h b/chrome/browser/gpu_process_host.h index a5268ba..ec43ca8 100644 --- a/chrome/browser/gpu_process_host.h +++ b/chrome/browser/gpu_process_host.h @@ -29,11 +29,11 @@ class GpuProcessHost : public BrowserChildProcessHost { static GpuProcessHost* Get(); // Tells the GPU process to crash. Useful for testing. - static void SendAboutGpuCrash(); + void SendAboutGpuCrash(); // Tells the GPU process to let its main thread enter an infinite loop. // Useful for testing. - static void SendAboutGpuHang(); + void SendAboutGpuHang(); // Shutdown routine, which should only be called upon process // termination. @@ -115,6 +115,9 @@ class GpuProcessHost : public BrowserChildProcessHost { virtual bool CanShutdown(); + static void SendAboutGpuCrashInternal(); + static void SendAboutGpuHangInternal(); + bool initialized_; bool initialized_successfully_; |