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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2643183002: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. (Closed)
Patch Set: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. Created 3 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
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 1884d92a11831b77c0089f967ba8a5d4a29a1460..3b2ced188c8898e95552579cf63b4813bc34861c 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1319,8 +1319,12 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
base::Unretained(
memory_instrumentation::CoordinatorImpl::GetInstance())));
- GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(),
- this);
+ associated_interfaces_.reset(new AssociatedInterfaceRegistryImpl());
+ GetContentClient()->browser()->ExposeInterfacesToRenderer(
+ registry.get(), associated_interfaces_.get(), this);
+ static_cast<AssociatedInterfaceRegistry*>(associated_interfaces_.get())
+ ->AddInterface(base::Bind(&RenderProcessHostImpl::BindRouteProvider,
+ base::Unretained(this)));
ServiceManagerConnection* service_manager_connection =
BrowserContext::GetServiceManagerConnectionFor(browser_context_);
@@ -1332,6 +1336,13 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
std::move(connection_filter));
}
+void RenderProcessHostImpl::BindRouteProvider(
+ mojom::RouteProviderAssociatedRequest request) {
+ if (route_provider_binding_.is_bound())
+ return;
+ route_provider_binding_.Bind(std::move(request));
+}
+
void RenderProcessHostImpl::GetRoute(
int32_t routing_id,
mojom::AssociatedInterfaceProviderAssociatedRequest request) {
@@ -2075,12 +2086,8 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
void RenderProcessHostImpl::OnAssociatedInterfaceRequest(
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle handle) {
- if (interface_name == mojom::RouteProvider::Name_) {
- if (route_provider_binding_.is_bound())
- return;
- mojom::RouteProviderAssociatedRequest request;
- request.Bind(std::move(handle));
- route_provider_binding_.Bind(std::move(request));
+ if (associated_interfaces_->CanBindRequest(interface_name)) {
+ associated_interfaces_->BindRequest(interface_name, std::move(handle));
} else {
LOG(ERROR) << "Request for unknown Channel-associated interface: "
<< interface_name;

Powered by Google App Engine
This is Rietveld 408576698