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

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

Issue 2060943007: Make it possible to remove an Awakable with a specific "context" from a Dispatcher. (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/message_pipe_dispatcher.h ('k') | mojo/edk/system/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/edk/system/message_pipe_dispatcher.h" 5 #include "mojo/edk/system/message_pipe_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/configuration.h" 10 #include "mojo/edk/system/configuration.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 signals_state); 211 signals_state);
212 } 212 }
213 213
214 void MessagePipeDispatcher::RemoveAwakableImplNoLock( 214 void MessagePipeDispatcher::RemoveAwakableImplNoLock(
215 Awakable* awakable, 215 Awakable* awakable,
216 HandleSignalsState* signals_state) { 216 HandleSignalsState* signals_state) {
217 mutex().AssertHeld(); 217 mutex().AssertHeld();
218 message_pipe_->RemoveAwakable(port_, awakable, signals_state); 218 message_pipe_->RemoveAwakable(port_, awakable, signals_state);
219 } 219 }
220 220
221 void MessagePipeDispatcher::RemoveAwakableWithContextImplNoLock(
222 Awakable* awakable,
223 uint64_t context,
224 HandleSignalsState* signals_state) {
225 mutex().AssertHeld();
226 message_pipe_->RemoveAwakableWithContext(port_, awakable, context,
227 signals_state);
228 }
229
221 void MessagePipeDispatcher::StartSerializeImplNoLock( 230 void MessagePipeDispatcher::StartSerializeImplNoLock(
222 Channel* channel, 231 Channel* channel,
223 size_t* max_size, 232 size_t* max_size,
224 size_t* max_platform_handles) { 233 size_t* max_platform_handles) {
225 AssertHasOneRef(); // Only one ref => no need to take the lock. 234 AssertHasOneRef(); // Only one ref => no need to take the lock.
226 return message_pipe_->StartSerialize(port_, channel, max_size, 235 return message_pipe_->StartSerialize(port_, channel, max_size,
227 max_platform_handles); 236 max_platform_handles);
228 } 237 }
229 238
230 bool MessagePipeDispatcher::EndSerializeAndCloseImplNoLock( 239 bool MessagePipeDispatcher::EndSerializeAndCloseImplNoLock(
231 Channel* channel, 240 Channel* channel,
232 void* destination, 241 void* destination,
233 size_t* actual_size, 242 size_t* actual_size,
234 std::vector<ScopedPlatformHandle>* platform_handles) { 243 std::vector<ScopedPlatformHandle>* platform_handles) {
235 AssertHasOneRef(); // Only one ref => no need to take the lock. 244 AssertHasOneRef(); // Only one ref => no need to take the lock.
236 245
237 bool rv = message_pipe_->EndSerialize(port_, channel, destination, 246 bool rv = message_pipe_->EndSerialize(port_, channel, destination,
238 actual_size, platform_handles); 247 actual_size, platform_handles);
239 message_pipe_ = nullptr; 248 message_pipe_ = nullptr;
240 port_ = kInvalidPort; 249 port_ = kInvalidPort;
241 return rv; 250 return rv;
242 } 251 }
243 252
244 } // namespace system 253 } // namespace system
245 } // namespace mojo 254 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.h ('k') | mojo/edk/system/message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698