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

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

Issue 2459973002: Expedite discovery of primary DRM device. (Closed)
Patch Set: Explicitly document the thread on which each method is expected to be called. Created 4 years, 1 month 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.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 8329c4ee60fa2dc1b97b2a2c2d55002cdf2e28cb..3a56b8c57b12cb367f7deabbc2dea7e4b83a2b3c 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -82,6 +82,8 @@
#endif
#if defined(USE_OZONE)
+#include "ui/ozone/public/gpu_platform_support_host.h"
+#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/ozone_switches.h"
#endif
@@ -185,6 +187,17 @@ void SendGpuProcessMessage(GpuProcessHost::GpuProcessKind kind,
}
}
+#if defined(USE_OZONE)
+void SendGpuProcessMessageByHostId(int host_id, IPC::Message* message) {
rjkroege 2016/11/01 22:54:54 This is used only in this file? Perhaps it should
hshi1 2016/11/01 23:02:32 Correct, and it is indeed already in an anonymous
+ GpuProcessHost* host = GpuProcessHost::FromID(host_id);
+ if (host) {
+ host->Send(message);
+ } else {
+ delete message;
+ }
+}
+#endif
+
// NOTE: changes to this class need to be reviewed by the security team.
class GpuSandboxedProcessLauncherDelegate
: public SandboxedProcessLauncherDelegate {
@@ -596,6 +609,14 @@ bool GpuProcessHost::Init() {
if (!Send(new GpuMsg_Initialize(gpu_preferences)))
return false;
+#if defined(USE_OZONE)
rjkroege 2016/11/01 22:54:54 For the benefit of us who need to update the mus G
hshi1 2016/11/01 23:18:46 Done.
+ ui::OzonePlatform::GetInstance()
+ ->GetGpuPlatformSupportHost()
+ ->OnGpuProcessLaunched(
+ host_id_, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
+ base::Bind(&SendGpuProcessMessageByHostId, host_id_));
+#endif
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698