| 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 CHROME_NACL_NACL_IPC_ADAPTER_H_ | 5 #ifndef CHROME_NACL_NACL_IPC_ADAPTER_H_ |
| 6 #define CHROME_NACL_NACL_IPC_ADAPTER_H_ | 6 #define CHROME_NACL_NACL_IPC_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "base/memory/shared_memory.h" | 17 #include "base/memory/shared_memory.h" |
| 18 #include "base/pickle.h" | 18 #include "base/pickle.h" |
| 19 #include "base/synchronization/condition_variable.h" | 19 #include "base/synchronization/condition_variable.h" |
| 20 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
| 21 #include "base/task_runner.h" | 21 #include "base/task_runner.h" |
| 22 #include "ipc/ipc_listener.h" | 22 #include "ipc/ipc_listener.h" |
| 23 #include "ppapi/c/pp_stdint.h" | 23 #include "ppapi/c/pp_stdint.h" |
| 24 #include "ppapi/proxy/handle_converter.h" | 24 #include "ppapi/proxy/nacl_message_scanner.h" |
| 25 | 25 |
| 26 struct NaClDesc; | 26 struct NaClDesc; |
| 27 struct NaClImcTypedMsgHdr; | 27 struct NaClImcTypedMsgHdr; |
| 28 struct PP_Size; | 28 struct PP_Size; |
| 29 | 29 |
| 30 namespace IPC { | 30 namespace IPC { |
| 31 class Channel; | 31 class Channel; |
| 32 struct ChannelHandle; | 32 struct ChannelHandle; |
| 33 } | 33 } |
| 34 | 34 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // This is the data that must only be accessed inside the lock. This struct | 120 // This is the data that must only be accessed inside the lock. This struct |
| 121 // just separates it so it's easier to see. | 121 // just separates it so it's easier to see. |
| 122 struct LockedData { | 122 struct LockedData { |
| 123 LockedData(); | 123 LockedData(); |
| 124 ~LockedData(); | 124 ~LockedData(); |
| 125 | 125 |
| 126 // Messages that we have read off of the Chrome IPC channel that are waiting | 126 // Messages that we have read off of the Chrome IPC channel that are waiting |
| 127 // to be received by the plugin. | 127 // to be received by the plugin. |
| 128 std::queue< scoped_refptr<RewrittenMessage> > to_be_received_; | 128 std::queue< scoped_refptr<RewrittenMessage> > to_be_received_; |
| 129 | 129 |
| 130 ppapi::proxy::HandleConverter handle_converter_; | 130 ppapi::proxy::NaClMessageScanner nacl_msg_scanner_; |
| 131 | 131 |
| 132 // Data that we've queued from the plugin to send, but doesn't consist of a | 132 // Data that we've queued from the plugin to send, but doesn't consist of a |
| 133 // full message yet. The calling code can break apart the message into | 133 // full message yet. The calling code can break apart the message into |
| 134 // smaller pieces, and we need to send the message to the other process in | 134 // smaller pieces, and we need to send the message to the other process in |
| 135 // one chunk. | 135 // one chunk. |
| 136 // | 136 // |
| 137 // The IPC channel always starts a new send() at the beginning of each | 137 // The IPC channel always starts a new send() at the beginning of each |
| 138 // message, so we don't need to worry about arbitrary message boundaries. | 138 // message, so we don't need to worry about arbitrary message boundaries. |
| 139 std::string to_be_sent_; | 139 std::string to_be_sent_; |
| 140 | 140 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // To be accessed on the I/O thread (via task runner) only. | 183 // To be accessed on the I/O thread (via task runner) only. |
| 184 IOThreadData io_thread_data_; | 184 IOThreadData io_thread_data_; |
| 185 | 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); | 186 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 // Export TranslatePepperFileReadWriteOpenFlags for testing. | 189 // Export TranslatePepperFileReadWriteOpenFlags for testing. |
| 190 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); | 190 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); |
| 191 | 191 |
| 192 #endif // CHROME_NACL_NACL_IPC_ADAPTER_H_ | 192 #endif // CHROME_NACL_NACL_IPC_ADAPTER_H_ |
| OLD | NEW |