Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: mojo/edk/system/data_pipe_producer_dispatcher.cc

Issue 1374463002: Remove support for "all or none" two-phase data pipe read/write. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return data_pipe_->ProducerWriteData( 77 return data_pipe_->ProducerWriteData(
78 elements, num_bytes, (flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE)); 78 elements, num_bytes, (flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE));
79 } 79 }
80 80
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 return data_pipe_->ProducerBeginWriteData( 87 // This flag may not be used in two-phase mode.
88 buffer, buffer_num_bytes, (flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE)); 88 if ((flags & MOJO_WRITE_DATA_FLAG_ALL_OR_NONE))
89 return MOJO_RESULT_INVALID_ARGUMENT;
90
91 // TODO(vtl): Remove all-or-none support at lower levels.
92 return data_pipe_->ProducerBeginWriteData(buffer, buffer_num_bytes, false);
89 } 93 }
90 94
91 MojoResult DataPipeProducerDispatcher::EndWriteDataImplNoLock( 95 MojoResult DataPipeProducerDispatcher::EndWriteDataImplNoLock(
92 uint32_t num_bytes_written) { 96 uint32_t num_bytes_written) {
93 mutex().AssertHeld(); 97 mutex().AssertHeld();
94 98
95 return data_pipe_->ProducerEndWriteData(num_bytes_written); 99 return data_pipe_->ProducerEndWriteData(num_bytes_written);
96 } 100 }
97 101
98 HandleSignalsState DataPipeProducerDispatcher::GetHandleSignalsStateImplNoLock() 102 HandleSignalsState DataPipeProducerDispatcher::GetHandleSignalsStateImplNoLock()
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return rv; 143 return rv;
140 } 144 }
141 145
142 bool DataPipeProducerDispatcher::IsBusyNoLock() const { 146 bool DataPipeProducerDispatcher::IsBusyNoLock() const {
143 mutex().AssertHeld(); 147 mutex().AssertHeld();
144 return data_pipe_->ProducerIsBusy(); 148 return data_pipe_->ProducerIsBusy();
145 } 149 }
146 150
147 } // namespace system 151 } // namespace system
148 } // namespace mojo 152 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698