| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 signals_state); | 178 signals_state); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void DataPipeProducerDispatcher::RemoveAwakableImplNoLock( | 181 void DataPipeProducerDispatcher::RemoveAwakableImplNoLock( |
| 182 Awakable* awakable, | 182 Awakable* awakable, |
| 183 HandleSignalsState* signals_state) { | 183 HandleSignalsState* signals_state) { |
| 184 mutex().AssertHeld(); | 184 mutex().AssertHeld(); |
| 185 data_pipe_->ProducerRemoveAwakable(awakable, signals_state); | 185 data_pipe_->ProducerRemoveAwakable(awakable, signals_state); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void DataPipeProducerDispatcher::RemoveAwakableWithContextImplNoLock( |
| 189 Awakable* awakable, |
| 190 uint64_t context, |
| 191 HandleSignalsState* signals_state) { |
| 192 mutex().AssertHeld(); |
| 193 data_pipe_->ProducerRemoveAwakableWithContext(awakable, context, |
| 194 signals_state); |
| 195 } |
| 196 |
| 188 void DataPipeProducerDispatcher::StartSerializeImplNoLock( | 197 void DataPipeProducerDispatcher::StartSerializeImplNoLock( |
| 189 Channel* channel, | 198 Channel* channel, |
| 190 size_t* max_size, | 199 size_t* max_size, |
| 191 size_t* max_platform_handles) { | 200 size_t* max_platform_handles) { |
| 192 AssertHasOneRef(); // Only one ref => no need to take the lock. | 201 AssertHasOneRef(); // Only one ref => no need to take the lock. |
| 193 data_pipe_->ProducerStartSerialize(channel, max_size, max_platform_handles); | 202 data_pipe_->ProducerStartSerialize(channel, max_size, max_platform_handles); |
| 194 } | 203 } |
| 195 | 204 |
| 196 bool DataPipeProducerDispatcher::EndSerializeAndCloseImplNoLock( | 205 bool DataPipeProducerDispatcher::EndSerializeAndCloseImplNoLock( |
| 197 Channel* channel, | 206 Channel* channel, |
| 198 void* destination, | 207 void* destination, |
| 199 size_t* actual_size, | 208 size_t* actual_size, |
| 200 std::vector<ScopedPlatformHandle>* platform_handles) { | 209 std::vector<ScopedPlatformHandle>* platform_handles) { |
| 201 AssertHasOneRef(); // Only one ref => no need to take the lock. | 210 AssertHasOneRef(); // Only one ref => no need to take the lock. |
| 202 | 211 |
| 203 bool rv = data_pipe_->ProducerEndSerialize(channel, destination, actual_size, | 212 bool rv = data_pipe_->ProducerEndSerialize(channel, destination, actual_size, |
| 204 platform_handles); | 213 platform_handles); |
| 205 data_pipe_ = nullptr; | 214 data_pipe_ = nullptr; |
| 206 return rv; | 215 return rv; |
| 207 } | 216 } |
| 208 | 217 |
| 209 } // namespace system | 218 } // namespace system |
| 210 } // namespace mojo | 219 } // namespace mojo |
| OLD | NEW |