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

Unified Diff: chrome/nacl/nacl_listener.h

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_helper_linux.cc ('k') | chrome/nacl/nacl_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_listener.h
diff --git a/chrome/nacl/nacl_listener.h b/chrome/nacl/nacl_listener.h
index 20e3e7837e3a58076a8b37d8d55006219a67de1f..66627c0f6a9f6bdd23609f7627844026f8073640 100644
--- a/chrome/nacl/nacl_listener.h
+++ b/chrome/nacl/nacl_listener.h
@@ -34,6 +34,11 @@ class NaClListener : public IPC::Listener {
prereserved_sandbox_size_ = prereserved_sandbox_size;
}
#endif
+#if defined(OS_POSIX)
+ void set_number_of_cores(int number_of_cores) {
+ number_of_cores_ = number_of_cores;
+ }
+#endif
private:
void OnStart(const nacl::NaClStartParams& params);
@@ -51,6 +56,16 @@ class NaClListener : public IPC::Listener {
#if defined(OS_LINUX)
size_t prereserved_sandbox_size_;
#endif
+#if defined(OS_POSIX)
+ /*
+ * The outer sandbox on Linux and OSX prevents
+ * sysconf(_SC_NPROCESSORS) from working; in Windows, there are no
+ * problems with invoking GetSystemInfo. Therefore, only in
+ * OS_POSIX do we need to supply the number of cores into
+ * NaClChromeMainArgs object.
+ */
+ int number_of_cores_;
+#endif
// Used to identify what thread we're on.
MessageLoop* main_loop_;
« no previous file with comments | « chrome/nacl/nacl_helper_linux.cc ('k') | chrome/nacl/nacl_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698