OLD | NEW |
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 COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ | 5 #ifndef COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ |
6 #define COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ | 6 #define COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/shared_memory.h" | 16 #include "base/memory/shared_memory.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "components/nacl/common/nacl_types.h" | 20 #include "components/nacl/common/nacl_types.h" |
21 #include "components/nacl/loader/nacl_trusted_listener.h" | 21 #include "components/nacl/loader/nacl_trusted_listener.h" |
22 #include "ipc/ipc_listener.h" | 22 #include "ipc/ipc_listener.h" |
23 | 23 |
24 namespace IPC { | 24 namespace IPC { |
25 class AttachmentBrokerUnprivileged; | |
26 class SyncChannel; | 25 class SyncChannel; |
27 class SyncMessageFilter; | 26 class SyncMessageFilter; |
28 } | 27 } |
29 | 28 |
30 // The NaClListener is an IPC channel listener that waits for a | 29 // The NaClListener is an IPC channel listener that waits for a |
31 // request to start a NaCl module. | 30 // request to start a NaCl module. |
32 class NaClListener : public IPC::Listener { | 31 class NaClListener : public IPC::Listener { |
33 public: | 32 public: |
34 NaClListener(); | 33 NaClListener(); |
35 ~NaClListener() override; | 34 ~NaClListener() override; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 base::FilePath)> OpenResourceReplyCallback; | 72 base::FilePath)> OpenResourceReplyCallback; |
74 | 73 |
75 bool OnOpenResource(const IPC::Message& msg, | 74 bool OnOpenResource(const IPC::Message& msg, |
76 const std::string& key, | 75 const std::string& key, |
77 OpenResourceReplyCallback cb); | 76 OpenResourceReplyCallback cb); |
78 | 77 |
79 void OnAddPrefetchedResource( | 78 void OnAddPrefetchedResource( |
80 const nacl::NaClResourcePrefetchResult& prefetched_resource_file); | 79 const nacl::NaClResourcePrefetchResult& prefetched_resource_file); |
81 void OnStart(const nacl::NaClStartParams& params); | 80 void OnStart(const nacl::NaClStartParams& params); |
82 | 81 |
83 scoped_ptr<IPC::AttachmentBrokerUnprivileged> attachment_broker_; | |
84 | |
85 // A channel back to the browser. | 82 // A channel back to the browser. |
86 scoped_ptr<IPC::SyncChannel> channel_; | 83 scoped_ptr<IPC::SyncChannel> channel_; |
87 | 84 |
88 // A filter that allows other threads to use the channel. | 85 // A filter that allows other threads to use the channel. |
89 scoped_refptr<IPC::SyncMessageFilter> filter_; | 86 scoped_refptr<IPC::SyncMessageFilter> filter_; |
90 | 87 |
91 base::WaitableEvent shutdown_event_; | 88 base::WaitableEvent shutdown_event_; |
92 base::Thread io_thread_; | 89 base::Thread io_thread_; |
93 | 90 |
94 #if defined(OS_LINUX) | 91 #if defined(OS_LINUX) |
(...skipping 22 matching lines...) Expand all Loading... |
117 std::pair<IPC::PlatformFileForTransit, | 114 std::pair<IPC::PlatformFileForTransit, |
118 base::FilePath> > PrefetchedResourceFilesMap; | 115 base::FilePath> > PrefetchedResourceFilesMap; |
119 PrefetchedResourceFilesMap prefetched_resource_files_; | 116 PrefetchedResourceFilesMap prefetched_resource_files_; |
120 | 117 |
121 bool is_started_; | 118 bool is_started_; |
122 | 119 |
123 DISALLOW_COPY_AND_ASSIGN(NaClListener); | 120 DISALLOW_COPY_AND_ASSIGN(NaClListener); |
124 }; | 121 }; |
125 | 122 |
126 #endif // COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ | 123 #endif // COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ |
OLD | NEW |