OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "chrome/common/file_patcher.mojom.h" | 16 #include "chrome/common/file_patcher.mojom.h" |
17 #include "chrome/utility/utility_message_handler.h" | 17 #include "chrome/utility/utility_message_handler.h" |
18 #include "components/payments/content/utility/payment_manifest_parser.h" | |
18 #include "components/safe_json/utility/safe_json_parser_mojo_impl.h" | 19 #include "components/safe_json/utility/safe_json_parser_mojo_impl.h" |
19 #include "content/public/child/image_decoder_utils.h" | 20 #include "content/public/child/image_decoder_utils.h" |
20 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
21 #include "content/public/common/service_info.h" | 22 #include "content/public/common/service_info.h" |
22 #include "content/public/utility/utility_thread.h" | 23 #include "content/public/utility/utility_thread.h" |
23 #include "courgette/courgette.h" | 24 #include "courgette/courgette.h" |
24 #include "courgette/third_party/bsdiff/bsdiff.h" | 25 #include "courgette/third_party/bsdiff/bsdiff.h" |
25 #include "extensions/features/features.h" | 26 #include "extensions/features/features.h" |
26 #include "mojo/public/cpp/bindings/strong_binding.h" | 27 #include "mojo/public/cpp/bindings/strong_binding.h" |
27 #include "printing/features/features.h" | 28 #include "printing/features/features.h" |
28 #include "services/image_decoder/image_decoder_service.h" | 29 #include "services/image_decoder/image_decoder_service.h" |
29 #include "services/image_decoder/public/interfaces/constants.mojom.h" | 30 #include "services/image_decoder/public/interfaces/constants.mojom.h" |
30 #include "services/service_manager/public/cpp/interface_registry.h" | 31 #include "services/service_manager/public/cpp/interface_registry.h" |
31 #include "third_party/zlib/google/zip.h" | 32 #include "third_party/zlib/google/zip.h" |
32 | 33 |
33 #if !defined(OS_ANDROID) | 34 #if !defined(OS_ANDROID) |
34 #include "chrome/common/resource_usage_reporter.mojom.h" | 35 #include "chrome/common/resource_usage_reporter.mojom.h" |
35 #include "chrome/utility/profile_import_handler.h" | 36 #include "chrome/utility/profile_import_handler.h" |
36 #include "mojo/public/cpp/bindings/strong_binding.h" | 37 #include "mojo/public/cpp/bindings/strong_binding.h" |
37 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" | 38 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
38 #include "net/proxy/proxy_resolver_v8.h" | 39 #include "net/proxy/proxy_resolver_v8.h" |
39 #else | |
40 #include "components/payments/content/android/utility/payment_manifest_parser.h" | |
41 #endif | 40 #endif |
42 | 41 |
43 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
44 #include "chrome/common/zip_file_creator.mojom.h" | 43 #include "chrome/common/zip_file_creator.mojom.h" |
45 #endif | 44 #endif |
46 | 45 |
47 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
48 #include "chrome/utility/ipc_shell_handler_win.h" | 47 #include "chrome/utility/ipc_shell_handler_win.h" |
49 #include "chrome/utility/shell_handler_impl_win.h" | 48 #include "chrome/utility/shell_handler_impl_win.h" |
50 #endif | 49 #endif |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 if (utility_process_running_elevated_) | 280 if (utility_process_running_elevated_) |
282 return; | 281 return; |
283 | 282 |
284 registry->AddInterface(base::Bind(&FilePatcherImpl::Create)); | 283 registry->AddInterface(base::Bind(&FilePatcherImpl::Create)); |
285 #if !defined(OS_ANDROID) | 284 #if !defined(OS_ANDROID) |
286 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 285 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
287 base::Bind(CreateProxyResolverFactory)); | 286 base::Bind(CreateProxyResolverFactory)); |
288 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 287 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
289 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); | 288 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); |
290 #else | 289 #else |
291 registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create)); | 290 registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create)); |
Mathieu
2017/03/21 20:18:12
are we not binding it yet on other platforms? Is t
please use gerrit instead
2017/03/21 20:34:51
Oops, my mistake. I need to register this on all p
| |
292 #endif | 291 #endif |
293 registry->AddInterface( | 292 registry->AddInterface( |
294 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); | 293 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); |
295 #if defined(OS_WIN) | 294 #if defined(OS_WIN) |
296 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); | 295 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); |
297 #endif | 296 #endif |
298 #if defined(OS_CHROMEOS) | 297 #if defined(OS_CHROMEOS) |
299 registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create)); | 298 registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create)); |
300 #endif | 299 #endif |
301 #if defined(FULL_SAFE_BROWSING) | 300 #if defined(FULL_SAFE_BROWSING) |
302 registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create)); | 301 registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create)); |
303 #endif | 302 #endif |
304 } | 303 } |
305 | 304 |
306 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { | 305 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { |
307 content::ServiceInfo image_decoder_info; | 306 content::ServiceInfo image_decoder_info; |
308 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); | 307 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); |
309 services->insert( | 308 services->insert( |
310 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); | 309 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); |
311 } | 310 } |
312 | 311 |
313 // static | 312 // static |
314 void ChromeContentUtilityClient::PreSandboxStartup() { | 313 void ChromeContentUtilityClient::PreSandboxStartup() { |
315 #if BUILDFLAG(ENABLE_EXTENSIONS) | 314 #if BUILDFLAG(ENABLE_EXTENSIONS) |
316 extensions::ExtensionsHandler::PreSandboxStartup(); | 315 extensions::ExtensionsHandler::PreSandboxStartup(); |
317 #endif | 316 #endif |
318 } | 317 } |
OLD | NEW |