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 |
index ec7a1258fa1e827ed995a14005f4793383d660ce..081410e71e57a746271634e73e93ae792f45b56b 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java |
@@ -10,6 +10,7 @@ import org.chromium.base.annotations.CalledByNative; |
import org.chromium.base.annotations.JNINamespace; |
import org.chromium.content.browser.shapedetection.FaceDetectionProviderImpl; |
import org.chromium.content_public.browser.InterfaceRegistrar; |
+import org.chromium.content_public.browser.RenderFrameHost; |
import org.chromium.content_public.browser.WebContents; |
import org.chromium.device.BatteryMonitor; |
import org.chromium.device.battery.BatteryMonitorFactory; |
@@ -43,6 +44,16 @@ class InterfaceRegistrarImpl { |
InterfaceRegistrar.Registry.applyWebContentsRegistrars(registry, webContents); |
} |
+ @CalledByNative |
+ static void createInterfaceRegistryForRenderFrameHost( |
+ int nativeHandle, RenderFrameHost renderFrameHost) { |
+ ensureContentRegistrarsAreRegistered(); |
+ |
+ InterfaceRegistry registry = InterfaceRegistry.create( |
+ CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle()); |
+ InterfaceRegistrar.Registry.applyRenderFrameHostRegistrars(registry, renderFrameHost); |
+ } |
+ |
private static void ensureContentRegistrarsAreRegistered() { |
if (sHasRegisteredRegistrars) return; |
sHasRegisteredRegistrars = true; |