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

Unified Diff: content/browser/renderer_host/render_process_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/renderer_host/render_process_host_impl.h
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index 60994e910cacea09268c7dce2b51c1766db0d770..1b61cd633f7f1d7c895c08884b6fbd0896de1af3 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -29,6 +29,8 @@
#include "content/public/common/mojo_shell_connection.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_platform_file.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
+#include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "services/shell/public/cpp/interface_registry.h"
#include "services/shell/public/interfaces/service.mojom.h"
@@ -106,7 +108,9 @@ typedef base::Thread* (*RendererMainThreadFactoryFunction)(
class CONTENT_EXPORT RenderProcessHostImpl
: public RenderProcessHost,
public ChildProcessLauncher::Client,
- public ui::GpuSwitchingObserver {
+ public ui::GpuSwitchingObserver,
+ public NON_EXPORTED_BASE(mojom::RouteProvider),
+ public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) {
public:
RenderProcessHostImpl(BrowserContext* browser_context,
StoragePartitionImpl* storage_partition_impl,
@@ -165,6 +169,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
void ResumeDeferredNavigation(const GlobalRequestID& request_id) override;
void NotifyTimezoneChange(const std::string& timezone) override;
shell::InterfaceProvider* GetRemoteInterfaces() override;
+ mojom::RouteProvider* GetRemoteRouteProvider() override;
std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator()
override;
const base::TimeTicks& GetInitTimeForNavigationMetrics() const override;
@@ -327,6 +332,16 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Registers Mojo interfaces to be exposed to the renderer.
void RegisterMojoInterfaces();
+ // mojom::RouteProvider:
+ void GetRoute(
+ int32_t routing_id,
+ mojom::AssociatedInterfaceProviderAssociatedRequest request) override;
+
+ // mojom::AssociatedInterfaceProvider:
+ void GetAssociatedInterface(
+ const std::string& name,
+ mojom::AssociatedInterfaceAssociatedRequest request) override;
+
void CreateStoragePartitionService(
mojo::InterfaceRequest<mojom::StoragePartitionService> request);
@@ -361,6 +376,8 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Handle termination of our process.
void ProcessDied(bool already_dead, RendererClosedDetails* known_details);
+ void OnRouteProviderRequest(mojom::RouteProviderAssociatedRequest request);
+
// GpuSwitchingObserver implementation.
void OnGpuSwitched() override;
@@ -430,6 +447,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// delete ourselves.
IDMap<IPC::Listener> listeners_;
+ mojo::AssociatedBinding<mojom::RouteProvider> route_provider_binding_;
+ mojo::AssociatedBindingSet<mojom::AssociatedInterfaceProvider>
+ associated_interface_provider_bindings_;
+
// The count of currently visible widgets. Since the host can be a container
// for multiple widgets, it uses this count to determine when it should be
// backgrounded.
@@ -466,11 +487,8 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Used to launch and terminate the process without blocking the UI thread.
std::unique_ptr<ChildProcessLauncher> child_process_launcher_;
- // Messages we queue while waiting for the process handle. We queue them here
- // instead of in the channel so that we ensure they're sent after init related
- // messages that are sent once the process handle is available. This is
- // because the queued messages may have dependencies on the init messages.
- std::queue<IPC::Message*> queued_messages_;
+ // Messages we queue before the ChannelProxy is created.
+ std::queue<std::unique_ptr<IPC::Message>> queued_messages_;
// The globally-unique identifier for this RPH.
const int id_;
@@ -575,6 +593,8 @@ class CONTENT_EXPORT RenderProcessHostImpl
scoped_refptr<ResourceMessageFilter> resource_message_filter_;
+ mojom::RouteProviderAssociatedPtr remote_route_provider_;
+
// A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend
// WeakPtrs which are invalidated any time the RPHI is recycled.
std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>>

Powered by Google App Engine
This is Rietveld 408576698