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

Side by Side Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2759283002: Make payment manifest download/parse cross-platform (Closed)
Patch Set: Address comments Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/utility/DEPS ('k') | components/BUILD.gn » ('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 (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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // interfaces to the interface registry. 279 // interfaces to the interface registry.
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 #endif
291 registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create)); 290 registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create));
292 #endif
293 registry->AddInterface( 291 registry->AddInterface(
294 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); 292 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create));
295 #if defined(OS_WIN) 293 #if defined(OS_WIN)
296 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); 294 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create));
297 #endif 295 #endif
298 #if defined(OS_CHROMEOS) 296 #if defined(OS_CHROMEOS)
299 registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create)); 297 registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create));
300 #endif 298 #endif
301 #if defined(FULL_SAFE_BROWSING) 299 #if defined(FULL_SAFE_BROWSING)
302 registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create)); 300 registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create));
303 #endif 301 #endif
304 } 302 }
305 303
306 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { 304 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) {
307 content::ServiceInfo image_decoder_info; 305 content::ServiceInfo image_decoder_info;
308 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); 306 image_decoder_info.factory = base::Bind(&CreateImageDecoderService);
309 services->insert( 307 services->insert(
310 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); 308 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info));
311 } 309 }
312 310
313 // static 311 // static
314 void ChromeContentUtilityClient::PreSandboxStartup() { 312 void ChromeContentUtilityClient::PreSandboxStartup() {
315 #if BUILDFLAG(ENABLE_EXTENSIONS) 313 #if BUILDFLAG(ENABLE_EXTENSIONS)
316 extensions::ExtensionsHandler::PreSandboxStartup(); 314 extensions::ExtensionsHandler::PreSandboxStartup();
317 #endif 315 #endif
318 } 316 }
OLDNEW
« no previous file with comments | « chrome/utility/DEPS ('k') | components/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698