diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-19 01:05:38 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-19 01:05:38 +0000 |
commit | e336f1332ca0738be24e846f78bfa8fcbac7236e (patch) | |
tree | b6d1a26e407562f3a6115fe7983197f01a4fdec2 /content/browser/gpu | |
parent | 54159b2b122ffe33e65bd2ed333c0afe223f98b3 (diff) | |
download | chromium_src-e336f1332ca0738be24e846f78bfa8fcbac7236e.zip chromium_src-e336f1332ca0738be24e846f78bfa8fcbac7236e.tar.gz chromium_src-e336f1332ca0738be24e846f78bfa8fcbac7236e.tar.bz2 |
Get rid of last gpu_messages.h dependency in chrome by having chrome ask the GPUProcessHostUIShim to hang/crash/clean the gpu process.
BUG=98716
Review URL: http://codereview.chromium.org/8548014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu')
-rw-r--r-- | content/browser/gpu/gpu_process_host_ui_shim.cc | 12 | ||||
-rw-r--r-- | content/browser/gpu/gpu_process_host_ui_shim.h | 8 |
2 files changed, 18 insertions, 2 deletions
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 66dc2a3..f5dcd8f 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -147,6 +147,18 @@ bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) { return OnControlMessageReceived(message); } +void GpuProcessHostUIShim::SimulateRemoveAllContext() { + Send(new GpuMsg_Clean()); +} + +void GpuProcessHostUIShim::SimulateCrash() { + Send(new GpuMsg_Crash()); +} + +void GpuProcessHostUIShim::SimulateHang() { + Send(new GpuMsg_Hang()); +} + GpuProcessHostUIShim::~GpuProcessHostUIShim() { DCHECK(CalledOnValidThread()); g_hosts_by_id.Pointer()->Remove(host_id_); diff --git a/content/browser/gpu/gpu_process_host_ui_shim.h b/content/browser/gpu/gpu_process_host_ui_shim.h index 0216263..1d17643 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.h +++ b/content/browser/gpu/gpu_process_host_ui_shim.h @@ -63,7 +63,7 @@ class GpuProcessHostUIShim // Destroy all remaining GpuProcessHostUIShims. CONTENT_EXPORT static void DestroyAll(); - static GpuProcessHostUIShim* FromID(int host_id); + CONTENT_EXPORT static GpuProcessHostUIShim* FromID(int host_id); // IPC::Channel::Sender implementation. virtual bool Send(IPC::Message* msg) OVERRIDE; @@ -72,7 +72,11 @@ class GpuProcessHostUIShim // The GpuProcessHost causes this to be called on the UI thread to // dispatch the incoming messages from the GPU process, which are // actually received on the IO thread. - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + virtual bool OnMessageReceived(const IPC::Message& message); + + CONTENT_EXPORT void SimulateRemoveAllContext(); + CONTENT_EXPORT void SimulateCrash(); + CONTENT_EXPORT void SimulateHang(); private: explicit GpuProcessHostUIShim(int host_id); |