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

Unified Diff: content/browser/mojo/browser_service_registry_impl.h

Issue 1858103002: Strawman proposal for dealing with Android java mojo services registry in browser code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak a couple more headers. Created 4 years, 8 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 | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mojo/browser_service_registry_impl.h
diff --git a/content/browser/mojo/browser_service_registry_impl.h b/content/browser/mojo/browser_service_registry_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..88b9ebb42a3a18782aac3f6f224fef48190ad374
--- /dev/null
+++ b/content/browser/mojo/browser_service_registry_impl.h
@@ -0,0 +1,53 @@
+// 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_BROWSER_MOJO_BROWSER_SERVICE_REGISTRY_IMPL_
+#define CONTENT_BROWSER_MOJO_BROWSER_SERVICE_REGISTRY_IMPL_
+
+#include "content/common/mojo/service_registry_impl.h"
+#include "content/public/browser/browser_service_registry.h"
+
+namespace content {
+
+// Implementation of BrowserServiceRegistry.
+class CONTENT_EXPORT BrowserServiceRegistryImpl : public BrowserServiceRegistry {
+ public:
+ virtual ~BrowserServiceRegistryImpl() {}
+
+ // Implement the ServiceRegistry part of BrowserServiceRegistry by means of
+ // forwarding to our ServiceRegistryImpl member.
+ void AddService(
+ const std::string& service_name,
+ const base::Callback<void(mojo::ScopedMessagePipeHandle)>
+ service_factory) override {
+ impl_.AddService(service_name, service_factory);
+ }
+ // And so forth.
+
+#if defined(OS_ANDROID)
+ // Implementation of android specific methods. This can probably just be
+ // copied over from ServiceRegistryAndroid, or you could have a getter that
+ // returns the ServiceRegistryAndroid.
+ void AddService(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& j_service_registry,
+ const base::android::JavaParamRef<jobject>& j_manager,
+ const base::android::JavaParamRef<jobject>& j_factory,
+ const base::android::JavaParamRef<jstring>& j_name) override;
+#endif
+
+ private:
+ // Our ServiceRegistry methods are implemented in terms of the following
+ // ServiceRegistryImpl member.
+ ServiceRegistryImpl impl_;
+
+#if defined(OS_ANDROID)
+ // Android specific data members here. Probably just copied over from
+ // existing ServiceRegistryAndroid.
+#endif
+};
+
+} // namespace content
+
+#endif // CONTEBROWSER_MOJO_BROWSER_SERVICE_REGISTRY_IMPL_
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698