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

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: CR fb 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..a7c11247ba6a103b3928c90cc7abc5af05f937a1 100644
--- a/chrome/nacl/nacl_main.cc
+++ b/chrome/nacl/nacl_main.cc
@@ -33,6 +33,12 @@ int NaClMain(const content::MainFunctionParams& parameters) {
bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
platform.InitSandboxTests(no_sandbox);
+#if defined(OS_POSIX)
+ // The number of cores must be obtained before the invocation of
+ // platform.EnableSandbox(), so cannot simply be inlined below.
+ int number_of_cores = sysconf(_SC_NPROCESSORS_ONLN);
+#endif
+
if (!no_sandbox) {
platform.EnableSandbox();
}
@@ -40,6 +46,9 @@ int NaClMain(const content::MainFunctionParams& parameters) {
if (sandbox_test_result) {
NaClListener listener;
+#if defined(OS_POSIX)
+ 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