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

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

Issue 68993005: Mojo: More plumbing to support sending handles over MessagePipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/dispatcher.h ('k') | mojo/system/local_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/dispatcher.h" 5 #include "mojo/system/dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/system/limits.h" 8 #include "mojo/system/limits.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 20 matching lines...) Expand all
31 return MOJO_RESULT_INVALID_ARGUMENT; 31 return MOJO_RESULT_INVALID_ARGUMENT;
32 32
33 return WriteMessageImplNoLock(bytes, num_bytes, dispatchers, flags); 33 return WriteMessageImplNoLock(bytes, num_bytes, dispatchers, flags);
34 } 34 }
35 35
36 MojoResult Dispatcher::ReadMessage( 36 MojoResult Dispatcher::ReadMessage(
37 void* bytes, uint32_t* num_bytes, 37 void* bytes, uint32_t* num_bytes,
38 uint32_t max_num_dispatchers, 38 uint32_t max_num_dispatchers,
39 std::vector<scoped_refptr<Dispatcher> >* dispatchers, 39 std::vector<scoped_refptr<Dispatcher> >* dispatchers,
40 MojoReadMessageFlags flags) { 40 MojoReadMessageFlags flags) {
41 DCHECK(max_num_dispatchers == 0 || !!dispatchers); 41 DCHECK(max_num_dispatchers == 0 || (dispatchers && dispatchers->empty()));
42 42
43 base::AutoLock locker(lock_); 43 base::AutoLock locker(lock_);
44 if (is_closed_) 44 if (is_closed_)
45 return MOJO_RESULT_INVALID_ARGUMENT; 45 return MOJO_RESULT_INVALID_ARGUMENT;
46 46
47 return ReadMessageImplNoLock(bytes, num_bytes, 47 return ReadMessageImplNoLock(bytes, num_bytes,
48 max_num_dispatchers, dispatchers, 48 max_num_dispatchers, dispatchers,
49 flags); 49 flags);
50 } 50 }
51 51
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 void Dispatcher::RemoveWaiterImplNoLock(Waiter* waiter) { 128 void Dispatcher::RemoveWaiterImplNoLock(Waiter* waiter) {
129 lock_.AssertAcquired(); 129 lock_.AssertAcquired();
130 DCHECK(!is_closed_); 130 DCHECK(!is_closed_);
131 // By default, waiting isn't supported. Only dispatchers that can be waited on 131 // By default, waiting isn't supported. Only dispatchers that can be waited on
132 // will do something nontrivial. 132 // will do something nontrivial.
133 } 133 }
134 134
135 } // namespace system 135 } // namespace system
136 } // namespace mojo 136 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/dispatcher.h ('k') | mojo/system/local_message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698