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

Side by Side Diff: components/nacl/loader/nacl_listener.h

Issue 301993003: NaCl: Split out Non-SFI logic when starting NaCl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better TODO message. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | components/nacl/loader/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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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"
11 #include "base/synchronization/waitable_event.h" 11 #include "base/synchronization/waitable_event.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "components/nacl/common/nacl_types.h" 13 #include "components/nacl/common/nacl_types.h"
14 #include "components/nacl/loader/nacl_trusted_listener.h" 14 #include "components/nacl/loader/nacl_trusted_listener.h"
15 #include "ipc/ipc_listener.h" 15 #include "ipc/ipc_listener.h"
16 16
17 namespace base {
18 class MessageLoopProxy;
19 }
20
17 namespace IPC { 21 namespace IPC {
18 class SyncChannel; 22 class SyncChannel;
19 class SyncMessageFilter; 23 class SyncMessageFilter;
20 } 24 }
21 25
22 // The NaClListener is an IPC channel listener that waits for a 26 // The NaClListener is an IPC channel listener that waits for a
23 // request to start a NaCl module. 27 // request to start a NaCl module.
24 class NaClListener : public IPC::Listener { 28 class NaClListener : public IPC::Listener {
25 public: 29 public:
26 NaClListener(); 30 NaClListener();
(...skipping 11 matching lines...) Expand all
38 prereserved_sandbox_size_ = prereserved_sandbox_size; 42 prereserved_sandbox_size_ = prereserved_sandbox_size;
39 } 43 }
40 #endif 44 #endif
41 #if defined(OS_POSIX) 45 #if defined(OS_POSIX)
42 void set_number_of_cores(int number_of_cores) { 46 void set_number_of_cores(int number_of_cores) {
43 number_of_cores_ = number_of_cores; 47 number_of_cores_ = number_of_cores;
44 } 48 }
45 #endif 49 #endif
46 50
47 private: 51 private:
52 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
53
48 void OnStart(const nacl::NaClStartParams& params); 54 void OnStart(const nacl::NaClStartParams& params);
49 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 55
56 // Non-SFI version of OnStart().
57 void StartNonSfi(const nacl::NaClStartParams& params);
58
59 IPC::ChannelHandle CreateTrustedListener(
60 base::MessageLoopProxy* message_loop_proxy,
61 base::WaitableEvent* shutdown_event);
50 62
51 // A channel back to the browser. 63 // A channel back to the browser.
52 scoped_ptr<IPC::SyncChannel> channel_; 64 scoped_ptr<IPC::SyncChannel> channel_;
53 65
54 // A filter that allows other threads to use the channel. 66 // A filter that allows other threads to use the channel.
55 scoped_refptr<IPC::SyncMessageFilter> filter_; 67 scoped_refptr<IPC::SyncMessageFilter> filter_;
56 68
57 base::WaitableEvent shutdown_event_; 69 base::WaitableEvent shutdown_event_;
58 base::Thread io_thread_; 70 base::Thread io_thread_;
59 71
(...skipping 12 matching lines...) Expand all
72 84
73 scoped_refptr<NaClTrustedListener> trusted_listener_; 85 scoped_refptr<NaClTrustedListener> trusted_listener_;
74 86
75 // Used to identify what thread we're on. 87 // Used to identify what thread we're on.
76 base::MessageLoop* main_loop_; 88 base::MessageLoop* main_loop_;
77 89
78 DISALLOW_COPY_AND_ASSIGN(NaClListener); 90 DISALLOW_COPY_AND_ASSIGN(NaClListener);
79 }; 91 };
80 92
81 #endif // CHROME_NACL_NACL_LISTENER_H_ 93 #endif // CHROME_NACL_NACL_LISTENER_H_
OLDNEW
« no previous file with comments | « no previous file | components/nacl/loader/nacl_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698