Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1392)

Unified Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 2723013004: gpu: Replace more chrome ipc with mojom API. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | content/common/gpu_host_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
jbauman 2017/03/01 22:04:26 We should have a version of CallOnIO that takes ho
jbauman 2017/03/01 22:43:04 For example, these should all be done on the SANDB
sadrul 2017/03/02 03:36:54 Fixed, thanks for catching these! I did a little
+ 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
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | content/common/gpu_host_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698