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

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

Issue 1878103002: Plumb a Browser->GPU surface destruction message for Android VDAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing ifdefs Created 4 years, 8 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
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 a7c5b20bd8d8c2127622a58d2b07a9f2393802ce..605ecb9aea23993b3a5705445bef4f4c74f8a367 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -63,6 +63,18 @@ void StopGpuProcessOnIO(int host_id) {
host->StopGpuProcess();
}
+#if defined(OS_ANDROID)
+void DestroyingVideoSurfaceOnIO(int host_id,
+ int32_t surface_id,
+ const base::Closure& done_cb) {
+ GpuProcessHost* host = GpuProcessHost::FromID(host_id);
+ if (host)
+ host->DestroyingVideoSurface(surface_id, done_cb);
+ else
+ done_cb.Run();
+}
+#endif
+
} // namespace
void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) {
@@ -140,6 +152,19 @@ bool GpuProcessHostUIShim::Send(IPC::Message* msg) {
msg));
}
+#if defined(OS_ANDROID)
+void GpuProcessHostUIShim::DestroyingVideoSurface(
+ int surface_id,
+ const base::Closure& done_cb) {
+ DCHECK(CalledOnValidThread());
+ if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ base::Bind(&DestroyingVideoSurfaceOnIO, host_id_,
+ surface_id, done_cb))) {
+ done_cb.Run();
+ }
+}
+#endif
+
bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698