| 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; |
| 25 class SyncChannel; | 26 class SyncChannel; |
| 26 class SyncMessageFilter; | 27 class SyncMessageFilter; |
| 27 } | 28 } |
| 28 | 29 |
| 29 // The NaClListener is an IPC channel listener that waits for a | 30 // The NaClListener is an IPC channel listener that waits for a |
| 30 // request to start a NaCl module. | 31 // request to start a NaCl module. |
| 31 class NaClListener : public IPC::Listener { | 32 class NaClListener : public IPC::Listener { |
| 32 public: | 33 public: |
| 33 NaClListener(); | 34 NaClListener(); |
| 34 ~NaClListener() override; | 35 ~NaClListener() override; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 base::FilePath)> OpenResourceReplyCallback; | 73 base::FilePath)> OpenResourceReplyCallback; |
| 73 | 74 |
| 74 bool OnOpenResource(const IPC::Message& msg, | 75 bool OnOpenResource(const IPC::Message& msg, |
| 75 const std::string& key, | 76 const std::string& key, |
| 76 OpenResourceReplyCallback cb); | 77 OpenResourceReplyCallback cb); |
| 77 | 78 |
| 78 void OnAddPrefetchedResource( | 79 void OnAddPrefetchedResource( |
| 79 const nacl::NaClResourcePrefetchResult& prefetched_resource_file); | 80 const nacl::NaClResourcePrefetchResult& prefetched_resource_file); |
| 80 void OnStart(const nacl::NaClStartParams& params); | 81 void OnStart(const nacl::NaClStartParams& params); |
| 81 | 82 |
| 83 scoped_ptr<IPC::AttachmentBrokerUnprivileged> attachment_broker_; |
| 84 |
| 82 // A channel back to the browser. | 85 // A channel back to the browser. |
| 83 scoped_ptr<IPC::SyncChannel> channel_; | 86 scoped_ptr<IPC::SyncChannel> channel_; |
| 84 | 87 |
| 85 // A filter that allows other threads to use the channel. | 88 // A filter that allows other threads to use the channel. |
| 86 scoped_refptr<IPC::SyncMessageFilter> filter_; | 89 scoped_refptr<IPC::SyncMessageFilter> filter_; |
| 87 | 90 |
| 88 base::WaitableEvent shutdown_event_; | 91 base::WaitableEvent shutdown_event_; |
| 89 base::Thread io_thread_; | 92 base::Thread io_thread_; |
| 90 | 93 |
| 91 #if defined(OS_LINUX) | 94 #if defined(OS_LINUX) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 114 std::pair<IPC::PlatformFileForTransit, | 117 std::pair<IPC::PlatformFileForTransit, |
| 115 base::FilePath> > PrefetchedResourceFilesMap; | 118 base::FilePath> > PrefetchedResourceFilesMap; |
| 116 PrefetchedResourceFilesMap prefetched_resource_files_; | 119 PrefetchedResourceFilesMap prefetched_resource_files_; |
| 117 | 120 |
| 118 bool is_started_; | 121 bool is_started_; |
| 119 | 122 |
| 120 DISALLOW_COPY_AND_ASSIGN(NaClListener); | 123 DISALLOW_COPY_AND_ASSIGN(NaClListener); |
| 121 }; | 124 }; |
| 122 | 125 |
| 123 #endif // COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ | 126 #endif // COMPONENTS_NACL_LOADER_NACL_LISTENER_H_ |
| OLD | NEW |