OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/command_line.h" |
| 6 #include "base/message_loop.h" |
| 7 #include "base/string_util.h" |
| 8 #include "base/system_monitor.h" |
| 9 #include "chrome/common/chrome_constants.h" |
| 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "chrome/common/logging_chrome.h" |
| 12 #include "chrome/common/main_function_params.h" |
| 13 #include "chrome/common/win_util.h" |
| 14 #include "chrome/worker/worker_process.h" |
| 15 #include "sandbox/src/sandbox.h" |
| 16 |
| 17 // Mainline routine for running as the worker process. |
| 18 int WorkerMain(const MainFunctionParams& parameters) { |
| 19 const CommandLine& parsed_command_line = parameters.command_line_; |
| 20 |
| 21 // The main thread of the render process. |
| 22 MessageLoopForIO main_message_loop; |
| 23 std::wstring app_name = chrome::kBrowserAppName; |
| 24 PlatformThread::SetName(WideToASCII(app_name + L"_WorkerMain").c_str()); |
| 25 |
| 26 // Initialize the SystemMonitor |
| 27 base::SystemMonitor::Start(); |
| 28 |
| 29 // TODO(jabdelmalek): refactor sandboxing code from renderer so that the |
| 30 // workers are sandboxed. |
| 31 |
| 32 WorkerProcess worker_process; |
| 33 |
| 34 // Load the accelerator table from the browser executable and tell the |
| 35 // message loop to use it when translating messages. |
| 36 MessageLoop::current()->Run(); |
| 37 |
| 38 return 0; |
| 39 } |
OLD | NEW |