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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_NACL_NACL_LISTENER_H_ 5 #ifndef CHROME_NACL_NACL_LISTENER_H_
6 #define CHROME_NACL_NACL_LISTENER_H_ 6 #define CHROME_NACL_NACL_LISTENER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 16 matching lines...) Expand all
27 // Listen for a request to launch a NaCl module. 27 // Listen for a request to launch a NaCl module.
28 void Listen(); 28 void Listen();
29 29
30 bool Send(IPC::Message* msg); 30 bool Send(IPC::Message* msg);
31 31
32 #if defined(OS_LINUX) 32 #if defined(OS_LINUX)
33 void set_prereserved_sandbox_size(size_t prereserved_sandbox_size) { 33 void set_prereserved_sandbox_size(size_t prereserved_sandbox_size) {
34 prereserved_sandbox_size_ = prereserved_sandbox_size; 34 prereserved_sandbox_size_ = prereserved_sandbox_size;
35 } 35 }
36 #endif 36 #endif
37 #if defined(OS_POSIX)
38 void set_number_of_cores(int number_of_cores) {
39 number_of_cores_ = number_of_cores;
40 }
41 #endif
37 42
38 private: 43 private:
39 void OnStart(const nacl::NaClStartParams& params); 44 void OnStart(const nacl::NaClStartParams& params);
40 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 45 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
41 46
42 // A channel back to the browser. 47 // A channel back to the browser.
43 scoped_ptr<IPC::SyncChannel> channel_; 48 scoped_ptr<IPC::SyncChannel> channel_;
44 49
45 // A filter that allows other threads to use the channel. 50 // A filter that allows other threads to use the channel.
46 scoped_refptr<IPC::SyncMessageFilter> filter_; 51 scoped_refptr<IPC::SyncMessageFilter> filter_;
47 52
48 base::WaitableEvent shutdown_event_; 53 base::WaitableEvent shutdown_event_;
49 base::Thread io_thread_; 54 base::Thread io_thread_;
50 55
51 #if defined(OS_LINUX) 56 #if defined(OS_LINUX)
52 size_t prereserved_sandbox_size_; 57 size_t prereserved_sandbox_size_;
53 #endif 58 #endif
59 #if defined(OS_POSIX)
60 /*
61 * The outer sandbox on Linux and OSX prevents
62 * sysconf(_SC_NPROCESSORS) from working; in Windows, there are no
63 * problems with invoking GetSystemInfo. Therefore, only in
64 * OS_POSIX do we need to supply the number of cores into
65 * NaClChromeMainArgs object.
66 */
67 int number_of_cores_;
68 #endif
54 69
55 // Used to identify what thread we're on. 70 // Used to identify what thread we're on.
56 MessageLoop* main_loop_; 71 MessageLoop* main_loop_;
57 72
58 DISALLOW_COPY_AND_ASSIGN(NaClListener); 73 DISALLOW_COPY_AND_ASSIGN(NaClListener);
59 }; 74 };
60 75
61 #endif // CHROME_NACL_NACL_LISTENER_H_ 76 #endif // CHROME_NACL_NACL_LISTENER_H_
OLDNEW
« 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