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

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: 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
Index: chrome/nacl/nacl_main.cc
diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc
index 9b7a8c6b95dbf227b37a6a02799a97dcf7075d8e..5361eb42ae9fdd3970991bf613cb00abc1e19116 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_LINUX) || defined(OS_MACOSX)
+ int number_of_cores = sysconf(_SC_NPROCESSORS_ONLN);
+#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);
jvoung (off chromium) 2013/04/16 18:37:38 Still looking through the CL, but why do you have
bsy 2013/04/17 15:05:37 Nope. One in ctor is superfluous and unnecessary,
+#endif
listener.Listen();
} else {
// This indirectly prevents the test-harness-success-cookie from being set,

Powered by Google App Engine
This is Rietveld 408576698