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

Side by Side Diff: content/browser/service_manager/service_manager_context.cc

Issue 2528743002: Shape Detection: Implement FaceDetection on Mac as out-of-process service (Closed)
Patch Set: Add explanatory comments, rebase Created 4 years 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 unified diff | Download patch
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 "content/browser/service_manager/service_manager_context.h" 5 #include "content/browser/service_manager/service_manager_context.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/json/json_reader.h" 12 #include "base/json/json_reader.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/strings/utf_string_conversions.h"
Ken Rockot(use gerrit already) 2016/12/05 20:56:52 nit: Please undo changes to this file since you're
xianglu 2016/12/05 22:13:22 Done.
17 #include "content/browser/gpu/gpu_process_host.h" 18 #include "content/browser/gpu/gpu_process_host.h"
18 #include "content/browser/service_manager/merge_dictionary.h" 19 #include "content/browser/service_manager/merge_dictionary.h"
19 #include "content/common/service_manager/service_manager_connection_impl.h" 20 #include "content/common/service_manager/service_manager_connection_impl.h"
20 #include "content/grit/content_resources.h" 21 #include "content/grit/content_resources.h"
21 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
22 #include "content/public/browser/content_browser_client.h" 23 #include "content/public/browser/content_browser_client.h"
23 #include "content/public/browser/utility_process_host.h" 24 #include "content/public/browser/utility_process_host.h"
24 #include "content/public/browser/utility_process_host_client.h" 25 #include "content/public/browser/utility_process_host_client.h"
25 #include "content/public/common/content_client.h" 26 #include "content/public/common/content_client.h"
26 #include "content/public/common/service_manager_connection.h" 27 #include "content/public/common/service_manager_connection.h"
27 #include "content/public/common/service_names.mojom.h" 28 #include "content/public/common/service_names.mojom.h"
28 #include "mojo/edk/embedder/embedder.h" 29 #include "mojo/edk/embedder/embedder.h"
29 #include "services/catalog/catalog.h" 30 #include "services/catalog/catalog.h"
30 #include "services/catalog/manifest_provider.h" 31 #include "services/catalog/manifest_provider.h"
31 #include "services/catalog/public/interfaces/constants.mojom.h" 32 #include "services/catalog/public/interfaces/constants.mojom.h"
32 #include "services/catalog/store.h" 33 #include "services/catalog/store.h"
33 #include "services/file/public/interfaces/constants.mojom.h" 34 #include "services/file/public/interfaces/constants.mojom.h"
34 #include "services/service_manager/connect_params.h" 35 #include "services/service_manager/connect_params.h"
35 #include "services/service_manager/native_runner.h" 36 #include "services/service_manager/native_runner.h"
36 #include "services/service_manager/public/cpp/connector.h" 37 #include "services/service_manager/public/cpp/connector.h"
37 #include "services/service_manager/public/cpp/service.h" 38 #include "services/service_manager/public/cpp/service.h"
38 #include "services/service_manager/public/interfaces/service.mojom.h" 39 #include "services/service_manager/public/interfaces/service.mojom.h"
39 #include "services/service_manager/runner/common/client_util.h" 40 #include "services/service_manager/runner/common/client_util.h"
40 #include "services/service_manager/runner/host/in_process_native_runner.h" 41 #include "services/service_manager/runner/host/in_process_native_runner.h"
41 #include "services/service_manager/service_manager.h" 42 #include "services/service_manager/service_manager.h"
43 #include "services/shape_detection/public/interfaces/constants.mojom.h"
44 #include "services/shape_detection/shape_detection_service.h"
42 45
43 namespace content { 46 namespace content {
44 47
45 namespace { 48 namespace {
46 49
47 base::LazyInstance<std::unique_ptr<service_manager::Connector>>::Leaky 50 base::LazyInstance<std::unique_ptr<service_manager::Connector>>::Leaky
48 g_io_thread_connector = LAZY_INSTANCE_INITIALIZER; 51 g_io_thread_connector = LAZY_INSTANCE_INITIALIZER;
49 52
50 void DestroyConnectorOnIOThread() { g_io_thread_connector.Get().reset(); } 53 void DestroyConnectorOnIOThread() { g_io_thread_connector.Get().reset(); }
51 54
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 base::Bind(&DestroyConnectorOnIOThread)); 314 base::Bind(&DestroyConnectorOnIOThread));
312 } 315 }
313 316
314 // static 317 // static
315 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { 318 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() {
316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 319 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
317 return g_io_thread_connector.Get().get(); 320 return g_io_thread_connector.Get().get();
318 } 321 }
319 322
320 } // namespace content 323 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698