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

Unified Diff: content/public/common/associated_interface_provider.h

Issue 2310563002: Adds routed interface support between RenderFrameHost and RenderFrame (Closed)
Patch Set: nit 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
« no previous file with comments | « content/public/common/BUILD.gn ('k') | content/public/common/associated_interface_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/associated_interface_provider.h
diff --git a/content/public/common/associated_interface_provider.h b/content/public/common/associated_interface_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1c495b1a0fbe8cfb278cdeb40a1452cbcfa0a9b
--- /dev/null
+++ b/content/public/common/associated_interface_provider.h
@@ -0,0 +1,56 @@
+// 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_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_
+#define CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_
+
+#include <string>
+
+#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
+#include "mojo/public/cpp/bindings/associated_interface_request.h"
+#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
+
+namespace mojo {
+class AssociatedGroup;
+}
+
+namespace content {
+
+// A helper interface for connecting to remote Channel-associated interfaces.
+//
+// This is analogous to shell::InterfaceProvider in that it provides a means of
+// binding proxies to remote interfaces, but this is specifically for interfaces
+// which must be assocaited with an IPC::Channel, i.e. retain FIFO message
+// ordering with respect to legacy IPC messages.
+//
+// The Channel with which the remote interfaces are associated depends on
+// the configuration of the specific AssociatedInterfaceProvider instance. For
+// example, RenderFrameHost exposes an instance of this class for which all
+// interfaces are associted with the IPC::ChannelProxy to the render process
+// which hosts its corresponding RenderFrame.
+class AssociatedInterfaceProvider {
+ public:
+ virtual ~AssociatedInterfaceProvider() {}
+
+ // Passes an associated endpoint handle to the remote end to be bound to a
+ // Channel-associated interface named |name|.
+ virtual void GetInterface(const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) = 0;
+
+ // Returns an AssociatedGroup for the provider. This may be used to create
+ // new associated endpoints for use with Channel-associated interfaces.
+ virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0;
+
+ // Templated helper for GetInterface().
+ template <typename Interface>
+ void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) {
+ mojo::AssociatedInterfaceRequest<Interface> request =
+ mojo::GetProxy(proxy, GetAssociatedGroup());
+ GetInterface(Interface::Name_, request.PassHandle());
+ }
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_
« no previous file with comments | « content/public/common/BUILD.gn ('k') | content/public/common/associated_interface_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698