| 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> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool channel_closed_; | 141 bool channel_closed_; |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 // This is the data that must only be accessed on the I/O thread (as defined | 144 // This is the data that must only be accessed on the I/O thread (as defined |
| 145 // by TaskRunner). This struct just separates it so it's easier to see. | 145 // by TaskRunner). This struct just separates it so it's easier to see. |
| 146 struct IOThreadData { | 146 struct IOThreadData { |
| 147 IOThreadData(); | 147 IOThreadData(); |
| 148 ~IOThreadData(); | 148 ~IOThreadData(); |
| 149 | 149 |
| 150 scoped_ptr<IPC::Channel> channel_; | 150 scoped_ptr<IPC::Channel> channel_; |
| 151 |
| 152 // When we send a synchronous message (from untrusted to trusted), we store |
| 153 // its type here, so that later we can associate the reply with its type |
| 154 // for scanning. |
| 155 typedef std::map<int, uint32> PendingSyncMsgMap; |
| 156 PendingSyncMsgMap pending_sync_msgs_; |
| 151 }; | 157 }; |
| 152 | 158 |
| 153 virtual ~NaClIPCAdapter(); | 159 virtual ~NaClIPCAdapter(); |
| 154 | 160 |
| 155 // Returns 0 if nothing is waiting. | 161 // Returns 0 if nothing is waiting. |
| 156 int LockedReceive(NaClImcTypedMsgHdr* msg); | 162 int LockedReceive(NaClImcTypedMsgHdr* msg); |
| 157 | 163 |
| 158 // Sends a message that we know has been completed to the Chrome process. | 164 // Sends a message that we know has been completed to the Chrome process. |
| 159 bool SendCompleteMessage(const char* buffer, size_t buffer_len); | 165 bool SendCompleteMessage(const char* buffer, size_t buffer_len); |
| 160 | 166 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 183 // To be accessed on the I/O thread (via task runner) only. | 189 // To be accessed on the I/O thread (via task runner) only. |
| 184 IOThreadData io_thread_data_; | 190 IOThreadData io_thread_data_; |
| 185 | 191 |
| 186 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); | 192 DISALLOW_COPY_AND_ASSIGN(NaClIPCAdapter); |
| 187 }; | 193 }; |
| 188 | 194 |
| 189 // Export TranslatePepperFileReadWriteOpenFlags for testing. | 195 // Export TranslatePepperFileReadWriteOpenFlags for testing. |
| 190 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); | 196 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags); |
| 191 | 197 |
| 192 #endif // CHROME_NACL_NACL_IPC_ADAPTER_H_ | 198 #endif // CHROME_NACL_NACL_IPC_ADAPTER_H_ |
| OLD | NEW |