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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 #else // !OS_WIN | 464 #else // !OS_WIN |
465 | 465 |
466 #if defined(OS_ANDROID) | 466 #if defined(OS_ANDROID) |
467 // See note at the initialization of ExitManager, below; basically, | 467 // See note at the initialization of ExitManager, below; basically, |
468 // only Android builds have the ctor/dtor handlers set up to use | 468 // only Android builds have the ctor/dtor handlers set up to use |
469 // TRACE_EVENT right away. | 469 // TRACE_EVENT right away. |
470 TRACE_EVENT0("startup,benchmark,rail", "ContentMainRunnerImpl::Initialize"); | 470 TRACE_EVENT0("startup,benchmark,rail", "ContentMainRunnerImpl::Initialize"); |
471 #endif // OS_ANDROID | 471 #endif // OS_ANDROID |
472 | 472 |
473 base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance(); | 473 base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance(); |
474 ALLOW_UNUSED_LOCAL(g_fds); | |
jungshik at Google
2016/08/19 23:10:48
I wonder if it'd be better to enclose |base::Glo..
Eden Wang
2016/08/20 00:41:42
I think it would be a very long statement to enclo
jungshik at Google
2016/08/22 20:02:00
I don't think you need that long condition. The sh
| |
474 | 475 |
475 // On Android, | 476 // On Android, |
476 // - setlocale() is not supported. | 477 // - setlocale() is not supported. |
477 // - We do not override the signal handlers so that we can get | 478 // - We do not override the signal handlers so that we can get |
478 // stack trace when crashing. | 479 // stack trace when crashing. |
479 // - The ipc_fd is passed through the Java service. | 480 // - The ipc_fd is passed through the Java service. |
480 // Thus, these are all disabled. | 481 // Thus, these are all disabled. |
481 #if !defined(OS_ANDROID) | 482 #if !defined(OS_ANDROID) |
482 // Set C library locale to make sure CommandLine can parse argument values | 483 // Set C library locale to make sure CommandLine can parse argument values |
483 // in correct encoding. | 484 // in correct encoding. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 #endif | 672 #endif |
672 | 673 |
673 #if defined(USE_NSS_CERTS) | 674 #if defined(USE_NSS_CERTS) |
674 crypto::EarlySetupForNSSInit(); | 675 crypto::EarlySetupForNSSInit(); |
675 #endif | 676 #endif |
676 | 677 |
677 ui::RegisterPathProvider(); | 678 ui::RegisterPathProvider(); |
678 RegisterPathProvider(); | 679 RegisterPathProvider(); |
679 RegisterContentSchemes(true); | 680 RegisterContentSchemes(true); |
680 | 681 |
681 #if defined(OS_ANDROID) | 682 #if defined(OS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) |
682 int icudata_fd = g_fds->MaybeGet(kAndroidICUDataDescriptor); | 683 int icudata_fd = g_fds->MaybeGet(kAndroidICUDataDescriptor); |
683 if (icudata_fd != -1) { | 684 if (icudata_fd != -1) { |
684 auto icudata_region = g_fds->GetRegion(kAndroidICUDataDescriptor); | 685 auto icudata_region = g_fds->GetRegion(kAndroidICUDataDescriptor); |
685 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd, | 686 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd, |
686 icudata_region)); | 687 icudata_region)); |
687 } else { | 688 } else { |
688 CHECK(base::i18n::InitializeICU()); | 689 CHECK(base::i18n::InitializeICU()); |
689 } | 690 } |
690 #else | 691 #else |
691 CHECK(base::i18n::InitializeICU()); | 692 CHECK(base::i18n::InitializeICU()); |
692 #endif // OS_ANDROID | 693 #endif // OS_ANDROID && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) |
693 | 694 |
694 base::StatisticsRecorder::Initialize(); | 695 base::StatisticsRecorder::Initialize(); |
695 | 696 |
696 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 697 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
697 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 698 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
698 #if !defined(OS_ANDROID) | 699 #if !defined(OS_ANDROID) |
699 // kV8NativesDataDescriptor and kV8SnapshotDataDescriptor could be shared | 700 // kV8NativesDataDescriptor and kV8SnapshotDataDescriptor could be shared |
700 // with child processes via file descriptors. On Android they are set in | 701 // with child processes via file descriptors. On Android they are set in |
701 // ChildProcessService::InternalInitChildProcess, otherwise set them here. | 702 // ChildProcessService::InternalInitChildProcess, otherwise set them here. |
702 if (command_line.HasSwitch(switches::kV8NativesPassedByFD)) { | 703 if (command_line.HasSwitch(switches::kV8NativesPassedByFD)) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
841 | 842 |
842 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 843 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
843 }; | 844 }; |
844 | 845 |
845 // static | 846 // static |
846 ContentMainRunner* ContentMainRunner::Create() { | 847 ContentMainRunner* ContentMainRunner::Create() { |
847 return new ContentMainRunnerImpl(); | 848 return new ContentMainRunnerImpl(); |
848 } | 849 } |
849 | 850 |
850 } // namespace content | 851 } // namespace content |
OLD | NEW |