| 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" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 data_pipe_->ProducerCancelAllAwakables(); | 65 data_pipe_->ProducerCancelAllAwakables(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void DataPipeProducerDispatcher::CloseImplNoLock() { | 68 void DataPipeProducerDispatcher::CloseImplNoLock() { |
| 69 mutex().AssertHeld(); | 69 mutex().AssertHeld(); |
| 70 data_pipe_->ProducerClose(); | 70 data_pipe_->ProducerClose(); |
| 71 data_pipe_ = nullptr; | 71 data_pipe_ = nullptr; |
| 72 } | 72 } |
| 73 | 73 |
| 74 RefPtr<Dispatcher> | 74 RefPtr<Dispatcher> |
| 75 DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() { | 75 DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( |
| 76 MessagePipe* /*message_pipe*/, |
| 77 unsigned /*port*/) { |
| 76 mutex().AssertHeld(); | 78 mutex().AssertHeld(); |
| 77 | 79 |
| 80 CancelAllAwakablesNoLock(); |
| 81 |
| 78 auto dispatcher = DataPipeProducerDispatcher::Create(); | 82 auto dispatcher = DataPipeProducerDispatcher::Create(); |
| 79 dispatcher->Init(std::move(data_pipe_)); | 83 dispatcher->Init(std::move(data_pipe_)); |
| 80 return dispatcher; | 84 return dispatcher; |
| 81 } | 85 } |
| 82 | 86 |
| 83 MojoResult DataPipeProducerDispatcher::SetDataPipeProducerOptionsImplNoLock( | 87 MojoResult DataPipeProducerDispatcher::SetDataPipeProducerOptionsImplNoLock( |
| 84 UserPointer<const MojoDataPipeProducerOptions> options) { | 88 UserPointer<const MojoDataPipeProducerOptions> options) { |
| 85 mutex().AssertHeld(); | 89 mutex().AssertHeld(); |
| 86 | 90 |
| 87 // The default of 0 means 1 element (however big that is). | 91 // The default of 0 means 1 element (however big that is). |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return rv; | 202 return rv; |
| 199 } | 203 } |
| 200 | 204 |
| 201 bool DataPipeProducerDispatcher::IsBusyNoLock() const { | 205 bool DataPipeProducerDispatcher::IsBusyNoLock() const { |
| 202 mutex().AssertHeld(); | 206 mutex().AssertHeld(); |
| 203 return data_pipe_->ProducerIsBusy(); | 207 return data_pipe_->ProducerIsBusy(); |
| 204 } | 208 } |
| 205 | 209 |
| 206 } // namespace system | 210 } // namespace system |
| 207 } // namespace mojo | 211 } // namespace mojo |
| OLD | NEW |