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

Unified Diff: content/public/browser/render_frame_host.h

Issue 2310563002: Adds routed interface support between RenderFrameHost and RenderFrame (Closed)
Patch Set: 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
Index: content/public/browser/render_frame_host.h
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h
index a3a88636f2c87e8dda41c233d5f9090288b23c4d..7d99138282fc94ee5d8de5dd71d83f09b4f83ac4 100644
--- a/content/public/browser/render_frame_host.h
+++ b/content/public/browser/render_frame_host.h
@@ -10,10 +10,13 @@
#include "base/callback_forward.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/common/console_message_level.h"
#include "content/public/common/file_chooser_params.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
+#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
+#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/native_widget_types.h"
@@ -30,7 +33,6 @@ class InterfaceProvider;
}
namespace content {
-class RenderProcessHost;
class RenderViewHost;
class RenderWidgetHostView;
class SiteInstance;
@@ -191,6 +193,22 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
// interfaces exposed to it by the application running in this frame.
virtual shell::InterfaceProvider* GetRemoteInterfaces() = 0;
+ using RoutedInterfaceFactory =
+ base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>;
+
+ // Adds an associated interface factory to this host, allowing the remote
+ // RenderFrame to acquire a proxy to the interface on this specific host.
+ virtual void AddRoutedInterface(const base::StringPiece& name,
+ const RoutedInterfaceFactory& factory) = 0;
+
+ virtual void RemoveRoutedInterface(const base::StringPiece& name) = 0;
+
+ // Binds an interface proxy to be associated with the remote RenderFrame in
+ // the render process.
+ virtual void GetRemoteRoutedInterface(
+ const base::StringPiece& name,
+ mojo::ScopedInterfaceEndpointHandle handle) = 0;
+
// Returns the visibility state of the frame. The different visibility states
// of a frame are defined in Blink.
virtual blink::WebPageVisibilityState GetVisibilityState() = 0;
@@ -218,6 +236,14 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
const TextSurroundingSelectionCallback& callback,
int max_length) = 0;
+ template <typename Interface>
+ void GetRemoteRoutedInterface(
+ mojo::AssociatedInterfacePtr<Interface>* proxy) {
+ mojo::AssociatedInterfaceRequest<Interface> request =
+ mojo::GetProxy(proxy, GetProcess()->GetRoutedInterfaceGroup());
+ GetRemoteRoutedInterface(Interface::Name_, request.PassHandle());
+ }
+
private:
// This interface should only be implemented inside content.
friend class RenderFrameHostImpl;

Powered by Google App Engine
This is Rietveld 408576698