OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/app/chrome_main.h" |
6 | 6 |
7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
11 #include "base/i18n/icu_util.h" | 11 #include "base/i18n/icu_util.h" |
12 #include "base/mac/scoped_nsautorelease_pool.h" | 12 #include "base/mac/scoped_nsautorelease_pool.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
15 #include "base/metrics/stats_table.h" | 15 #include "base/metrics/stats_table.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "crypto/nss_util.h" | 22 #include "crypto/nss_util.h" |
23 #include "chrome/browser/defaults.h" | 23 #include "chrome/browser/defaults.h" |
24 #include "chrome/browser/diagnostics/diagnostics_main.h" | 24 #include "chrome/browser/diagnostics/diagnostics_main.h" |
25 #include "chrome/browser/platform_util.h" | 25 #include "chrome/browser/platform_util.h" |
26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_content_client.h" | 27 #include "chrome/common/chrome_content_client.h" |
28 #include "chrome/common/chrome_content_plugin_client.h" | 28 #include "chrome/common/chrome_content_plugin_client.h" |
29 #include "chrome/common/chrome_counters.h" | |
30 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/chrome_paths_internal.h" | 30 #include "chrome/common/chrome_paths_internal.h" |
32 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/chrome_version_info.h" | 32 #include "chrome/common/chrome_version_info.h" |
34 #include "chrome/common/logging_chrome.h" | 33 #include "chrome/common/logging_chrome.h" |
35 #include "chrome/common/profiling.h" | 34 #include "chrome/common/profiling.h" |
36 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
37 #include "chrome/renderer/chrome_content_renderer_client.h" | 36 #include "chrome/renderer/chrome_content_renderer_client.h" |
38 #include "content/browser/renderer_host/render_process_host.h" | 37 #include "content/browser/renderer_host/render_process_host.h" |
39 #include "content/common/content_client.h" | 38 #include "content/common/content_client.h" |
| 39 #include "content/common/content_counters.h" |
40 #include "content/common/content_paths.h" | 40 #include "content/common/content_paths.h" |
41 #include "content/common/main_function_params.h" | 41 #include "content/common/main_function_params.h" |
42 #include "content/common/sandbox_init_wrapper.h" | 42 #include "content/common/sandbox_init_wrapper.h" |
43 #include "content/common/set_process_title.h" | 43 #include "content/common/set_process_title.h" |
44 #include "ipc/ipc_switches.h" | 44 #include "ipc/ipc_switches.h" |
45 #include "ui/base/resource/resource_bundle.h" | 45 #include "ui/base/resource/resource_bundle.h" |
46 #include "ui/base/ui_base_paths.h" | 46 #include "ui/base/ui_base_paths.h" |
47 #include "ui/base/ui_base_switches.h" | 47 #include "ui/base/ui_base_switches.h" |
48 | 48 |
49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 << "Main application forbids --type, saw \"" << process_type << "\"."; | 678 << "Main application forbids --type, saw \"" << process_type << "\"."; |
679 } | 679 } |
680 | 680 |
681 if (IsCrashReporterEnabled()) | 681 if (IsCrashReporterEnabled()) |
682 InitCrashProcessInfo(); | 682 InitCrashProcessInfo(); |
683 #endif // defined(OS_MACOSX) | 683 #endif // defined(OS_MACOSX) |
684 | 684 |
685 InitializeStatsTable(browser_pid, command_line); | 685 InitializeStatsTable(browser_pid, command_line); |
686 | 686 |
687 base::StatsScope<base::StatsCounterTimer> | 687 base::StatsScope<base::StatsCounterTimer> |
688 startup_timer(chrome::Counters::chrome_main()); | 688 startup_timer(content::Counters::chrome_main()); |
689 | 689 |
690 // Enable the heap profiler as early as possible! | 690 // Enable the heap profiler as early as possible! |
691 EnableHeapProfiler(command_line); | 691 EnableHeapProfiler(command_line); |
692 | 692 |
693 // Enable Message Loop related state asap. | 693 // Enable Message Loop related state asap. |
694 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) | 694 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) |
695 MessageLoop::EnableHistogrammer(true); | 695 MessageLoop::EnableHistogrammer(true); |
696 | 696 |
697 // Single-process is an unsupported and not fully tested mode, so | 697 // Single-process is an unsupported and not fully tested mode, so |
698 // don't enable it for official Chrome builds. | 698 // don't enable it for official Chrome builds. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 | 814 |
815 if (SubprocessNeedsResourceBundle(process_type)) | 815 if (SubprocessNeedsResourceBundle(process_type)) |
816 ResourceBundle::CleanupSharedInstance(); | 816 ResourceBundle::CleanupSharedInstance(); |
817 | 817 |
818 logging::CleanupChromeLogging(); | 818 logging::CleanupChromeLogging(); |
819 | 819 |
820 chrome_main::LowLevelShutdown(); | 820 chrome_main::LowLevelShutdown(); |
821 | 821 |
822 return exit_code; | 822 return exit_code; |
823 } | 823 } |
OLD | NEW |