| 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/data_pipe_producer_dispatcher.h" | 5 #include "mojo/edk/system/data_pipe_producer_dispatcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/edk/system/data_pipe.h" | 10 #include "mojo/edk/system/data_pipe.h" |
| 11 #include "mojo/edk/system/memory.h" | 11 #include "mojo/edk/system/memory.h" |
| 12 | 12 |
| 13 using mojo::util::RefPtr; |
| 14 |
| 13 namespace mojo { | 15 namespace mojo { |
| 14 namespace system { | 16 namespace system { |
| 15 | 17 |
| 16 void DataPipeProducerDispatcher::Init(RefPtr<DataPipe>&& data_pipe) { | 18 void DataPipeProducerDispatcher::Init(RefPtr<DataPipe>&& data_pipe) { |
| 17 DCHECK(data_pipe); | 19 DCHECK(data_pipe); |
| 18 data_pipe_ = std::move(data_pipe); | 20 data_pipe_ = std::move(data_pipe); |
| 19 } | 21 } |
| 20 | 22 |
| 21 Dispatcher::Type DataPipeProducerDispatcher::GetType() const { | 23 Dispatcher::Type DataPipeProducerDispatcher::GetType() const { |
| 22 return Type::DATA_PIPE_PRODUCER; | 24 return Type::DATA_PIPE_PRODUCER; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return rv; | 145 return rv; |
| 144 } | 146 } |
| 145 | 147 |
| 146 bool DataPipeProducerDispatcher::IsBusyNoLock() const { | 148 bool DataPipeProducerDispatcher::IsBusyNoLock() const { |
| 147 mutex().AssertHeld(); | 149 mutex().AssertHeld(); |
| 148 return data_pipe_->ProducerIsBusy(); | 150 return data_pipe_->ProducerIsBusy(); |
| 149 } | 151 } |
| 150 | 152 |
| 151 } // namespace system | 153 } // namespace system |
| 152 } // namespace mojo | 154 } // namespace mojo |
| OLD | NEW |