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/browser/android/interface_provider_android.h

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/browser/android/interface_provider_android.h
diff --git a/content/public/browser/android/interface_provider_android.h b/content/public/browser/android/interface_provider_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..2a283cd0a2951765463bc11bd43acd485af5a754
--- /dev/null
+++ b/content/public/browser/android/interface_provider_android.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_
+#define CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_
+
+#include <jni.h>
+#include <memory>
+
+#include "base/android/scoped_java_ref.h"
+#include "content/common/content_export.h"
+
+namespace shell {
+class InterfaceProvider;
+}
+
+namespace content {
+
+// Android wrapper around shell::InterfaceProvider, allowing code in Java to
+// request interfaces implemented in other environments.
+class CONTENT_EXPORT InterfaceProviderAndroid {
+ public:
+ virtual ~InterfaceProviderAndroid() {}
+
+ // The |registry| parameter must outlive |InterfaceProviderAndroid|.
no sievers 2016/07/29 18:02:13 s/registry/remote_interfaces
+ static std::unique_ptr<InterfaceProviderAndroid> Create(
+ shell::InterfaceProvider* remote_interfaces);
+
+ // Called from Java.
+ virtual void GetInterface(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& j_interface_provider,
+ const base::android::JavaParamRef<jstring>& j_name,
+ jint handle) = 0;
+
+ // Accessor to the Java object.
+ virtual const base::android::ScopedJavaGlobalRef<jobject>& GetObj() = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_ANDROID_INTERFACE_PROVIDER_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698