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

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

Issue 2088833003: Add different behavior to AwakableList for "persistent" vs "one-shot" awakables. (Closed) Base URL: https://github.com/domokit/mojo.git@work793_wait_set_4.5
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
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/data_pipe_consumer_dispatcher.h" 5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/edk/system/data_pipe.h" 10 #include "mojo/edk/system/data_pipe.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 HandleSignalsState DataPipeConsumerDispatcher::GetHandleSignalsStateImplNoLock() 189 HandleSignalsState DataPipeConsumerDispatcher::GetHandleSignalsStateImplNoLock()
190 const { 190 const {
191 mutex().AssertHeld(); 191 mutex().AssertHeld();
192 return data_pipe_->ConsumerGetHandleSignalsState(); 192 return data_pipe_->ConsumerGetHandleSignalsState();
193 } 193 }
194 194
195 MojoResult DataPipeConsumerDispatcher::AddAwakableImplNoLock( 195 MojoResult DataPipeConsumerDispatcher::AddAwakableImplNoLock(
196 Awakable* awakable, 196 Awakable* awakable,
197 uint64_t context, 197 uint64_t context,
198 bool force, 198 bool persistent,
199 MojoHandleSignals signals, 199 MojoHandleSignals signals,
200 HandleSignalsState* signals_state) { 200 HandleSignalsState* signals_state) {
201 mutex().AssertHeld(); 201 mutex().AssertHeld();
202 return data_pipe_->ConsumerAddAwakable(awakable, context, force, signals, 202 return data_pipe_->ConsumerAddAwakable(awakable, context, persistent, signals,
203 signals_state); 203 signals_state);
204 } 204 }
205 205
206 void DataPipeConsumerDispatcher::RemoveAwakableImplNoLock( 206 void DataPipeConsumerDispatcher::RemoveAwakableImplNoLock(
207 bool match_context, 207 bool match_context,
208 Awakable* awakable, 208 Awakable* awakable,
209 uint64_t context, 209 uint64_t context,
210 HandleSignalsState* signals_state) { 210 HandleSignalsState* signals_state) {
211 mutex().AssertHeld(); 211 mutex().AssertHeld();
212 data_pipe_->ConsumerRemoveAwakable(match_context, awakable, context, 212 data_pipe_->ConsumerRemoveAwakable(match_context, awakable, context,
(...skipping 16 matching lines...) Expand all
229 AssertHasOneRef(); // Only one ref => no need to take the lock. 229 AssertHasOneRef(); // Only one ref => no need to take the lock.
230 230
231 bool rv = data_pipe_->ConsumerEndSerialize(channel, destination, actual_size, 231 bool rv = data_pipe_->ConsumerEndSerialize(channel, destination, actual_size,
232 platform_handles); 232 platform_handles);
233 data_pipe_ = nullptr; 233 data_pipe_ = nullptr;
234 return rv; 234 return rv;
235 } 235 }
236 236
237 } // namespace system 237 } // namespace system
238 } // namespace mojo 238 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/data_pipe_consumer_dispatcher.h ('k') | mojo/edk/system/data_pipe_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698