OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/power_monitor/power_monitor.h" | 9 #include "base/power_monitor/power_monitor.h" |
10 #include "base/power_monitor/power_monitor_device_source.h" | 10 #include "base/power_monitor/power_monitor_device_source.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 base::MessageLoopForIO main_message_loop; | 22 base::MessageLoopForIO main_message_loop; |
23 base::PlatformThread::SetName("CrNaClMain"); | 23 base::PlatformThread::SetName("CrNaClMain"); |
24 | 24 |
25 scoped_ptr<base::PowerMonitorSource> power_monitor_source( | 25 scoped_ptr<base::PowerMonitorSource> power_monitor_source( |
26 new base::PowerMonitorDeviceSource()); | 26 new base::PowerMonitorDeviceSource()); |
27 base::PowerMonitor power_monitor(power_monitor_source.Pass()); | 27 base::PowerMonitor power_monitor(power_monitor_source.Pass()); |
28 base::HighResolutionTimerManager hi_res_timer_manager; | 28 base::HighResolutionTimerManager hi_res_timer_manager; |
29 | 29 |
30 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ | 30 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ |
31 defined(OS_ANDROID) | 31 defined(OS_ANDROID) |
32 NaClMainPlatformDelegate platform(parameters); | 32 NaClMainPlatformDelegate platform; |
33 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 33 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
34 | 34 |
35 #if defined(OS_POSIX) | 35 #if defined(OS_POSIX) |
36 // The number of cores must be obtained before the invocation of | 36 // The number of cores must be obtained before the invocation of |
37 // platform.EnableSandbox(), so cannot simply be inlined below. | 37 // platform.EnableSandbox(), so cannot simply be inlined below. |
38 int number_of_cores = sysconf(_SC_NPROCESSORS_ONLN); | 38 int number_of_cores = sysconf(_SC_NPROCESSORS_ONLN); |
39 #endif | 39 #endif |
40 | 40 |
41 if (!no_sandbox) { | 41 if (!no_sandbox) { |
42 platform.EnableSandbox(); | 42 platform.EnableSandbox(parameters); |
43 } | 43 } |
44 NaClListener listener; | 44 NaClListener listener; |
45 #if defined(OS_POSIX) | 45 #if defined(OS_POSIX) |
46 listener.set_number_of_cores(number_of_cores); | 46 listener.set_number_of_cores(number_of_cores); |
47 #endif | 47 #endif |
48 | 48 |
49 listener.Listen(); | 49 listener.Listen(); |
50 #else | 50 #else |
51 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; | 51 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; |
52 #endif | 52 #endif |
53 return 0; | 53 return 0; |
54 } | 54 } |
OLD | NEW |