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

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

Issue 2688193002: Mojo framework for AndroidOverlay. (Closed)
Patch Set: BUILD.gn fixes 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 | « no previous file | content/public/android/BUILD.gn » ('j') | media/mojo/clients/mojo_android_overlay.cc » ('J')
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 4aabfd167311f7e7bd0ab2e5047601a811a3685a..659c6f5effaeb31c6e8739b1284958a0236ca549 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -75,6 +75,9 @@
#if defined(OS_ANDROID)
#include "base/android/build_info.h"
+#include "content/public/browser/android/java_interfaces.h"
+#include "media/mojo/interfaces/android_overlay.mojom.h"
+#include "services/service_manager/public/cpp/interface_registry.h"
#endif
#if defined(OS_WIN)
@@ -318,6 +321,23 @@ void HostLoadedShader(int host_id,
} // anonymous namespace
+#if defined(OS_ANDROID)
+template <typename InterfaceType>
+void AddUIInterfaceHelper(service_manager::InterfaceRegistry* registry) {
boliu 2017/02/16 22:24:19 Hmm, I don't know mojo at all.. my immediate quest
liberato (no reviews please) 2017/02/17 17:47:12 (fixed per rockot@'s suggestions.)
+ registry->AddInterface(
+ content::GetGlobalJavaInterfaces()
+ ->CreateInterfaceFactory<InterfaceType>(),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::UI));
+}
+
+template <typename InterfaceType>
+void AddUIInterface(service_manager::InterfaceRegistry* registry) {
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)
+ ->PostTask(FROM_HERE,
+ base::Bind(&AddUIInterfaceHelper<InterfaceType>, registry));
Ken Rockot(use gerrit already) 2017/02/17 06:29:56 This is not safe, and CreateInterfaceFactory() whi
liberato (no reviews please) 2017/02/17 17:47:12 thank you very much!
+}
+#endif
+
class GpuProcessHost::ConnectionFilterImpl : public ConnectionFilter {
public:
ConnectionFilterImpl(GpuProcessHost* host) : host_(host) {}
@@ -332,6 +352,11 @@ class GpuProcessHost::ConnectionFilterImpl : public ConnectionFilter {
GetContentClient()->browser()->ExposeInterfacesToGpuProcess(registry,
host_);
+
+#if defined(OS_ANDROID)
+ AddUIInterface<media::mojom::AndroidOverlayProvider>(registry);
+#endif
+
return true;
}
« no previous file with comments | « no previous file | content/public/android/BUILD.gn » ('j') | media/mojo/clients/mojo_android_overlay.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698