Chromium Code Reviews| 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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
| 80 #include "base/sys_info.h" | 80 #include "base/sys_info.h" |
| 81 #include "chrome/browser/chromeos/boot_times_loader.h" | 81 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 82 #include "chromeos/chromeos_paths.h" | 82 #include "chromeos/chromeos_paths.h" |
| 83 #include "chromeos/chromeos_switches.h" | 83 #include "chromeos/chromeos_switches.h" |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 #if defined(OS_ANDROID) | 86 #if defined(OS_ANDROID) |
| 87 #include "base/i18n/icu_util.h" | |
| 87 #include "chrome/common/descriptors_android.h" | 88 #include "chrome/common/descriptors_android.h" |
| 88 #else | 89 #else |
| 89 // Diagnostics is only available on non-android platforms. | 90 // Diagnostics is only available on non-android platforms. |
| 90 #include "chrome/browser/diagnostics/diagnostics_controller.h" | 91 #include "chrome/browser/diagnostics/diagnostics_controller.h" |
| 91 #include "chrome/browser/diagnostics/diagnostics_writer.h" | 92 #include "chrome/browser/diagnostics/diagnostics_writer.h" |
| 92 #endif | 93 #endif |
| 93 | 94 |
| 94 #if defined(USE_X11) | 95 #if defined(USE_X11) |
| 95 #include <stdlib.h> | 96 #include <stdlib.h> |
| 96 #include <string.h> | 97 #include <string.h> |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 | 660 |
| 660 #if defined(OS_WIN) | 661 #if defined(OS_WIN) |
| 661 child_process_logging::Init(); | 662 child_process_logging::Init(); |
| 662 #endif | 663 #endif |
| 663 #if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX)) | 664 #if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX)) |
| 664 // Create an instance of the CPU class to parse /proc/cpuinfo and cache | 665 // Create an instance of the CPU class to parse /proc/cpuinfo and cache |
| 665 // cpu_brand info. | 666 // cpu_brand info. |
| 666 base::CPU cpu_info; | 667 base::CPU cpu_info; |
| 667 #endif | 668 #endif |
| 668 | 669 |
| 670 #if defined(OS_ANDROID) | |
| 671 if (process_type.empty()) { | |
| 672 // Browser process loads ICU data using file names. | |
| 673 CHECK(base::i18n::InitializeICU()); | |
| 674 } else { | |
| 675 // Render processes load ICU data using file descriptor. | |
| 676 int icu_data_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( | |
| 677 kAndroidICUDataDescriptor); | |
| 678 CHECK(icu_data_fd != -1); | |
| 679 CHECK(base::i18n::InitializeICU(icu_data_fd)); | |
| 680 } | |
| 681 #endif | |
|
jungshik at Google
2014/06/05 23:40:38
What about other implementations of content_main_d
Feng Qian
2014/06/06 17:40:31
I can move logic into content_main_runner.cc.
On
| |
| 682 | |
| 683 | |
| 669 // Initialize the user data dir for any process type that needs it. | 684 // Initialize the user data dir for any process type that needs it. |
| 670 if (chrome::ProcessNeedsProfileDir(process_type)) | 685 if (chrome::ProcessNeedsProfileDir(process_type)) |
| 671 InitializeUserDataDir(); | 686 InitializeUserDataDir(); |
| 672 | 687 |
| 673 stats_counter_timer_.reset(new base::StatsCounterTimer("Chrome.Init")); | 688 stats_counter_timer_.reset(new base::StatsCounterTimer("Chrome.Init")); |
| 674 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> | 689 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> |
| 675 (*stats_counter_timer_)); | 690 (*stats_counter_timer_)); |
| 676 | 691 |
| 677 // Enable the heap profiler as early as possible! | 692 // Enable the heap profiler as early as possible! |
| 678 EnableHeapProfiler(command_line); | 693 EnableHeapProfiler(command_line); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 920 } | 935 } |
| 921 | 936 |
| 922 content::ContentUtilityClient* | 937 content::ContentUtilityClient* |
| 923 ChromeMainDelegate::CreateContentUtilityClient() { | 938 ChromeMainDelegate::CreateContentUtilityClient() { |
| 924 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 939 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 925 return NULL; | 940 return NULL; |
| 926 #else | 941 #else |
| 927 return g_chrome_content_utility_client.Pointer(); | 942 return g_chrome_content_utility_client.Pointer(); |
| 928 #endif | 943 #endif |
| 929 } | 944 } |
| OLD | NEW |