| 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/system_monitor.h" | 7 #include "base/system_monitor.h" |
| 8 #include "chrome/common/chrome_constants.h" | 8 #include "chrome/common/chrome_constants.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/logging_chrome.h" | 10 #include "chrome/common/logging_chrome.h" |
| 11 #include "chrome/common/main_function_params.h" | 11 #include "chrome/common/main_function_params.h" |
| 12 #include "chrome/common/win_util.h" | 12 #include "chrome/common/win_util.h" |
| 13 #include "chrome/plugin/plugin_process.h" | 13 #include "chrome/plugin/plugin_process.h" |
| 14 #include "chrome/test/injection_test_dll.h" | 14 #include "chrome/test/injection_test_dll.h" |
| 15 #include "sandbox/src/sandbox.h" | 15 #include "sandbox/src/sandbox.h" |
| 16 | 16 |
| 17 // mainline routine for running as the plugin process | 17 // mainline routine for running as the plugin process |
| 18 int PluginMain(const MainFunctionParams& parameters) { | 18 int PluginMain(const MainFunctionParams& parameters) { |
| 19 CommandLine& parsed_command_line = parameters.command_line_; | 19 const CommandLine& parsed_command_line = parameters.command_line_; |
| 20 sandbox::TargetServices* target_services = | 20 sandbox::TargetServices* target_services = |
| 21 parameters.sandbox_info_.TargetServices(); | 21 parameters.sandbox_info_.TargetServices(); |
| 22 | 22 |
| 23 // The main thread of the plugin services IO. | 23 // The main thread of the plugin services IO. |
| 24 MessageLoopForIO main_message_loop; | 24 MessageLoopForIO main_message_loop; |
| 25 std::wstring app_name = chrome::kBrowserAppName; | 25 std::wstring app_name = chrome::kBrowserAppName; |
| 26 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str()); | 26 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str()); |
| 27 | 27 |
| 28 // Initialize the SystemMonitor | 28 // Initialize the SystemMonitor |
| 29 base::SystemMonitor::Start(); | 29 base::SystemMonitor::Start(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Load the accelerator table from the browser executable and tell the | 81 // Load the accelerator table from the browser executable and tell the |
| 82 // message loop to use it when translating messages. | 82 // message loop to use it when translating messages. |
| 83 MessageLoop::current()->Run(); | 83 MessageLoop::current()->Run(); |
| 84 } | 84 } |
| 85 PluginProcess::GlobalCleanup(); | 85 PluginProcess::GlobalCleanup(); |
| 86 | 86 |
| 87 CoUninitialize(); | 87 CoUninitialize(); |
| 88 return 0; | 88 return 0; |
| 89 } | 89 } |
| 90 | 90 |
| OLD | NEW |