OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/system_monitor.h" |
10 #include "chrome/common/chrome_constants.h" | 11 #include "chrome/common/chrome_constants.h" |
11 #include "chrome/common/chrome_counters.h" | 12 #include "chrome/common/chrome_counters.h" |
12 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/l10n_util.h" | 14 #include "chrome/common/l10n_util.h" |
14 #include "chrome/common/logging_chrome.h" | 15 #include "chrome/common/logging_chrome.h" |
15 #include "chrome/common/resource_bundle.h" | 16 #include "chrome/common/resource_bundle.h" |
16 #include "chrome/renderer/render_process.h" | 17 #include "chrome/renderer/render_process.h" |
17 #include "chrome/test/injection_test_dll.h" | 18 #include "chrome/test/injection_test_dll.h" |
18 #include "sandbox/src/sandbox.h" | 19 #include "sandbox/src/sandbox.h" |
19 | 20 |
(...skipping 26 matching lines...) Expand all Loading... |
46 int RendererMain(CommandLine &parsed_command_line, | 47 int RendererMain(CommandLine &parsed_command_line, |
47 sandbox::TargetServices* target_services) { | 48 sandbox::TargetServices* target_services) { |
48 StatsScope<StatsCounterTimer> | 49 StatsScope<StatsCounterTimer> |
49 startup_timer(chrome::Counters::renderer_main()); | 50 startup_timer(chrome::Counters::renderer_main()); |
50 | 51 |
51 // The main thread of the renderer services IO. | 52 // The main thread of the renderer services IO. |
52 MessageLoopForIO main_message_loop; | 53 MessageLoopForIO main_message_loop; |
53 std::wstring app_name = chrome::kBrowserAppName; | 54 std::wstring app_name = chrome::kBrowserAppName; |
54 PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); | 55 PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); |
55 | 56 |
| 57 // Initialize the SystemMonitor |
| 58 base::SystemMonitor::Start(); |
| 59 |
56 CoInitialize(NULL); | 60 CoInitialize(NULL); |
57 | 61 |
58 DLOG(INFO) << "Started renderer with " << | 62 DLOG(INFO) << "Started renderer with " << |
59 parsed_command_line.command_line_string(); | 63 parsed_command_line.command_line_string(); |
60 | 64 |
61 HMODULE sandbox_test_module = NULL; | 65 HMODULE sandbox_test_module = NULL; |
62 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 66 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
63 if (target_services && !no_sandbox) { | 67 if (target_services && !no_sandbox) { |
64 // The command line might specify a test dll to load. | 68 // The command line might specify a test dll to load. |
65 if (parsed_command_line.HasSwitch(switches::kTestSandbox)) { | 69 if (parsed_command_line.HasSwitch(switches::kTestSandbox)) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 MessageLoop::current()->Run(); | 112 MessageLoop::current()->Run(); |
109 } | 113 } |
110 | 114 |
111 RenderProcess::GlobalCleanup(); | 115 RenderProcess::GlobalCleanup(); |
112 } | 116 } |
113 | 117 |
114 CoUninitialize(); | 118 CoUninitialize(); |
115 return 0; | 119 return 0; |
116 } | 120 } |
117 | 121 |
OLD | NEW |