| 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_consumer_dispatcher.h" | 5 #include "mojo/edk/system/data_pipe_consumer_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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 signals_state); | 203 signals_state); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void DataPipeConsumerDispatcher::RemoveAwakableImplNoLock( | 206 void DataPipeConsumerDispatcher::RemoveAwakableImplNoLock( |
| 207 Awakable* awakable, | 207 Awakable* awakable, |
| 208 HandleSignalsState* signals_state) { | 208 HandleSignalsState* signals_state) { |
| 209 mutex().AssertHeld(); | 209 mutex().AssertHeld(); |
| 210 data_pipe_->ConsumerRemoveAwakable(awakable, signals_state); | 210 data_pipe_->ConsumerRemoveAwakable(awakable, signals_state); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void DataPipeConsumerDispatcher::RemoveAwakableWithContextImplNoLock( |
| 214 Awakable* awakable, |
| 215 uint64_t context, |
| 216 HandleSignalsState* signals_state) { |
| 217 mutex().AssertHeld(); |
| 218 data_pipe_->ConsumerRemoveAwakableWithContext(awakable, context, |
| 219 signals_state); |
| 220 } |
| 221 |
| 213 void DataPipeConsumerDispatcher::StartSerializeImplNoLock( | 222 void DataPipeConsumerDispatcher::StartSerializeImplNoLock( |
| 214 Channel* channel, | 223 Channel* channel, |
| 215 size_t* max_size, | 224 size_t* max_size, |
| 216 size_t* max_platform_handles) { | 225 size_t* max_platform_handles) { |
| 217 AssertHasOneRef(); // Only one ref => no need to take the lock. | 226 AssertHasOneRef(); // Only one ref => no need to take the lock. |
| 218 data_pipe_->ConsumerStartSerialize(channel, max_size, max_platform_handles); | 227 data_pipe_->ConsumerStartSerialize(channel, max_size, max_platform_handles); |
| 219 } | 228 } |
| 220 | 229 |
| 221 bool DataPipeConsumerDispatcher::EndSerializeAndCloseImplNoLock( | 230 bool DataPipeConsumerDispatcher::EndSerializeAndCloseImplNoLock( |
| 222 Channel* channel, | 231 Channel* channel, |
| 223 void* destination, | 232 void* destination, |
| 224 size_t* actual_size, | 233 size_t* actual_size, |
| 225 std::vector<ScopedPlatformHandle>* platform_handles) { | 234 std::vector<ScopedPlatformHandle>* platform_handles) { |
| 226 AssertHasOneRef(); // Only one ref => no need to take the lock. | 235 AssertHasOneRef(); // Only one ref => no need to take the lock. |
| 227 | 236 |
| 228 bool rv = data_pipe_->ConsumerEndSerialize(channel, destination, actual_size, | 237 bool rv = data_pipe_->ConsumerEndSerialize(channel, destination, actual_size, |
| 229 platform_handles); | 238 platform_handles); |
| 230 data_pipe_ = nullptr; | 239 data_pipe_ = nullptr; |
| 231 return rv; | 240 return rv; |
| 232 } | 241 } |
| 233 | 242 |
| 234 } // namespace system | 243 } // namespace system |
| 235 } // namespace mojo | 244 } // namespace mojo |
| OLD | NEW |