| 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 "base/system_monitor.h" |
| 11 #include "chrome/common/chrome_constants.h" | 11 #include "chrome/common/chrome_constants.h" |
| 12 #include "chrome/common/chrome_counters.h" | 12 #include "chrome/common/chrome_counters.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/l10n_util.h" | 14 #include "chrome/common/l10n_util.h" |
| 15 #include "chrome/common/logging_chrome.h" | 15 #include "chrome/common/logging_chrome.h" |
| 16 #include "chrome/common/main_function_params.h" |
| 16 #include "chrome/common/resource_bundle.h" | 17 #include "chrome/common/resource_bundle.h" |
| 17 #include "chrome/renderer/render_process.h" | 18 #include "chrome/renderer/render_process.h" |
| 18 #include "chrome/test/injection_test_dll.h" | 19 #include "chrome/test/injection_test_dll.h" |
| 19 #include "sandbox/src/sandbox.h" | 20 #include "sandbox/src/sandbox.h" |
| 20 | 21 |
| 21 #include "chromium_strings.h" | 22 #include "chromium_strings.h" |
| 22 #include "generated_resources.h" | 23 #include "generated_resources.h" |
| 23 | 24 |
| 24 // This function provides some ways to test crash and assertion handling | 25 // This function provides some ways to test crash and assertion handling |
| 25 // behavior of the renderer. | 26 // behavior of the renderer. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 37 | 38 |
| 38 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { | 39 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { |
| 39 std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); | 40 std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); |
| 40 title += L" renderer"; // makes attaching to process easier | 41 title += L" renderer"; // makes attaching to process easier |
| 41 MessageBox(NULL, L"renderer starting...", title.c_str(), | 42 MessageBox(NULL, L"renderer starting...", title.c_str(), |
| 42 MB_OK | MB_SETFOREGROUND); | 43 MB_OK | MB_SETFOREGROUND); |
| 43 } | 44 } |
| 44 } | 45 } |
| 45 | 46 |
| 46 // mainline routine for running as the Rendererer process | 47 // mainline routine for running as the Rendererer process |
| 47 int RendererMain(CommandLine &parsed_command_line, | 48 int RendererMain(const MainFunctionParams& parameters) { |
| 48 sandbox::TargetServices* target_services) { | 49 CommandLine& parsed_command_line = parameters.command_line_; |
| 50 sandbox::TargetServices* target_services = |
| 51 parameters.sandbox_info_.TargetServices(); |
| 52 |
| 49 StatsScope<StatsCounterTimer> | 53 StatsScope<StatsCounterTimer> |
| 50 startup_timer(chrome::Counters::renderer_main()); | 54 startup_timer(chrome::Counters::renderer_main()); |
| 51 | 55 |
| 52 // The main thread of the renderer services IO. | 56 // The main thread of the renderer services IO. |
| 53 MessageLoopForIO main_message_loop; | 57 MessageLoopForIO main_message_loop; |
| 54 std::wstring app_name = chrome::kBrowserAppName; | 58 std::wstring app_name = chrome::kBrowserAppName; |
| 55 PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); | 59 PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); |
| 56 | 60 |
| 57 // Initialize the SystemMonitor | 61 // Initialize the SystemMonitor |
| 58 base::SystemMonitor::Start(); | 62 base::SystemMonitor::Start(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 MessageLoop::current()->Run(); | 116 MessageLoop::current()->Run(); |
| 113 } | 117 } |
| 114 | 118 |
| 115 RenderProcess::GlobalCleanup(); | 119 RenderProcess::GlobalCleanup(); |
| 116 } | 120 } |
| 117 | 121 |
| 118 CoUninitialize(); | 122 CoUninitialize(); |
| 119 return 0; | 123 return 0; |
| 120 } | 124 } |
| 121 | 125 |
| OLD | NEW |