summaryrefslogtreecommitdiffstats
path: root/chrome/nacl/nacl_main.cc
diff options
context:
space:
mode:
authorgregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 00:29:54 +0000
committergregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 00:29:54 +0000
commit0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb (patch)
tree7e0c2f17e82dd477294d26a51051bee13c4dc5bb /chrome/nacl/nacl_main.cc
parent732a0f086db4bfdfd29749c3a500af0405934b6f (diff)
downloadchromium_src-0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb.zip
chromium_src-0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb.tar.gz
chromium_src-0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb.tar.bz2
Revert 37578 - Implement the broker process that launches NaCl loader processes on 64bit Windows systems.
BUG=28176 TEST=none Review URL: http://codereview.chromium.org/542030 TBR=gregoryd@google.com git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl/nacl_main.cc')
-rw-r--r--chrome/nacl/nacl_main.cc67
1 files changed, 2 insertions, 65 deletions
diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc
index ffda8ab..72bc8a2 100644
--- a/chrome/nacl/nacl_main.cc
+++ b/chrome/nacl/nacl_main.cc
@@ -20,66 +20,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/main_function_params.h"
-#include "chrome/common/result_codes.h"
-#if defined(OS_WIN)
-#include "chrome/nacl/broker_thread.h"
-#endif
#include "chrome/nacl/nacl_thread.h"
-#ifdef _WIN64
-
-sandbox::BrokerServices* g_broker_services = NULL;
-
-// main() routine for the NaCl broker process.
-// This is necessary for supporting NaCl in Chrome on Win64.
-int NaClBrokerMain(const MainFunctionParams& parameters) {
- // The main thread of the broker.
- MessageLoopForIO main_message_loop;
- std::wstring app_name = chrome::kNaClAppName;
- PlatformThread::SetName(WideToASCII(app_name + L"_NaClBrokerMain").c_str());
-
- SystemMonitor system_monitor;
- HighResolutionTimerManager hi_res_timer_manager;
-
- const CommandLine& parsed_command_line = parameters.command_line_;
-
- DLOG(INFO) << "Started NaCL broker with " <<
- parsed_command_line.command_line_string();
-
- // NOTE: this code is duplicated from browser_main.cc
- // IMPORTANT: This piece of code needs to run as early as possible in the
- // process because it will initialize the sandbox broker, which requires the
- // process to swap its window station. During this time all the UI will be
- // broken. This has to run before threads and windows are created.
- sandbox::BrokerServices* broker_services =
- parameters.sandbox_info_.BrokerServices();
- if (broker_services) {
- g_broker_services = broker_services;
- if (!parsed_command_line.HasSwitch(switches::kNoSandbox)) {
- bool use_winsta = !parsed_command_line.HasSwitch(
- switches::kDisableAltWinstation);
- // Precreate the desktop and window station used by the renderers.
- sandbox::TargetPolicy* policy = broker_services->CreatePolicy();
- sandbox::ResultCode result = policy->CreateAlternateDesktop(use_winsta);
- CHECK(sandbox::SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION != result);
- policy->Release();
- }
- }
-
- {
- ChildProcess broker_process;
- broker_process.set_main_thread(new NaClBrokerThread());
- MessageLoop::current()->Run();
- }
-
- return 0;
-}
-#else
-int NaClBrokerMain(const MainFunctionParams& parameters) {
- return ResultCodes::BAD_PROCESS_TYPE;
-}
-#endif // _WIN64
-
// This function provides some ways to test crash and assertion handling
// behavior of the renderer.
static void HandleNaClTestParameters(const CommandLine& command_line) {
@@ -106,7 +48,7 @@ static void LaunchNaClChildProcess() {
}
#endif
-// main() routine for the NaCl loader process.
+// main() routine for running as the sel_ldr process.
int NaClMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
@@ -118,12 +60,7 @@ int NaClMain(const MainFunctionParams& parameters) {
// The main thread of the plugin services IO.
MessageLoopForIO main_message_loop;
- // NaCl code runs in a different binary on Win64.
-#ifdef _WIN64
- std::wstring app_name = chrome::kNaClAppName;
-#else
std::wstring app_name = chrome::kBrowserAppName;
-#endif
PlatformThread::SetName(WideToASCII(app_name + L"_NaClMain").c_str());
SystemMonitor system_monitor;
@@ -133,7 +70,7 @@ int NaClMain(const MainFunctionParams& parameters) {
sandbox::TargetServices* target_services =
parameters.sandbox_info_.TargetServices();
- DLOG(INFO) << "Started NaCl loader with " <<
+ DLOG(INFO) << "Started plugin with " <<
parsed_command_line.command_line_string();
HMODULE sandbox_test_module = NULL;