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

Unified Diff: components/web_cache/renderer/web_cache_impl.cc

Issue 2823693002: Migrate RenderThreadImpl to use ConnectionFilter instead of the ChildThread's InterfaceRegistry to … (Closed)
Patch Set: . 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
« no previous file with comments | « components/web_cache/renderer/web_cache_impl.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_cache/renderer/web_cache_impl.cc
diff --git a/components/web_cache/renderer/web_cache_impl.cc b/components/web_cache/renderer/web_cache_impl.cc
index c4e73bf95f56a0b2607ff2789e4dfba5b122dfb6..23a815466b2f3b5b0ff1dfffca573dfe222f1f84 100644
--- a/components/web_cache/renderer/web_cache_impl.cc
+++ b/components/web_cache/renderer/web_cache_impl.cc
@@ -8,23 +8,31 @@
#include "base/bind.h"
#include "base/numerics/safe_conversions.h"
+#include "content/public/child/child_thread.h"
+#include "content/public/common/service_manager_connection.h"
+#include "content/public/common/simple_connection_filter.h"
#include "content/public/renderer/render_thread.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
#include "third_party/WebKit/public/platform/WebCache.h"
namespace web_cache {
WebCacheImpl::WebCacheImpl() : clear_cache_state_(kInit) {
- service_manager::InterfaceRegistry* registry =
- content::RenderThread::Get()->GetInterfaceRegistry();
+ auto registry = base::MakeUnique<service_manager::BinderRegistry>();
registry->AddInterface(
- base::Bind(&WebCacheImpl::BindRequest, base::Unretained(this)));
+ base::Bind(&WebCacheImpl::BindRequest, base::Unretained(this)),
+ base::ThreadTaskRunnerHandle::Get());
+ if (content::ChildThread::Get()) {
+ content::ChildThread::Get()
+ ->GetServiceManagerConnection()
+ ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
+ std::move(registry)));
+ }
}
WebCacheImpl::~WebCacheImpl() {}
-void WebCacheImpl::BindRequest(
- mojo::InterfaceRequest<mojom::WebCache> web_cache_request) {
+void WebCacheImpl::BindRequest(mojom::WebCacheRequest web_cache_request) {
bindings_.AddBinding(this, std::move(web_cache_request));
}
« no previous file with comments | « components/web_cache/renderer/web_cache_impl.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698