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

Side by Side Diff: mojo/edk/system/message_pipe.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
« 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 MutexLocker locker(&mutex_); 186 MutexLocker locker(&mutex_);
187 DCHECK(endpoints_[port]); 187 DCHECK(endpoints_[port]);
188 188
189 return endpoints_[port]->GetHandleSignalsState(); 189 return endpoints_[port]->GetHandleSignalsState();
190 } 190 }
191 191
192 MojoResult MessagePipe::AddAwakable(unsigned port, 192 MojoResult MessagePipe::AddAwakable(unsigned port,
193 Awakable* awakable, 193 Awakable* awakable,
194 uint64_t context, 194 uint64_t context,
195 bool force, 195 bool persistent,
196 MojoHandleSignals signals, 196 MojoHandleSignals signals,
197 HandleSignalsState* signals_state) { 197 HandleSignalsState* signals_state) {
198 DCHECK(port == 0 || port == 1); 198 DCHECK(port == 0 || port == 1);
199 199
200 MutexLocker locker(&mutex_); 200 MutexLocker locker(&mutex_);
201 DCHECK(endpoints_[port]); 201 DCHECK(endpoints_[port]);
202 202
203 return endpoints_[port]->AddAwakable(awakable, context, force, signals, 203 return endpoints_[port]->AddAwakable(awakable, context, persistent, signals,
204 signals_state); 204 signals_state);
205 } 205 }
206 206
207 void MessagePipe::RemoveAwakable(unsigned port, 207 void MessagePipe::RemoveAwakable(unsigned port,
208 bool match_context, 208 bool match_context,
209 Awakable* awakable, 209 Awakable* awakable,
210 uint64_t context, 210 uint64_t context,
211 HandleSignalsState* signals_state) { 211 HandleSignalsState* signals_state) {
212 DCHECK(port == 0 || port == 1); 212 DCHECK(port == 0 || port == 1);
213 213
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 LOG(WARNING) << "Enqueueing null dispatcher"; 374 LOG(WARNING) << "Enqueueing null dispatcher";
375 handles->push_back(Handle()); 375 handles->push_back(Handle());
376 } 376 }
377 } 377 }
378 message->SetHandles(std::move(handles)); 378 message->SetHandles(std::move(handles));
379 return MOJO_RESULT_OK; 379 return MOJO_RESULT_OK;
380 } 380 }
381 381
382 } // namespace system 382 } // namespace system
383 } // namespace mojo 383 } // 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