| OLD | NEW |
| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 void* /*destination*/, | 518 void* /*destination*/, |
| 519 size_t* /*actual_size*/, | 519 size_t* /*actual_size*/, |
| 520 std::vector<ScopedPlatformHandle>* /*platform_handles*/) { | 520 std::vector<ScopedPlatformHandle>* /*platform_handles*/) { |
| 521 AssertHasOneRef(); // Only one ref => no need to take the lock. | 521 AssertHasOneRef(); // Only one ref => no need to take the lock. |
| 522 DCHECK(is_closed_); | 522 DCHECK(is_closed_); |
| 523 // By default, serializing isn't supported, so just close. | 523 // By default, serializing isn't supported, so just close. |
| 524 CloseImplNoLock(); | 524 CloseImplNoLock(); |
| 525 return false; | 525 return false; |
| 526 } | 526 } |
| 527 | 527 |
| 528 bool Dispatcher::IsBusyNoLock() const { | |
| 529 mutex_.AssertHeld(); | |
| 530 DCHECK(!is_closed_); | |
| 531 // Most dispatchers support only "atomic" operations, so they are never busy | |
| 532 // (in this sense). | |
| 533 return false; | |
| 534 } | |
| 535 | |
| 536 void Dispatcher::CloseNoLock() { | 528 void Dispatcher::CloseNoLock() { |
| 537 mutex_.AssertHeld(); | 529 mutex_.AssertHeld(); |
| 538 DCHECK(!is_closed_); | 530 DCHECK(!is_closed_); |
| 539 | 531 |
| 540 is_closed_ = true; | 532 is_closed_ = true; |
| 541 CancelAllStateNoLock(); | 533 CancelAllStateNoLock(); |
| 542 CloseImplNoLock(); | 534 CloseImplNoLock(); |
| 543 } | 535 } |
| 544 | 536 |
| 545 RefPtr<Dispatcher> Dispatcher::CreateEquivalentDispatcherAndCloseNoLock( | 537 RefPtr<Dispatcher> Dispatcher::CreateEquivalentDispatcherAndCloseNoLock( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // want to remove or weaken). | 576 // want to remove or weaken). |
| 585 MutexLocker locker(&mutex_); | 577 MutexLocker locker(&mutex_); |
| 586 #endif | 578 #endif |
| 587 | 579 |
| 588 return EndSerializeAndCloseImplNoLock(channel, destination, actual_size, | 580 return EndSerializeAndCloseImplNoLock(channel, destination, actual_size, |
| 589 platform_handles); | 581 platform_handles); |
| 590 } | 582 } |
| 591 | 583 |
| 592 } // namespace system | 584 } // namespace system |
| 593 } // namespace mojo | 585 } // namespace mojo |
| OLD | NEW |