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

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

Issue 2068483002: Add an unconditional version of DispatcherAddAwakable(): AddAwakableUnconditional(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops 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 MojoHandleSignals signals, 194 MojoHandleSignals signals,
195 bool force,
195 uint64_t context, 196 uint64_t context,
196 HandleSignalsState* signals_state) { 197 HandleSignalsState* signals_state) {
197 DCHECK(port == 0 || port == 1); 198 DCHECK(port == 0 || port == 1);
198 199
199 MutexLocker locker(&mutex_); 200 MutexLocker locker(&mutex_);
200 DCHECK(endpoints_[port]); 201 DCHECK(endpoints_[port]);
201 202
202 return endpoints_[port]->AddAwakable(awakable, signals, context, 203 return endpoints_[port]->AddAwakable(awakable, signals, force, context,
203 signals_state); 204 signals_state);
204 } 205 }
205 206
206 void MessagePipe::RemoveAwakable(unsigned port, 207 void MessagePipe::RemoveAwakable(unsigned port,
207 Awakable* awakable, 208 Awakable* awakable,
208 HandleSignalsState* signals_state) { 209 HandleSignalsState* signals_state) {
209 DCHECK(port == 0 || port == 1); 210 DCHECK(port == 0 || port == 1);
210 211
211 MutexLocker locker(&mutex_); 212 MutexLocker locker(&mutex_);
212 DCHECK(endpoints_[port]); 213 DCHECK(endpoints_[port]);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 LOG(WARNING) << "Enqueueing null dispatcher"; 371 LOG(WARNING) << "Enqueueing null dispatcher";
371 handles->push_back(Handle()); 372 handles->push_back(Handle());
372 } 373 }
373 } 374 }
374 message->SetHandles(std::move(handles)); 375 message->SetHandles(std::move(handles));
375 return MOJO_RESULT_OK; 376 return MOJO_RESULT_OK;
376 } 377 }
377 378
378 } // namespace system 379 } // namespace system
379 } // namespace mojo 380 } // 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