| Index: content/browser/gpu/gpu_process_host_ui_shim.cc
|
| diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
|
| index f8fe86b4ef0f462ac5fef0ce32244cabd1faf000..c80a6515749e058729fa1241e08a5b1790d2ab08 100644
|
| --- a/content/browser/gpu/gpu_process_host_ui_shim.cc
|
| +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
|
| @@ -43,14 +43,6 @@ namespace {
|
| base::LazyInstance<IDMap<GpuProcessHostUIShim*>> g_hosts_by_id =
|
| LAZY_INSTANCE_INITIALIZER;
|
|
|
| -void SendOnIOThreadTask(int host_id, IPC::Message* msg) {
|
| - GpuProcessHost* host = GpuProcessHost::FromID(host_id);
|
| - if (host)
|
| - host->Send(msg);
|
| - else
|
| - delete msg;
|
| -}
|
| -
|
| void StopGpuProcessOnIO(int host_id) {
|
| GpuProcessHost* host = GpuProcessHost::FromID(host_id);
|
| if (host)
|
| @@ -122,15 +114,6 @@ GpuProcessHostUIShim* GpuProcessHostUIShim::GetOneInstance() {
|
| return it.GetCurrentValue();
|
| }
|
|
|
| -bool GpuProcessHostUIShim::Send(IPC::Message* msg) {
|
| - DCHECK(CalledOnValidThread());
|
| - return BrowserThread::PostTask(BrowserThread::IO,
|
| - FROM_HERE,
|
| - base::Bind(&SendOnIOThreadTask,
|
| - host_id_,
|
| - msg));
|
| -}
|
| -
|
| bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
|
| DCHECK(CalledOnValidThread());
|
|
|
| @@ -155,20 +138,32 @@ void GpuProcessHostUIShim::StopGpuProcess(const base::Closure& callback) {
|
| }
|
|
|
| void GpuProcessHostUIShim::SimulateRemoveAllContext() {
|
| - Send(new GpuMsg_Clean());
|
| + GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED,
|
| + false /* force_create */,
|
| + base::Bind([](GpuProcessHost* host) {
|
| + host->gpu_service()->DestroyAllChannels();
|
| + }));
|
| }
|
|
|
| void GpuProcessHostUIShim::SimulateCrash() {
|
| - Send(new GpuMsg_Crash());
|
| + GpuProcessHost::CallOnIO(
|
| + GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED, false /* force_create */,
|
| + base::Bind([](GpuProcessHost* host) { host->gpu_service()->Crash(); }));
|
| }
|
|
|
| void GpuProcessHostUIShim::SimulateHang() {
|
| - Send(new GpuMsg_Hang());
|
| + GpuProcessHost::CallOnIO(
|
| + GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED, false /* force_create */,
|
| + base::Bind([](GpuProcessHost* host) { host->gpu_service()->Hang(); }));
|
| }
|
|
|
| #if defined(OS_ANDROID)
|
| void GpuProcessHostUIShim::SimulateJavaCrash() {
|
| - Send(new GpuMsg_JavaCrash());
|
| + GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED,
|
| + false /* force_create */,
|
| + base::Bind([](GpuProcessHost* host) {
|
| + host->gpu_service()->ThrowJavaException();
|
| + }));
|
| }
|
| #endif
|
|
|
|
|