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

Unified Diff: extensions/test/test_content_utility_client.cc

Issue 2810343002: Convert UtilityThread/Clients to add ConnectionFilters instead of using ChildThread's InterfaceRegi… (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 | « extensions/test/test_content_utility_client.h ('k') | extensions/utility/utility_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/test_content_utility_client.cc
diff --git a/extensions/test/test_content_utility_client.cc b/extensions/test/test_content_utility_client.cc
index fd01822a7e906c83cd9b856111daf7ebf337cbaa..9e4e96b83b17306a1f01b6d1754b11a2dcc1616f 100644
--- a/extensions/test/test_content_utility_client.cc
+++ b/extensions/test/test_content_utility_client.cc
@@ -4,6 +4,12 @@
#include "extensions/test/test_content_utility_client.h"
+#include "base/memory/ptr_util.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 "services/service_manager/public/cpp/binder_registry.h"
+
namespace extensions {
TestContentUtilityClient::TestContentUtilityClient() = default;
@@ -12,11 +18,13 @@ TestContentUtilityClient::~TestContentUtilityClient() = default;
void TestContentUtilityClient::UtilityThreadStarted() {
utility_handler::UtilityThreadStarted();
-}
-void TestContentUtilityClient::ExposeInterfacesToBrowser(
- service_manager::InterfaceRegistry* registry) {
- utility_handler::ExposeInterfacesToBrowser(registry, false);
+ auto registry = base::MakeUnique<service_manager::BinderRegistry>();
+ utility_handler::ExposeInterfacesToBrowser(registry.get(), false);
+ content::ChildThread::Get()
+ ->GetServiceManagerConnection()
+ ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
+ std::move(registry)));
}
} // namespace extensions
« no previous file with comments | « extensions/test/test_content_utility_client.h ('k') | extensions/utility/utility_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698