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

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

Issue 2191033002: Split ServiceRegistryAndroid into InterfaceRegistryAndroid and InterfaceProviderAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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/InterfaceProvider.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/InterfaceProvider.java b/content/public/android/java/src/org/chromium/content/browser/InterfaceProvider.java
new file mode 100644
index 0000000000000000000000000000000000000000..6773a8911d096b514a7e13975f9a38f38999a7f4
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/InterfaceProvider.java
@@ -0,0 +1,44 @@
+// 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 org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.mojo.bindings.Interface;
+import org.chromium.mojo.bindings.Interface.Proxy;
+import org.chromium.mojo.bindings.InterfaceRequest;
+
+/**
+ * Java wrapper around the shell service's InterfaceProvider type.
+ */
+@JNINamespace("content")
+public class InterfaceProvider {
+
+ <I extends Interface, P extends Proxy> void getInterface(
+ Interface.Manager<I, P> manager, InterfaceRequest<I> request) {
+ int nativeHandle = request.passHandle().releaseNativeHandle();
+ nativeGetInterface(
+ mNativeInterfaceProviderAndroid, manager.getName(), nativeHandle);
+ }
+
+ private long mNativeInterfaceProviderAndroid;
+
+ private InterfaceProvider(long nativeInterfaceProviderAndroid) {
+ mNativeInterfaceProviderAndroid = nativeInterfaceProviderAndroid;
+ }
+
+ @CalledByNative
+ private static InterfaceProvider create(long nativeInterfaceProviderAndroid) {
+ return new InterfaceProvider(nativeInterfaceProviderAndroid);
+ }
+
+ @CalledByNative
+ private void destroy() {
+ mNativeInterfaceProviderAndroid = 0;
+ }
+
+ private native void nativeGetInterface(long nativeInterfaceProviderAndroid, String name,
+ int handle);
+}
« no previous file with comments | « content/public/android/BUILD.gn ('k') | content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrar.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698