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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java

Issue 2217813003: Add global and per-WebContents java InterfaceRegistries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java-interface-registry
Patch Set: Created 4 years, 3 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/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..b1d920a97f8a9bfc25699749fbcdb504077b9c47
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+import android.content.Context;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.content_public.browser.InterfaceRegistrar;
+import org.chromium.content_public.browser.WebContents;
+import org.chromium.mojo.system.impl.CoreImpl;
+import org.chromium.services.shell.InterfaceRegistry;
+
+@JNINamespace("content")
+class InterfaceRegistrarImpl {
+ @CalledByNative
+ static void createInterfaceRegistryForContext(int nativeHandle, Context applicationContext) {
+ InterfaceRegistry registry = InterfaceRegistry.create(
+ CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
+ InterfaceRegistrar.Registry.applyContextRegistrars(registry, applicationContext);
+ }
+
+ @CalledByNative
+ static void createInterfaceRegistryForWebContents(int nativeHandle, WebContents webContents) {
+ InterfaceRegistry registry = InterfaceRegistry.create(
+ CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
+ InterfaceRegistrar.Registry.applyWebContentsRegistrars(registry, webContents);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698