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

Side by Side Diff: mojo/system/message_pipe_dispatcher.cc

Issue 262093003: Mojo: Add/use |typedef std::vector<scoped_refptr<Dispatcher> > DispatcherVector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/message_pipe_dispatcher.h ('k') | mojo/system/message_pipe_endpoint.h » ('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 #include "mojo/system/message_pipe_dispatcher.h" 5 #include "mojo/system/message_pipe_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/system/channel.h" 8 #include "mojo/system/channel.h"
9 #include "mojo/system/constants.h" 9 #include "mojo/system/constants.h"
10 #include "mojo/system/local_message_pipe_endpoint.h" 10 #include "mojo/system/local_message_pipe_endpoint.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (num_bytes > kMaxMessageNumBytes) 155 if (num_bytes > kMaxMessageNumBytes)
156 return MOJO_RESULT_RESOURCE_EXHAUSTED; 156 return MOJO_RESULT_RESOURCE_EXHAUSTED;
157 157
158 return message_pipe_->WriteMessage(port_, bytes, num_bytes, transports, 158 return message_pipe_->WriteMessage(port_, bytes, num_bytes, transports,
159 flags); 159 flags);
160 } 160 }
161 161
162 MojoResult MessagePipeDispatcher::ReadMessageImplNoLock( 162 MojoResult MessagePipeDispatcher::ReadMessageImplNoLock(
163 void* bytes, 163 void* bytes,
164 uint32_t* num_bytes, 164 uint32_t* num_bytes,
165 std::vector<scoped_refptr<Dispatcher> >* dispatchers, 165 DispatcherVector* dispatchers,
166 uint32_t* num_dispatchers, 166 uint32_t* num_dispatchers,
167 MojoReadMessageFlags flags) { 167 MojoReadMessageFlags flags) {
168 lock().AssertAcquired(); 168 lock().AssertAcquired();
169 169
170 if (num_bytes) { 170 if (num_bytes) {
171 if (!VerifyUserPointer<uint32_t>(num_bytes, 1)) 171 if (!VerifyUserPointer<uint32_t>(num_bytes, 1))
172 return MOJO_RESULT_INVALID_ARGUMENT; 172 return MOJO_RESULT_INVALID_ARGUMENT;
173 if (!VerifyUserPointer<void>(bytes, *num_bytes)) 173 if (!VerifyUserPointer<void>(bytes, *num_bytes))
174 return MOJO_RESULT_INVALID_ARGUMENT; 174 return MOJO_RESULT_INVALID_ARGUMENT;
175 } 175 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 // MessagePipeDispatcherTransport ---------------------------------------------- 235 // MessagePipeDispatcherTransport ----------------------------------------------
236 236
237 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport( 237 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport(
238 DispatcherTransport transport) : DispatcherTransport(transport) { 238 DispatcherTransport transport) : DispatcherTransport(transport) {
239 DCHECK_EQ(message_pipe_dispatcher()->GetType(), Dispatcher::kTypeMessagePipe); 239 DCHECK_EQ(message_pipe_dispatcher()->GetType(), Dispatcher::kTypeMessagePipe);
240 } 240 }
241 241
242 } // namespace system 242 } // namespace system
243 } // namespace mojo 243 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe_dispatcher.h ('k') | mojo/system/message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698