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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/metrics/statistics_recorder.h" | 12 #include "base/metrics/statistics_recorder.h" |
13 #include "base/metrics/stats_counters.h" | 13 #include "base/metrics/stats_counters.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process/memory.h" | 15 #include "base/process/memory.h" |
16 #include "base/process/process_handle.h" | 16 #include "base/process/process_handle.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/chrome_content_browser_client.h" | 18 #include "chrome/browser/chrome_content_browser_client.h" |
19 #include "chrome/browser/defaults.h" | 19 #include "chrome/browser/defaults.h" |
20 #include "chrome/common/chrome_constants.h" | 20 #include "chrome/common/chrome_constants.h" |
21 #include "chrome/common/chrome_content_client.h" | 21 #include "chrome/common/chrome_content_client.h" |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/chrome_version_info.h" | 24 #include "chrome/common/chrome_version_info.h" |
25 #include "chrome/common/crash_keys.h" | 25 #include "chrome/common/crash_keys.h" |
26 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
27 #include "chrome/common/profiling.h" | 27 #include "chrome/common/profiling.h" |
28 #include "chrome/common/switch_utils.h" | |
28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
29 #include "chrome/plugin/chrome_content_plugin_client.h" | 30 #include "chrome/plugin/chrome_content_plugin_client.h" |
30 #include "chrome/renderer/chrome_content_renderer_client.h" | 31 #include "chrome/renderer/chrome_content_renderer_client.h" |
31 #include "chrome/utility/chrome_content_utility_client.h" | 32 #include "chrome/utility/chrome_content_utility_client.h" |
32 #include "components/nacl/common/nacl_switches.h" | 33 #include "components/nacl/common/nacl_switches.h" |
33 #include "components/startup_metric_utils/startup_metric_utils.h" | 34 #include "components/startup_metric_utils/startup_metric_utils.h" |
34 #include "content/public/common/content_client.h" | 35 #include "content/public/common/content_client.h" |
35 #include "content/public/common/content_paths.h" | 36 #include "content/public/common/content_paths.h" |
36 #include "ui/base/ui_base_switches.h" | 37 #include "ui/base/ui_base_switches.h" |
37 | 38 |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
571 chrome::GetVersionedDirectory(). | 572 chrome::GetVersionedDirectory(). |
572 Append(chrome::kHelperProcessExecutablePath)); | 573 Append(chrome::kHelperProcessExecutablePath)); |
573 | 574 |
574 InitMacCrashReporter(command_line, process_type); | 575 InitMacCrashReporter(command_line, process_type); |
575 #endif | 576 #endif |
576 | 577 |
577 #if defined(OS_WIN) | 578 #if defined(OS_WIN) |
578 child_process_logging::Init(); | 579 child_process_logging::Init(); |
579 #endif | 580 #endif |
580 | 581 |
582 // Initialize chrome::DIR_USER_DATA early on for service processes, etc. | |
583 switches::InitializeUserDataDir(); | |
Vitaly Buka (NO REVIEWS)
2014/02/21 23:11:33
Maybe note about logging too?
msw
2014/02/21 23:38:30
Done.
| |
584 | |
581 stats_counter_timer_.reset(new base::StatsCounterTimer("Chrome.Init")); | 585 stats_counter_timer_.reset(new base::StatsCounterTimer("Chrome.Init")); |
582 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> | 586 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> |
583 (*stats_counter_timer_)); | 587 (*stats_counter_timer_)); |
584 | 588 |
585 // Enable the heap profiler as early as possible! | 589 // Enable the heap profiler as early as possible! |
586 EnableHeapProfiler(command_line); | 590 EnableHeapProfiler(command_line); |
587 | 591 |
588 // Enable Message Loop related state asap. | 592 // Enable Message Loop related state asap. |
589 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) | 593 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) |
590 base::MessageLoop::EnableHistogrammer(true); | 594 base::MessageLoop::EnableHistogrammer(true); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
827 } | 831 } |
828 | 832 |
829 content::ContentUtilityClient* | 833 content::ContentUtilityClient* |
830 ChromeMainDelegate::CreateContentUtilityClient() { | 834 ChromeMainDelegate::CreateContentUtilityClient() { |
831 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 835 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
832 return NULL; | 836 return NULL; |
833 #else | 837 #else |
834 return g_chrome_content_utility_client.Pointer(); | 838 return g_chrome_content_utility_client.Pointer(); |
835 #endif | 839 #endif |
836 } | 840 } |
OLD | NEW |