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

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

Issue 345463003: Mojo: MojoWaitFlags -> MojoHandleSignals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/simple_dispatcher.h ('k') | mojo/system/simple_dispatcher_unittest.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 #include "mojo/system/simple_dispatcher.h" 5 #include "mojo/system/simple_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace system { 10 namespace system {
11 11
12 SimpleDispatcher::SimpleDispatcher() { 12 SimpleDispatcher::SimpleDispatcher() {
13 } 13 }
14 14
15 SimpleDispatcher::~SimpleDispatcher() { 15 SimpleDispatcher::~SimpleDispatcher() {
16 } 16 }
17 17
18 void SimpleDispatcher::WaitFlagsStateChangedNoLock() { 18 void SimpleDispatcher::WaitFlagsStateChangedNoLock() {
19 lock().AssertAcquired(); 19 lock().AssertAcquired();
20 waiter_list_.AwakeWaitersForStateChange(GetWaitFlagsStateNoLock()); 20 waiter_list_.AwakeWaitersForStateChange(GetWaitFlagsStateNoLock());
21 } 21 }
22 22
23 void SimpleDispatcher::CancelAllWaitersNoLock() { 23 void SimpleDispatcher::CancelAllWaitersNoLock() {
24 lock().AssertAcquired(); 24 lock().AssertAcquired();
25 waiter_list_.CancelAllWaiters(); 25 waiter_list_.CancelAllWaiters();
26 } 26 }
27 27
28 MojoResult SimpleDispatcher::AddWaiterImplNoLock(Waiter* waiter, 28 MojoResult SimpleDispatcher::AddWaiterImplNoLock(Waiter* waiter,
29 MojoWaitFlags flags, 29 MojoHandleSignals signals,
30 uint32_t context) { 30 uint32_t context) {
31 lock().AssertAcquired(); 31 lock().AssertAcquired();
32 32
33 WaitFlagsState state(GetWaitFlagsStateNoLock()); 33 WaitFlagsState state(GetWaitFlagsStateNoLock());
34 if (state.satisfies(flags)) 34 if (state.satisfies(signals))
35 return MOJO_RESULT_ALREADY_EXISTS; 35 return MOJO_RESULT_ALREADY_EXISTS;
36 if (!state.can_satisfy(flags)) 36 if (!state.can_satisfy(signals))
37 return MOJO_RESULT_FAILED_PRECONDITION; 37 return MOJO_RESULT_FAILED_PRECONDITION;
38 38
39 waiter_list_.AddWaiter(waiter, flags, context); 39 waiter_list_.AddWaiter(waiter, signals, context);
40 return MOJO_RESULT_OK; 40 return MOJO_RESULT_OK;
41 } 41 }
42 42
43 void SimpleDispatcher::RemoveWaiterImplNoLock(Waiter* waiter) { 43 void SimpleDispatcher::RemoveWaiterImplNoLock(Waiter* waiter) {
44 lock().AssertAcquired(); 44 lock().AssertAcquired();
45 waiter_list_.RemoveWaiter(waiter); 45 waiter_list_.RemoveWaiter(waiter);
46 } 46 }
47 47
48 } // namespace system 48 } // namespace system
49 } // namespace mojo 49 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/simple_dispatcher.h ('k') | mojo/system/simple_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698