| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/edk/system/data_pipe.h" | 8 #include "mojo/edk/system/data_pipe.h" |
| 9 #include "mojo/edk/system/memory.h" | 9 #include "mojo/edk/system/memory.h" |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 MojoResult DataPipeProducerDispatcher::BeginWriteDataImplNoLock( | 81 MojoResult DataPipeProducerDispatcher::BeginWriteDataImplNoLock( |
| 82 UserPointer<void*> buffer, | 82 UserPointer<void*> buffer, |
| 83 UserPointer<uint32_t> buffer_num_bytes, | 83 UserPointer<uint32_t> buffer_num_bytes, |
| 84 MojoWriteDataFlags flags) { | 84 MojoWriteDataFlags flags) { |
| 85 mutex().AssertHeld(); | 85 mutex().AssertHeld(); |
| 86 | 86 |
| 87 // This flag may not be used in two-phase mode. | 87 // This flag may not be used in two-phase mode. |
| 88 if ((flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE)) | 88 if ((flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE)) |
| 89 return MOJO_RESULT_INVALID_ARGUMENT; | 89 return MOJO_RESULT_INVALID_ARGUMENT; |
| 90 | 90 |
| 91 // TODO(vtl): Remove all-or-none support at lower levels. | 91 return data_pipe_->ProducerBeginWriteData(buffer, buffer_num_bytes); |
| 92 return data_pipe_->ProducerBeginWriteData(buffer, buffer_num_bytes, false); | |
| 93 } | 92 } |
| 94 | 93 |
| 95 MojoResult DataPipeProducerDispatcher::EndWriteDataImplNoLock( | 94 MojoResult DataPipeProducerDispatcher::EndWriteDataImplNoLock( |
| 96 uint32_t num_bytes_written) { | 95 uint32_t num_bytes_written) { |
| 97 mutex().AssertHeld(); | 96 mutex().AssertHeld(); |
| 98 | 97 |
| 99 return data_pipe_->ProducerEndWriteData(num_bytes_written); | 98 return data_pipe_->ProducerEndWriteData(num_bytes_written); |
| 100 } | 99 } |
| 101 | 100 |
| 102 HandleSignalsState DataPipeProducerDispatcher::GetHandleSignalsStateImplNoLock() | 101 HandleSignalsState DataPipeProducerDispatcher::GetHandleSignalsStateImplNoLock() |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return rv; | 142 return rv; |
| 144 } | 143 } |
| 145 | 144 |
| 146 bool DataPipeProducerDispatcher::IsBusyNoLock() const { | 145 bool DataPipeProducerDispatcher::IsBusyNoLock() const { |
| 147 mutex().AssertHeld(); | 146 mutex().AssertHeld(); |
| 148 return data_pipe_->ProducerIsBusy(); | 147 return data_pipe_->ProducerIsBusy(); |
| 149 } | 148 } |
| 150 | 149 |
| 151 } // namespace system | 150 } // namespace system |
| 152 } // namespace mojo | 151 } // namespace mojo |
| OLD | NEW |