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

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

Issue 2821473002: Service CreateNewWindow on the UI thread with a new mojo interface (Closed)
Patch Set: associated with IPC channel 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 9986ff6686d9b1f4b136e33816a1a20056bc5b80..c46d4419bb238cb416c66d00c74d6173b073d41b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -113,6 +113,7 @@
#include "content/browser/renderer_host/pepper/pepper_message_filter.h"
#include "content/browser/renderer_host/pepper/pepper_renderer_connection.h"
#include "content/browser/renderer_host/render_message_filter.h"
+#include "content/browser/renderer_host/render_message_filter_ui.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_helper.h"
@@ -1190,11 +1191,17 @@ void RenderProcessHostImpl::CreateMessageFilters() {
void RenderProcessHostImpl::RegisterMojoInterfaces() {
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
+ associated_registry_.reset(new AssociatedInterfaceRegistryImpl());
channel_->AddAssociatedInterfaceForIOThread(
base::Bind(&IndexedDBDispatcherHost::AddBinding,
base::Unretained(indexed_db_factory_.get())));
+ static_cast<AssociatedInterfaceRegistry*>(associated_registry_.get())
+ ->AddInterface(base::Bind(
+ &RenderMessageFilterUI::CreateFilter, base::Unretained(this),
+ base::RetainedRef(storage_partition_impl_->GetDOMStorageContext())));
+
#if defined(OS_ANDROID)
AddUIThreadInterface(
registry.get(), GetGlobalJavaInterfaces()
@@ -2083,6 +2090,8 @@ void RenderProcessHostImpl::OnAssociatedInterfaceRequest(
mojom::RouteProviderAssociatedRequest request;
request.Bind(std::move(handle));
route_provider_binding_.Bind(std::move(request));
+ } else if (associated_registry_->CanBindRequest(interface_name)) {
+ associated_registry_->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