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

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

Issue 2072353002: Give AwakableList's wake-up method the old state in addition to the new state. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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
« no previous file with comments | « mojo/edk/system/simple_dispatcher.h ('k') | no next file » | 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/edk/system/simple_dispatcher.h" 5 #include "mojo/edk/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 }
14 13
15 SimpleDispatcher::~SimpleDispatcher() { 14 SimpleDispatcher::~SimpleDispatcher() {}
16 }
17 15
18 void SimpleDispatcher::HandleSignalsStateChangedNoLock() { 16 void SimpleDispatcher::OnHandleSignalsStateChangeNoLock(
17 const HandleSignalsState& old_state,
18 const HandleSignalsState& new_state) {
19 mutex().AssertHeld(); 19 mutex().AssertHeld();
20 awakable_list_.AwakeForStateChange(GetHandleSignalsStateImplNoLock()); 20 awakable_list_.OnStateChange(old_state, new_state);
21 } 21 }
22 22
23 void SimpleDispatcher::CancelAllStateNoLock() { 23 void SimpleDispatcher::CancelAllStateNoLock() {
24 mutex().AssertHeld(); 24 mutex().AssertHeld();
25 awakable_list_.CancelAll(); 25 awakable_list_.CancelAll();
26 } 26 }
27 27
28 MojoResult SimpleDispatcher::AddAwakableImplNoLock( 28 MojoResult SimpleDispatcher::AddAwakableImplNoLock(
29 Awakable* awakable, 29 Awakable* awakable,
30 MojoHandleSignals signals, 30 MojoHandleSignals signals,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 uint64_t context, 65 uint64_t context,
66 HandleSignalsState* signals_state) { 66 HandleSignalsState* signals_state) {
67 mutex().AssertHeld(); 67 mutex().AssertHeld();
68 awakable_list_.RemoveWithContext(awakable, context); 68 awakable_list_.RemoveWithContext(awakable, context);
69 if (signals_state) 69 if (signals_state)
70 *signals_state = GetHandleSignalsStateImplNoLock(); 70 *signals_state = GetHandleSignalsStateImplNoLock();
71 } 71 }
72 72
73 } // namespace system 73 } // namespace system
74 } // namespace mojo 74 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/simple_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698