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

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

Issue 2056763003: EDK: Change Awakable::Awake()'s context, etc., to be a uint64_t. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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/dispatcher.h ('k') | mojo/edk/system/local_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/dispatcher.h" 5 #include "mojo/edk/system/dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/edk/system/configuration.h" 8 #include "mojo/edk/system/configuration.h"
9 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h" 9 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
10 #include "mojo/edk/system/data_pipe_producer_dispatcher.h" 10 #include "mojo/edk/system/data_pipe_producer_dispatcher.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 HandleSignalsState Dispatcher::GetHandleSignalsState() const { 275 HandleSignalsState Dispatcher::GetHandleSignalsState() const {
276 MutexLocker locker(&mutex_); 276 MutexLocker locker(&mutex_);
277 if (is_closed_) 277 if (is_closed_)
278 return HandleSignalsState(); 278 return HandleSignalsState();
279 279
280 return GetHandleSignalsStateImplNoLock(); 280 return GetHandleSignalsStateImplNoLock();
281 } 281 }
282 282
283 MojoResult Dispatcher::AddAwakable(Awakable* awakable, 283 MojoResult Dispatcher::AddAwakable(Awakable* awakable,
284 MojoHandleSignals signals, 284 MojoHandleSignals signals,
285 uint32_t context, 285 uint64_t context,
286 HandleSignalsState* signals_state) { 286 HandleSignalsState* signals_state) {
287 MutexLocker locker(&mutex_); 287 MutexLocker locker(&mutex_);
288 if (is_closed_) { 288 if (is_closed_) {
289 if (signals_state) 289 if (signals_state)
290 *signals_state = HandleSignalsState(); 290 *signals_state = HandleSignalsState();
291 return MOJO_RESULT_INVALID_ARGUMENT; 291 return MOJO_RESULT_INVALID_ARGUMENT;
292 } 292 }
293 293
294 return AddAwakableImplNoLock(awakable, signals, context, signals_state); 294 return AddAwakableImplNoLock(awakable, signals, context, signals_state);
295 } 295 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 mutex_.AssertHeld(); 476 mutex_.AssertHeld();
477 DCHECK(!is_closed_); 477 DCHECK(!is_closed_);
478 // By default, waiting isn't supported. Only dispatchers that can be waited on 478 // By default, waiting isn't supported. Only dispatchers that can be waited on
479 // will do something nontrivial. 479 // will do something nontrivial.
480 return HandleSignalsState(); 480 return HandleSignalsState();
481 } 481 }
482 482
483 MojoResult Dispatcher::AddAwakableImplNoLock( 483 MojoResult Dispatcher::AddAwakableImplNoLock(
484 Awakable* /*awakable*/, 484 Awakable* /*awakable*/,
485 MojoHandleSignals /*signals*/, 485 MojoHandleSignals /*signals*/,
486 uint32_t /*context*/, 486 uint64_t /*context*/,
487 HandleSignalsState* signals_state) { 487 HandleSignalsState* signals_state) {
488 mutex_.AssertHeld(); 488 mutex_.AssertHeld();
489 DCHECK(!is_closed_); 489 DCHECK(!is_closed_);
490 // By default, waiting isn't supported. Only dispatchers that can be waited on 490 // By default, waiting isn't supported. Only dispatchers that can be waited on
491 // will do something nontrivial. 491 // will do something nontrivial.
492 if (signals_state) 492 if (signals_state)
493 *signals_state = HandleSignalsState(); 493 *signals_state = HandleSignalsState();
494 return MOJO_RESULT_FAILED_PRECONDITION; 494 return MOJO_RESULT_FAILED_PRECONDITION;
495 } 495 }
496 496
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 // want to remove or weaken). 576 // want to remove or weaken).
577 MutexLocker locker(&mutex_); 577 MutexLocker locker(&mutex_);
578 #endif 578 #endif
579 579
580 return EndSerializeAndCloseImplNoLock(channel, destination, actual_size, 580 return EndSerializeAndCloseImplNoLock(channel, destination, actual_size,
581 platform_handles); 581 platform_handles);
582 } 582 }
583 583
584 } // namespace system 584 } // namespace system
585 } // namespace mojo 585 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/dispatcher.h ('k') | mojo/edk/system/local_message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698