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

Unified Diff: content/browser/frame_host/render_frame_host_impl.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/browser/frame_host/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index e16b0e49849dfe7d4bab19ffc82b3daa2d1f1325..7766e4733160a1e7b6d34991942195364e38d7ab 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -36,6 +36,7 @@
#include "content/common/navigation_params.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/javascript_message_type.h"
+#include "content/public/common/routed_interface.mojom.h"
#include "media/mojo/interfaces/service_factory.mojom.h"
#include "net/http/http_response_headers.h"
#include "services/shell/public/cpp/interface_factory.h"
@@ -107,7 +108,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
public BrowserAccessibilityDelegate,
public SiteInstanceImpl::Observer,
public NON_EXPORTED_BASE(
- shell::InterfaceFactory<media::mojom::ServiceFactory>) {
+ shell::InterfaceFactory<media::mojom::ServiceFactory>),
+ public NON_EXPORTED_BASE(mojom::RoutedInterfaceProvider) {
public:
using AXTreeSnapshotCallback =
base::Callback<void(
@@ -159,6 +161,12 @@ class CONTENT_EXPORT RenderFrameHostImpl
RenderViewHost* GetRenderViewHost() override;
shell::InterfaceRegistry* GetInterfaceRegistry() override;
shell::InterfaceProvider* GetRemoteInterfaces() override;
+ void AddRoutedInterface(const base::StringPiece& name,
+ const RoutedInterfaceFactory& factory) override;
+ void RemoveRoutedInterface(const base::StringPiece& name) override;
+ void GetRemoteRoutedInterface(
+ const base::StringPiece& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override;
blink::WebPageVisibilityState GetVisibilityState() override;
bool IsRenderFrameLive() override;
int GetProxyCount() override;
@@ -827,6 +835,13 @@ class CONTENT_EXPORT RenderFrameHostImpl
// happen before it fires (to avoid flakiness).
void DisableSwapOutTimerForTesting();
+ mojom::RoutedInterfaceProvider* GetRemoteRoutedInterfaces();
+
+ // mojom::RoutedInterfaceProvider:
+ void GetRoutedInterface(
+ const std::string& name,
+ mojom::RoutedInterfaceAssociatedRequest request) override;
+
// For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
// refcount that calls Shutdown when it reaches zero. This allows each
// RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
@@ -1055,6 +1070,9 @@ class CONTENT_EXPORT RenderFrameHostImpl
std::vector<std::unique_ptr<shell::InterfaceRegistry>> media_registries_;
+ std::map<std::string, RoutedInterfaceFactory> routed_interfaces_;
+ mojom::RoutedInterfaceProviderAssociatedPtr remote_routed_interfaces_;
+
// NOTE: This must be the last member.
base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | content/public/renderer/render_frame.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698