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 MOJO_SYSTEM_DISPATCHER_H_ | 5 #ifndef MOJO_SYSTEM_DISPATCHER_H_ |
6 #define MOJO_SYSTEM_DISPATCHER_H_ | 6 #define MOJO_SYSTEM_DISPATCHER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.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/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "mojo/embedder/platform_handle.h" | 17 #include "mojo/embedder/platform_handle.h" |
18 #include "mojo/embedder/platform_handle_vector.h" | 18 #include "mojo/embedder/platform_handle_vector.h" |
19 #include "mojo/public/c/system/buffer.h" | 19 #include "mojo/public/c/system/buffer.h" |
20 #include "mojo/public/c/system/data_pipe.h" | 20 #include "mojo/public/c/system/data_pipe.h" |
21 #include "mojo/public/c/system/message_pipe.h" | 21 #include "mojo/public/c/system/message_pipe.h" |
22 #include "mojo/public/c/system/types.h" | 22 #include "mojo/public/c/system/types.h" |
| 23 #include "mojo/system/memory.h" |
23 #include "mojo/system/system_impl_export.h" | 24 #include "mojo/system/system_impl_export.h" |
24 | 25 |
25 namespace mojo { | 26 namespace mojo { |
26 namespace system { | 27 namespace system { |
27 | 28 |
28 class Channel; | 29 class Channel; |
29 class Core; | 30 class Core; |
30 class Dispatcher; | 31 class Dispatcher; |
31 class DispatcherTransport; | 32 class DispatcherTransport; |
32 class HandleTable; | 33 class HandleTable; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // and nonzero. On success, it will be set to the dispatchers to be received | 88 // and nonzero. On success, it will be set to the dispatchers to be received |
88 // (and assigned handles) as part of the message. | 89 // (and assigned handles) as part of the message. |
89 MojoResult ReadMessage(void* bytes, | 90 MojoResult ReadMessage(void* bytes, |
90 uint32_t* num_bytes, | 91 uint32_t* num_bytes, |
91 DispatcherVector* dispatchers, | 92 DispatcherVector* dispatchers, |
92 uint32_t* num_dispatchers, | 93 uint32_t* num_dispatchers, |
93 MojoReadMessageFlags flags); | 94 MojoReadMessageFlags flags); |
94 MojoResult WriteData(const void* elements, | 95 MojoResult WriteData(const void* elements, |
95 uint32_t* elements_num_bytes, | 96 uint32_t* elements_num_bytes, |
96 MojoWriteDataFlags flags); | 97 MojoWriteDataFlags flags); |
97 MojoResult BeginWriteData(void** buffer, | 98 MojoResult BeginWriteData(UserPointer<void*> buffer, |
98 uint32_t* buffer_num_bytes, | 99 UserPointer<uint32_t> buffer_num_bytes, |
99 MojoWriteDataFlags flags); | 100 MojoWriteDataFlags flags); |
100 MojoResult EndWriteData(uint32_t num_bytes_written); | 101 MojoResult EndWriteData(uint32_t num_bytes_written); |
101 MojoResult ReadData(void* elements, | 102 MojoResult ReadData(void* elements, |
102 uint32_t* num_bytes, | 103 uint32_t* num_bytes, |
103 MojoReadDataFlags flags); | 104 MojoReadDataFlags flags); |
104 MojoResult BeginReadData(const void** buffer, | 105 MojoResult BeginReadData(const void** buffer, |
105 uint32_t* buffer_num_bytes, | 106 uint32_t* buffer_num_bytes, |
106 MojoReadDataFlags flags); | 107 MojoReadDataFlags flags); |
107 MojoResult EndReadData(uint32_t num_bytes_read); | 108 MojoResult EndReadData(uint32_t num_bytes_read); |
108 // |options| may be null. |new_dispatcher| must not be null, but | 109 // |options| may be null. |new_dispatcher| must not be null, but |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 std::vector<DispatcherTransport>* transports, | 218 std::vector<DispatcherTransport>* transports, |
218 MojoWriteMessageFlags flags); | 219 MojoWriteMessageFlags flags); |
219 virtual MojoResult ReadMessageImplNoLock(void* bytes, | 220 virtual MojoResult ReadMessageImplNoLock(void* bytes, |
220 uint32_t* num_bytes, | 221 uint32_t* num_bytes, |
221 DispatcherVector* dispatchers, | 222 DispatcherVector* dispatchers, |
222 uint32_t* num_dispatchers, | 223 uint32_t* num_dispatchers, |
223 MojoReadMessageFlags flags); | 224 MojoReadMessageFlags flags); |
224 virtual MojoResult WriteDataImplNoLock(const void* elements, | 225 virtual MojoResult WriteDataImplNoLock(const void* elements, |
225 uint32_t* num_bytes, | 226 uint32_t* num_bytes, |
226 MojoWriteDataFlags flags); | 227 MojoWriteDataFlags flags); |
227 virtual MojoResult BeginWriteDataImplNoLock(void** buffer, | 228 virtual MojoResult BeginWriteDataImplNoLock( |
228 uint32_t* buffer_num_bytes, | 229 UserPointer<void*> buffer, |
229 MojoWriteDataFlags flags); | 230 UserPointer<uint32_t> buffer_num_bytes, |
| 231 MojoWriteDataFlags flags); |
230 virtual MojoResult EndWriteDataImplNoLock(uint32_t num_bytes_written); | 232 virtual MojoResult EndWriteDataImplNoLock(uint32_t num_bytes_written); |
231 virtual MojoResult ReadDataImplNoLock(void* elements, | 233 virtual MojoResult ReadDataImplNoLock(void* elements, |
232 uint32_t* num_bytes, | 234 uint32_t* num_bytes, |
233 MojoReadDataFlags flags); | 235 MojoReadDataFlags flags); |
234 virtual MojoResult BeginReadDataImplNoLock(const void** buffer, | 236 virtual MojoResult BeginReadDataImplNoLock(const void** buffer, |
235 uint32_t* buffer_num_bytes, | 237 uint32_t* buffer_num_bytes, |
236 MojoReadDataFlags flags); | 238 MojoReadDataFlags flags); |
237 virtual MojoResult EndReadDataImplNoLock(uint32_t num_bytes_read); | 239 virtual MojoResult EndReadDataImplNoLock(uint32_t num_bytes_read); |
238 virtual MojoResult DuplicateBufferHandleImplNoLock( | 240 virtual MojoResult DuplicateBufferHandleImplNoLock( |
239 const MojoDuplicateBufferHandleOptions* options, | 241 const MojoDuplicateBufferHandleOptions* options, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 372 |
371 Dispatcher* dispatcher_; | 373 Dispatcher* dispatcher_; |
372 | 374 |
373 // Copy and assign allowed. | 375 // Copy and assign allowed. |
374 }; | 376 }; |
375 | 377 |
376 } // namespace system | 378 } // namespace system |
377 } // namespace mojo | 379 } // namespace mojo |
378 | 380 |
379 #endif // MOJO_SYSTEM_DISPATCHER_H_ | 381 #endif // MOJO_SYSTEM_DISPATCHER_H_ |
OLD | NEW |