| 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/system/data_pipe_consumer_dispatcher.h" | 5 #include "mojo/system/data_pipe_consumer_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/system/data_pipe.h" | 8 #include "mojo/system/data_pipe.h" |
| 9 #include "mojo/system/memory.h" | 9 #include "mojo/system/memory.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 void DataPipeConsumerDispatcher::CancelAllWaitersNoLock() { | 31 void DataPipeConsumerDispatcher::CancelAllWaitersNoLock() { |
| 32 lock().AssertAcquired(); | 32 lock().AssertAcquired(); |
| 33 data_pipe_->ConsumerCancelAllWaiters(); | 33 data_pipe_->ConsumerCancelAllWaiters(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void DataPipeConsumerDispatcher::CloseImplNoLock() { | 36 void DataPipeConsumerDispatcher::CloseImplNoLock() { |
| 37 lock().AssertAcquired(); | 37 lock().AssertAcquired(); |
| 38 data_pipe_->ConsumerClose(); | 38 data_pipe_->ConsumerClose(); |
| 39 data_pipe_ = NULL; | 39 data_pipe_ = nullptr; |
| 40 } | 40 } |
| 41 | 41 |
| 42 scoped_refptr<Dispatcher> | 42 scoped_refptr<Dispatcher> |
| 43 DataPipeConsumerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() { | 43 DataPipeConsumerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() { |
| 44 lock().AssertAcquired(); | 44 lock().AssertAcquired(); |
| 45 | 45 |
| 46 scoped_refptr<DataPipeConsumerDispatcher> rv = | 46 scoped_refptr<DataPipeConsumerDispatcher> rv = |
| 47 new DataPipeConsumerDispatcher(); | 47 new DataPipeConsumerDispatcher(); |
| 48 rv->Init(data_pipe_); | 48 rv->Init(data_pipe_); |
| 49 data_pipe_ = NULL; | 49 data_pipe_ = nullptr; |
| 50 return scoped_refptr<Dispatcher>(rv.get()); | 50 return scoped_refptr<Dispatcher>(rv.get()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 MojoResult DataPipeConsumerDispatcher::ReadDataImplNoLock( | 53 MojoResult DataPipeConsumerDispatcher::ReadDataImplNoLock( |
| 54 UserPointer<void> elements, | 54 UserPointer<void> elements, |
| 55 UserPointer<uint32_t> num_bytes, | 55 UserPointer<uint32_t> num_bytes, |
| 56 MojoReadDataFlags flags) { | 56 MojoReadDataFlags flags) { |
| 57 lock().AssertAcquired(); | 57 lock().AssertAcquired(); |
| 58 | 58 |
| 59 if ((flags & MOJO_READ_DATA_FLAG_DISCARD)) { | 59 if ((flags & MOJO_READ_DATA_FLAG_DISCARD)) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 data_pipe_->ConsumerRemoveWaiter(waiter, signals_state); | 121 data_pipe_->ConsumerRemoveWaiter(waiter, signals_state); |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool DataPipeConsumerDispatcher::IsBusyNoLock() const { | 124 bool DataPipeConsumerDispatcher::IsBusyNoLock() const { |
| 125 lock().AssertAcquired(); | 125 lock().AssertAcquired(); |
| 126 return data_pipe_->ConsumerIsBusy(); | 126 return data_pipe_->ConsumerIsBusy(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace system | 129 } // namespace system |
| 130 } // namespace mojo | 130 } // namespace mojo |
| OLD | NEW |