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

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

Issue 417303002: Convert ReadMessage...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hmm Created 6 years, 4 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.h ('k') | mojo/system/message_pipe_dispatcher.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.h" 5 #include "mojo/system/message_pipe.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/local_message_pipe_endpoint.h" 9 #include "mojo/system/local_message_pipe_endpoint.h"
10 #include "mojo/system/message_in_transit.h" 10 #include "mojo/system/message_in_transit.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 GetPeerPort(port), 76 GetPeerPort(port),
77 make_scoped_ptr(new MessageInTransit( 77 make_scoped_ptr(new MessageInTransit(
78 MessageInTransit::kTypeMessagePipeEndpoint, 78 MessageInTransit::kTypeMessagePipeEndpoint,
79 MessageInTransit::kSubtypeMessagePipeEndpointData, 79 MessageInTransit::kSubtypeMessagePipeEndpointData,
80 num_bytes, 80 num_bytes,
81 bytes)), 81 bytes)),
82 transports); 82 transports);
83 } 83 }
84 84
85 MojoResult MessagePipe::ReadMessage(unsigned port, 85 MojoResult MessagePipe::ReadMessage(unsigned port,
86 void* bytes, 86 UserPointer<void> bytes,
87 uint32_t* num_bytes, 87 UserPointer<uint32_t> num_bytes,
88 DispatcherVector* dispatchers, 88 DispatcherVector* dispatchers,
89 uint32_t* num_dispatchers, 89 uint32_t* num_dispatchers,
90 MojoReadMessageFlags flags) { 90 MojoReadMessageFlags flags) {
91 DCHECK(port == 0 || port == 1); 91 DCHECK(port == 0 || port == 1);
92 92
93 base::AutoLock locker(lock_); 93 base::AutoLock locker(lock_);
94 DCHECK(endpoints_[port]); 94 DCHECK(endpoints_[port]);
95 95
96 return endpoints_[port]->ReadMessage(bytes, num_bytes, dispatchers, 96 return endpoints_[port]->ReadMessage(bytes, num_bytes, dispatchers,
97 num_dispatchers, flags); 97 num_dispatchers, flags);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 MojoResult MessagePipe::HandleControlMessage( 276 MojoResult MessagePipe::HandleControlMessage(
277 unsigned /*port*/, 277 unsigned /*port*/,
278 scoped_ptr<MessageInTransit> message) { 278 scoped_ptr<MessageInTransit> message) {
279 LOG(WARNING) << "Unrecognized MessagePipe control message subtype " 279 LOG(WARNING) << "Unrecognized MessagePipe control message subtype "
280 << message->subtype(); 280 << message->subtype();
281 return MOJO_RESULT_UNKNOWN; 281 return MOJO_RESULT_UNKNOWN;
282 } 282 }
283 283
284 } // namespace system 284 } // namespace system
285 } // namespace mojo 285 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe.h ('k') | mojo/system/message_pipe_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698