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

Side by Side Diff: mojo/edk/system/message_pipe.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.h ('k') | mojo/edk/system/message_pipe_dispatcher.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.h" 5 #include "mojo/edk/system/message_pipe.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 Awakable* awakable, 208 Awakable* awakable,
209 HandleSignalsState* signals_state) { 209 HandleSignalsState* signals_state) {
210 DCHECK(port == 0 || port == 1); 210 DCHECK(port == 0 || port == 1);
211 211
212 MutexLocker locker(&mutex_); 212 MutexLocker locker(&mutex_);
213 DCHECK(endpoints_[port]); 213 DCHECK(endpoints_[port]);
214 214
215 endpoints_[port]->RemoveAwakable(awakable, signals_state); 215 endpoints_[port]->RemoveAwakable(awakable, signals_state);
216 } 216 }
217 217
218 void MessagePipe::RemoveAwakableWithContext(unsigned port,
219 Awakable* awakable,
220 uint64_t context,
221 HandleSignalsState* signals_state) {
222 DCHECK(port == 0 || port == 1);
223
224 MutexLocker locker(&mutex_);
225 DCHECK(endpoints_[port]);
226
227 endpoints_[port]->RemoveAwakableWithContext(awakable, context, signals_state);
228 }
229
218 void MessagePipe::StartSerialize(unsigned /*port*/, 230 void MessagePipe::StartSerialize(unsigned /*port*/,
219 Channel* channel, 231 Channel* channel,
220 size_t* max_size, 232 size_t* max_size,
221 size_t* max_platform_handles) { 233 size_t* max_platform_handles) {
222 *max_size = channel->GetSerializedEndpointSize(); 234 *max_size = channel->GetSerializedEndpointSize();
223 *max_platform_handles = 0; 235 *max_platform_handles = 0;
224 } 236 }
225 237
226 bool MessagePipe::EndSerialize( 238 bool MessagePipe::EndSerialize(
227 unsigned port, 239 unsigned port,
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 LOG(WARNING) << "Enqueueing null dispatcher"; 383 LOG(WARNING) << "Enqueueing null dispatcher";
372 handles->push_back(Handle()); 384 handles->push_back(Handle());
373 } 385 }
374 } 386 }
375 message->SetHandles(std::move(handles)); 387 message->SetHandles(std::move(handles));
376 return MOJO_RESULT_OK; 388 return MOJO_RESULT_OK;
377 } 389 }
378 390
379 } // namespace system 391 } // namespace system
380 } // namespace mojo 392 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe.h ('k') | mojo/edk/system/message_pipe_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698