Index: third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc |
diff --git a/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc b/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc |
index eaa1825a9f4fac9890c632f23b7f0036ae161ae0..cd091b1d2e2fee09a49157593a6ff4ce1279cf2c 100644 |
--- a/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc |
+++ b/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc |
@@ -23,7 +23,7 @@ |
} |
scoped_refptr<MessagePipe> IncomingEndpoint::ConvertToMessagePipe() { |
- MutexLocker locker(&mutex_); |
+ base::AutoLock locker(lock_); |
scoped_refptr<MessagePipe> message_pipe( |
MessagePipe::CreateLocalProxyFromExisting(&message_queue_, |
endpoint_.get())); |
@@ -35,7 +35,7 @@ |
scoped_refptr<DataPipe> IncomingEndpoint::ConvertToDataPipeProducer( |
const MojoCreateDataPipeOptions& validated_options, |
size_t consumer_num_bytes) { |
- MutexLocker locker(&mutex_); |
+ base::AutoLock locker(lock_); |
scoped_refptr<DataPipe> data_pipe(DataPipe::CreateRemoteConsumerFromExisting( |
validated_options, consumer_num_bytes, &message_queue_, endpoint_.get())); |
DCHECK(message_queue_.IsEmpty()); |
@@ -45,7 +45,7 @@ |
scoped_refptr<DataPipe> IncomingEndpoint::ConvertToDataPipeConsumer( |
const MojoCreateDataPipeOptions& validated_options) { |
- MutexLocker locker(&mutex_); |
+ base::AutoLock locker(lock_); |
scoped_refptr<DataPipe> data_pipe(DataPipe::CreateRemoteProducerFromExisting( |
validated_options, &message_queue_, endpoint_.get())); |
DCHECK(message_queue_.IsEmpty()); |
@@ -54,7 +54,7 @@ |
} |
void IncomingEndpoint::Close() { |
- MutexLocker locker(&mutex_); |
+ base::AutoLock locker(lock_); |
if (endpoint_) { |
endpoint_->DetachFromClient(); |
endpoint_ = nullptr; |
@@ -63,7 +63,7 @@ |
bool IncomingEndpoint::OnReadMessage(unsigned /*port*/, |
MessageInTransit* message) { |
- MutexLocker locker(&mutex_); |
+ base::AutoLock locker(lock_); |
if (!endpoint_) |
return false; |