Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: mojo/edk/system/dispatcher.h

Issue 1856113002: EDK: Add implementation of data pipe consumer read threshold stuff. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/system/data_pipe_impl_unittest.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_EDK_SYSTEM_DISPATCHER_H_ 5 #ifndef MOJO_EDK_SYSTEM_DISPATCHER_H_
6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ 6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 std::vector<DispatcherTransport>* transports, 90 std::vector<DispatcherTransport>* transports,
91 MojoWriteMessageFlags flags); 91 MojoWriteMessageFlags flags);
92 // |dispatchers| must be non-null but empty, if |num_dispatchers| is non-null 92 // |dispatchers| must be non-null but empty, if |num_dispatchers| is non-null
93 // and nonzero. On success, it will be set to the dispatchers to be received 93 // and nonzero. On success, it will be set to the dispatchers to be received
94 // (and assigned handles) as part of the message. 94 // (and assigned handles) as part of the message.
95 MojoResult ReadMessage(UserPointer<void> bytes, 95 MojoResult ReadMessage(UserPointer<void> bytes,
96 UserPointer<uint32_t> num_bytes, 96 UserPointer<uint32_t> num_bytes,
97 DispatcherVector* dispatchers, 97 DispatcherVector* dispatchers,
98 uint32_t* num_dispatchers, 98 uint32_t* num_dispatchers,
99 MojoReadMessageFlags flags); 99 MojoReadMessageFlags flags);
100
100 MojoResult WriteData(UserPointer<const void> elements, 101 MojoResult WriteData(UserPointer<const void> elements,
101 UserPointer<uint32_t> elements_num_bytes, 102 UserPointer<uint32_t> elements_num_bytes,
102 MojoWriteDataFlags flags); 103 MojoWriteDataFlags flags);
103 MojoResult BeginWriteData(UserPointer<void*> buffer, 104 MojoResult BeginWriteData(UserPointer<void*> buffer,
104 UserPointer<uint32_t> buffer_num_bytes, 105 UserPointer<uint32_t> buffer_num_bytes,
105 MojoWriteDataFlags flags); 106 MojoWriteDataFlags flags);
106 MojoResult EndWriteData(uint32_t num_bytes_written); 107 MojoResult EndWriteData(uint32_t num_bytes_written);
108 MojoResult SetDataPipeConsumerOptions(
109 UserPointer<const MojoDataPipeConsumerOptions> options);
110 MojoResult GetDataPipeConsumerOptions(
111 UserPointer<MojoDataPipeConsumerOptions> options,
112 uint32_t options_num_bytes);
107 MojoResult ReadData(UserPointer<void> elements, 113 MojoResult ReadData(UserPointer<void> elements,
108 UserPointer<uint32_t> num_bytes, 114 UserPointer<uint32_t> num_bytes,
109 MojoReadDataFlags flags); 115 MojoReadDataFlags flags);
110 MojoResult BeginReadData(UserPointer<const void*> buffer, 116 MojoResult BeginReadData(UserPointer<const void*> buffer,
111 UserPointer<uint32_t> buffer_num_bytes, 117 UserPointer<uint32_t> buffer_num_bytes,
112 MojoReadDataFlags flags); 118 MojoReadDataFlags flags);
113 MojoResult EndReadData(uint32_t num_bytes_read); 119 MojoResult EndReadData(uint32_t num_bytes_read);
120
114 // |options| may be null. |new_dispatcher| must not be null, but 121 // |options| may be null. |new_dispatcher| must not be null, but
115 // |*new_dispatcher| should be null (and will contain the dispatcher for the 122 // |*new_dispatcher| should be null (and will contain the dispatcher for the
116 // new handle on success). 123 // new handle on success).
117 MojoResult DuplicateBufferHandle( 124 MojoResult DuplicateBufferHandle(
118 UserPointer<const MojoDuplicateBufferHandleOptions> options, 125 UserPointer<const MojoDuplicateBufferHandleOptions> options,
119 util::RefPtr<Dispatcher>* new_dispatcher); 126 util::RefPtr<Dispatcher>* new_dispatcher);
120 MojoResult GetBufferInformation(UserPointer<MojoBufferInformation> info, 127 MojoResult GetBufferInformation(UserPointer<MojoBufferInformation> info,
121 uint32_t info_num_bytes); 128 uint32_t info_num_bytes);
122 MojoResult MapBuffer( 129 MojoResult MapBuffer(
123 uint64_t offset, 130 uint64_t offset,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 virtual MojoResult BeginWriteDataImplNoLock( 258 virtual MojoResult BeginWriteDataImplNoLock(
252 UserPointer<void*> buffer, 259 UserPointer<void*> buffer,
253 UserPointer<uint32_t> buffer_num_bytes, 260 UserPointer<uint32_t> buffer_num_bytes,
254 MojoWriteDataFlags flags) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 261 MojoWriteDataFlags flags) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
255 virtual MojoResult EndWriteDataImplNoLock(uint32_t num_bytes_written) 262 virtual MojoResult EndWriteDataImplNoLock(uint32_t num_bytes_written)
256 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 263 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
257 virtual MojoResult ReadDataImplNoLock(UserPointer<void> elements, 264 virtual MojoResult ReadDataImplNoLock(UserPointer<void> elements,
258 UserPointer<uint32_t> num_bytes, 265 UserPointer<uint32_t> num_bytes,
259 MojoReadDataFlags flags) 266 MojoReadDataFlags flags)
260 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 267 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
268 virtual MojoResult SetDataPipeConsumerOptionsImplNoLock(
269 UserPointer<const MojoDataPipeConsumerOptions> options)
270 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
271 virtual MojoResult GetDataPipeConsumerOptionsImplNoLock(
272 UserPointer<MojoDataPipeConsumerOptions> options,
273 uint32_t options_num_bytes) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
261 virtual MojoResult BeginReadDataImplNoLock( 274 virtual MojoResult BeginReadDataImplNoLock(
262 UserPointer<const void*> buffer, 275 UserPointer<const void*> buffer,
263 UserPointer<uint32_t> buffer_num_bytes, 276 UserPointer<uint32_t> buffer_num_bytes,
264 MojoReadDataFlags flags) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 277 MojoReadDataFlags flags) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
265 virtual MojoResult EndReadDataImplNoLock(uint32_t num_bytes_read) 278 virtual MojoResult EndReadDataImplNoLock(uint32_t num_bytes_read)
266 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 279 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
267 virtual MojoResult DuplicateBufferHandleImplNoLock( 280 virtual MojoResult DuplicateBufferHandleImplNoLock(
268 UserPointer<const MojoDuplicateBufferHandleOptions> options, 281 UserPointer<const MojoDuplicateBufferHandleOptions> options,
269 util::RefPtr<Dispatcher>* new_dispatcher) 282 util::RefPtr<Dispatcher>* new_dispatcher)
270 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); 283 MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 442
430 // So logging macros and |DCHECK_EQ()|, etc. work. 443 // So logging macros and |DCHECK_EQ()|, etc. work.
431 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) { 444 inline std::ostream& operator<<(std::ostream& out, Dispatcher::Type type) {
432 return out << static_cast<int>(type); 445 return out << static_cast<int>(type);
433 } 446 }
434 447
435 } // namespace system 448 } // namespace system
436 } // namespace mojo 449 } // namespace mojo
437 450
438 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ 451 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/data_pipe_impl_unittest.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698