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