Index: third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
diff --git a/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc b/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
index ac917d99bb472e65bfa5b249e966a1c7782f6e0d..5a1bafb450329c82b6245e0676aacd3c8933f20c 100644 |
--- a/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
+++ b/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
@@ -35,6 +35,11 @@ DataPipeConsumerDispatcher::Deserialize(Channel* channel, |
return dispatcher; |
} |
+DataPipe* DataPipeConsumerDispatcher::GetDataPipeForTest() { |
+ MutexLocker locker(&mutex()); |
+ return data_pipe_.get(); |
+} |
+ |
DataPipeConsumerDispatcher::DataPipeConsumerDispatcher() { |
} |
@@ -44,19 +49,19 @@ DataPipeConsumerDispatcher::~DataPipeConsumerDispatcher() { |
} |
void DataPipeConsumerDispatcher::CancelAllAwakablesNoLock() { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
data_pipe_->ConsumerCancelAllAwakables(); |
} |
void DataPipeConsumerDispatcher::CloseImplNoLock() { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
data_pipe_->ConsumerClose(); |
data_pipe_ = nullptr; |
} |
scoped_refptr<Dispatcher> |
DataPipeConsumerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
scoped_refptr<DataPipeConsumerDispatcher> rv = Create(); |
rv->Init(data_pipe_); |
@@ -68,7 +73,7 @@ MojoResult DataPipeConsumerDispatcher::ReadDataImplNoLock( |
UserPointer<void> elements, |
UserPointer<uint32_t> num_bytes, |
MojoReadDataFlags flags) { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
if ((flags & MOJO_READ_DATA_FLAG_DISCARD)) { |
// These flags are mutally exclusive. |
@@ -99,7 +104,7 @@ MojoResult DataPipeConsumerDispatcher::BeginReadDataImplNoLock( |
UserPointer<const void*> buffer, |
UserPointer<uint32_t> buffer_num_bytes, |
MojoReadDataFlags flags) { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
// These flags may not be used in two-phase mode. |
if ((flags & MOJO_READ_DATA_FLAG_DISCARD) || |
@@ -112,14 +117,14 @@ MojoResult DataPipeConsumerDispatcher::BeginReadDataImplNoLock( |
MojoResult DataPipeConsumerDispatcher::EndReadDataImplNoLock( |
uint32_t num_bytes_read) { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return data_pipe_->ConsumerEndReadData(num_bytes_read); |
} |
HandleSignalsState DataPipeConsumerDispatcher::GetHandleSignalsStateImplNoLock() |
const { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return data_pipe_->ConsumerGetHandleSignalsState(); |
} |
@@ -128,7 +133,7 @@ MojoResult DataPipeConsumerDispatcher::AddAwakableImplNoLock( |
MojoHandleSignals signals, |
uint32_t context, |
HandleSignalsState* signals_state) { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return data_pipe_->ConsumerAddAwakable(awakable, signals, context, |
signals_state); |
} |
@@ -136,7 +141,7 @@ MojoResult DataPipeConsumerDispatcher::AddAwakableImplNoLock( |
void DataPipeConsumerDispatcher::RemoveAwakableImplNoLock( |
Awakable* awakable, |
HandleSignalsState* signals_state) { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
data_pipe_->ConsumerRemoveAwakable(awakable, signals_state); |
} |
@@ -162,7 +167,7 @@ bool DataPipeConsumerDispatcher::EndSerializeAndCloseImplNoLock( |
} |
bool DataPipeConsumerDispatcher::IsBusyNoLock() const { |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return data_pipe_->ConsumerIsBusy(); |
} |