OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/browser/service_manager/common_browser_interfaces.h" | 5 #include "content/browser/service_manager/common_browser_interfaces.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
14 #include "components/discardable_memory/service/discardable_shared_memory_manage r.h" | 14 #include "components/discardable_memory/service/discardable_shared_memory_manage r.h" |
15 #include "content/browser/browser_main_loop.h" | 15 #include "content/browser/browser_main_loop.h" |
16 #include "content/public/common/connection_filter.h" | 16 #include "content/public/common/connection_filter.h" |
17 #include "content/public/common/service_manager_connection.h" | 17 #include "content/public/common/service_manager_connection.h" |
18 #include "device/geolocation/geolocation_manager.h" | |
18 #include "mojo/public/cpp/bindings/interface_request.h" | 19 #include "mojo/public/cpp/bindings/interface_request.h" |
19 #include "services/resource_coordinator/memory_instrumentation/coordinator_impl. h" | 20 #include "services/resource_coordinator/memory_instrumentation/coordinator_impl. h" |
20 #include "services/service_manager/public/cpp/binder_registry.h" | 21 #include "services/service_manager/public/cpp/binder_registry.h" |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 void BindMemoryCoordinatorRequest( | 27 void BindMemoryCoordinatorRequest( |
27 const service_manager::BindSourceInfo& source_info, | 28 const service_manager::BindSourceInfo& source_info, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 const service_manager::BindSourceInfo& source_info, | 75 const service_manager::BindSourceInfo& source_info, |
75 mojo::InterfaceRequest<Interface> request) { | 76 mojo::InterfaceRequest<Interface> request) { |
76 task_runner->PostTask( | 77 task_runner->PostTask( |
77 FROM_HERE, base::BindOnce(binder, source_info, std::move(request))); | 78 FROM_HERE, base::BindOnce(binder, source_info, std::move(request))); |
78 } | 79 } |
79 | 80 |
80 template <typename Interface> | 81 template <typename Interface> |
81 void RegisterMainThreadInterface(const InterfaceBinder<Interface>& binder) { | 82 void RegisterMainThreadInterface(const InterfaceBinder<Interface>& binder) { |
82 registry_.AddInterface(base::Bind(&BindOnTaskRunner<Interface>, | 83 registry_.AddInterface(base::Bind(&BindOnTaskRunner<Interface>, |
83 main_thread_task_runner_, binder)); | 84 main_thread_task_runner_, binder)); |
85 | |
86 registry_.AddInterface(base::Bind(&device::GeolocationManager::Create)); | |
blundell
2017/07/11 09:08:34
I think what you want to do is add a *call* to Reg
asimjour1
2017/07/11 15:04:12
replaced with a call to RegisterMainThreadInterfac
Ken Rockot(use gerrit already)
2017/07/11 15:22:55
It's a bit weird but it seems OK to me given that
| |
84 } | 87 } |
85 | 88 |
86 const scoped_refptr<base::TaskRunner> main_thread_task_runner_; | 89 const scoped_refptr<base::TaskRunner> main_thread_task_runner_; |
87 service_manager::BinderRegistry registry_; | 90 service_manager::BinderRegistry registry_; |
88 | 91 |
89 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); | 92 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); |
90 }; | 93 }; |
91 | 94 |
92 } // namespace | 95 } // namespace |
93 | 96 |
94 void RegisterCommonBrowserInterfaces(ServiceManagerConnection* connection) { | 97 void RegisterCommonBrowserInterfaces(ServiceManagerConnection* connection) { |
95 connection->AddConnectionFilter(base::MakeUnique<ConnectionFilterImpl>()); | 98 connection->AddConnectionFilter(base::MakeUnique<ConnectionFilterImpl>()); |
96 } | 99 } |
97 | 100 |
98 } // namespace content | 101 } // namespace content |
OLD | NEW |