Chromium Code Reviews

Side by Side 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.
Jump to:
View unified diff |
« no previous file with comments | « extensions/test/test_content_utility_client.h ('k') | extensions/utility/utility_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/test/test_content_utility_client.h" 5 #include "extensions/test/test_content_utility_client.h"
6 6
7 #include "base/memory/ptr_util.h"
8 #include "content/public/child/child_thread.h"
9 #include "content/public/common/service_manager_connection.h"
10 #include "content/public/common/simple_connection_filter.h"
11 #include "services/service_manager/public/cpp/binder_registry.h"
12
7 namespace extensions { 13 namespace extensions {
8 14
9 TestContentUtilityClient::TestContentUtilityClient() = default; 15 TestContentUtilityClient::TestContentUtilityClient() = default;
10 16
11 TestContentUtilityClient::~TestContentUtilityClient() = default; 17 TestContentUtilityClient::~TestContentUtilityClient() = default;
12 18
13 void TestContentUtilityClient::UtilityThreadStarted() { 19 void TestContentUtilityClient::UtilityThreadStarted() {
14 utility_handler::UtilityThreadStarted(); 20 utility_handler::UtilityThreadStarted();
15 }
16 21
17 void TestContentUtilityClient::ExposeInterfacesToBrowser( 22 auto registry = base::MakeUnique<service_manager::BinderRegistry>();
18 service_manager::InterfaceRegistry* registry) { 23 utility_handler::ExposeInterfacesToBrowser(registry.get(), false);
19 utility_handler::ExposeInterfacesToBrowser(registry, false); 24 content::ChildThread::Get()
25 ->GetServiceManagerConnection()
26 ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
27 std::move(registry)));
20 } 28 }
21 29
22 } // namespace extensions 30 } // namespace extensions
OLDNEW
« 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