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

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

Issue 2717233003: gpu: Use mojom API for getting video memory usage. (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.h ('k') | content/browser/gpu/gpu_process_host_ui_shim.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.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 870993b306b7bd7a4e4f9659383e78866a560f92..68ad9ebf55b41a2fe4cc87c9a957c4fc32461485 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -196,6 +196,14 @@ void SendGpuProcessMessage(GpuProcessHost::GpuProcessKind kind,
}
}
+void RunCallbackOnIO(GpuProcessHost::GpuProcessKind kind,
+ bool force_create,
+ const base::Callback<void(GpuProcessHost*)>& callback) {
+ GpuProcessHost* host = GpuProcessHost::Get(kind, force_create);
+ if (host)
+ callback.Run(host);
+}
+
#if defined(USE_OZONE)
void SendGpuProcessMessageByHostId(int host_id, IPC::Message* message) {
GpuProcessHost* host = GpuProcessHost::FromID(host_id);
@@ -427,6 +435,16 @@ void GpuProcessHost::SendOnIO(GpuProcessKind kind,
}
}
+// static
+void GpuProcessHost::CallOnIO(
+ GpuProcessKind kind,
+ bool force_create,
+ const base::Callback<void(GpuProcessHost*)>& callback) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&RunCallbackOnIO, kind, force_create, callback));
+}
+
service_manager::InterfaceProvider* GpuProcessHost::GetRemoteInterfaces() {
return process_->child_connection()->GetRemoteInterfaces();
}
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/gpu/gpu_process_host_ui_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698