summaryrefslogtreecommitdiffstats
path: root/chrome/nacl
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 16:54:38 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 16:54:38 +0000
commit43c7bc30cba6878344087ae8580f4ce9d4fe0af9 (patch)
tree30aa669e4d6312122cb98527317f58614d89c629 /chrome/nacl
parent28edb97961df144166fb9eab2fb6a61f85b43708 (diff)
downloadchromium_src-43c7bc30cba6878344087ae8580f4ce9d4fe0af9.zip
chromium_src-43c7bc30cba6878344087ae8580f4ce9d4fe0af9.tar.gz
chromium_src-43c7bc30cba6878344087ae8580f4ce9d4fe0af9.tar.bz2
Revert 37254 - Make NaCl run in Chrome on the Mac.
NOTE: This uses some assembly that is NOT SECURE. This CL is for development ONLY. BUG=none TEST=none Review URL: http://codereview.chromium.org/555082 TBR=dspringer@google.com Review URL: http://codereview.chromium.org/548163 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r--chrome/nacl/nacl_main.cc53
1 files changed, 14 insertions, 39 deletions
diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc
index 255b2ce..5271cf4 100644
--- a/chrome/nacl/nacl_main.cc
+++ b/chrome/nacl/nacl_main.cc
@@ -22,42 +22,8 @@
#include "chrome/common/main_function_params.h"
#include "chrome/nacl/nacl_thread.h"
-// This function provides some ways to test crash and assertion handling
-// behavior of the renderer.
-static void HandleNaClTestParameters(const CommandLine& command_line) {
- if (command_line.HasSwitch(switches::kNaClStartupDialog)) {
- ChildProcess::WaitForDebugger(L"NativeClient");
- }
-}
-
-// Launch the NaCl child process in its own thread.
-#if defined (OS_WIN)
-static void LaunchNaClChildProcess(bool no_sandbox,
- sandbox::TargetServices* target_services) {
- ChildProcess nacl_process;
- nacl_process.set_main_thread(new NaClThread());
- if (!no_sandbox && target_services)
- target_services->LowerToken();
- MessageLoop::current()->Run();
-}
-#else
-static void LaunchNaClChildProcess() {
- ChildProcess nacl_process;
- nacl_process.set_main_thread(new NaClThread());
- MessageLoop::current()->Run();
-}
-#endif
-
// main() routine for running as the sel_ldr process.
int NaClMain(const MainFunctionParams& parameters) {
- const CommandLine& parsed_command_line = parameters.command_line_;
-
- // This function allows pausing execution using the --nacl-startup-dialog
- // flag allowing us to attach a debugger.
- // Do not move this function down since that would mean we can't easily debug
- // whatever occurs before it.
- HandleNaClTestParameters(parsed_command_line);
-
// The main thread of the plugin services IO.
MessageLoopForIO main_message_loop;
std::wstring app_name = chrome::kBrowserAppName;
@@ -67,6 +33,8 @@ int NaClMain(const MainFunctionParams& parameters) {
HighResolutionTimerManager hi_res_timer_manager;
#if defined(OS_WIN)
+ const CommandLine& parsed_command_line = parameters.command_line_;
+
sandbox::TargetServices* target_services =
parameters.sandbox_info_.TargetServices();
@@ -84,15 +52,22 @@ int NaClMain(const MainFunctionParams& parameters) {
DCHECK(sandbox_test_module);
}
}
- LaunchNaClChildProcess(no_sandbox, target_services);
-
-#elif defined(OS_MACOSX)
- LaunchNaClChildProcess();
#else
- NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc.";
+ NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc.";
#endif
+ {
+ ChildProcess nacl_process;
+ nacl_process.set_main_thread(new NaClThread());
+#if defined(OS_WIN)
+ if (!no_sandbox && target_services)
+ target_services->LowerToken();
+#endif
+
+ MessageLoop::current()->Run();
+ }
+
return 0;
}