Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1032)

Unified Diff: chrome/nacl/nacl_main.cc

Issue 14238013: Set up NaClChromeMainArgs number_of_cores member so apps can size threadpools appropriately (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added corresponding MAYBE_ defns Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/nacl/nacl_listener.cc ('k') | chrome/test/data/nacl/nacl_test_data.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_main.cc
diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc
index 9b7a8c6b95dbf227b37a6a02799a97dcf7075d8e..aebb724917492c45f70dd6bd48a5abc62f8aaeae 100644
--- a/chrome/nacl/nacl_main.cc
+++ b/chrome/nacl/nacl_main.cc
@@ -33,6 +33,10 @@ int NaClMain(const content::MainFunctionParams& parameters) {
bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
platform.InitSandboxTests(no_sandbox);
+#if defined(OS_POSIX)
+ int number_of_cores = sysconf(_SC_NPROCESSORS_ONLN);
Nick Bray (chromium) 2013/04/18 00:24:18 Why not inline? The skew between the preprocessor
bsy 2013/04/18 03:25:06 unskewed. added comment explaining that this has
+#endif
+
if (!no_sandbox) {
platform.EnableSandbox();
}
@@ -40,6 +44,9 @@ int NaClMain(const content::MainFunctionParams& parameters) {
if (sandbox_test_result) {
NaClListener listener;
+#if defined(OS_LINUX) || defined(OS_MACOSX)
+ listener.set_number_of_cores(number_of_cores);
+#endif
listener.Listen();
} else {
// This indirectly prevents the test-harness-success-cookie from being set,
« no previous file with comments | « chrome/nacl/nacl_listener.cc ('k') | chrome/test/data/nacl/nacl_test_data.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698