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

Unified Diff: third_party/mojo/src/mojo/edk/system/channel_endpoint.cc

Issue 1311613002: Revert of Update mojo sdk to rev c02a28868825edfa57ab77947b8cb15e741c5598 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/edk/system/channel_endpoint.cc
diff --git a/third_party/mojo/src/mojo/edk/system/channel_endpoint.cc b/third_party/mojo/src/mojo/edk/system/channel_endpoint.cc
index 038de8dfa15cc90273962281a2d5d709a688b919..113bbd58f5d9ec7193d3939101cc4b6232bb8d4d 100644
--- a/third_party/mojo/src/mojo/edk/system/channel_endpoint.cc
+++ b/third_party/mojo/src/mojo/edk/system/channel_endpoint.cc
@@ -29,7 +29,7 @@
bool ChannelEndpoint::EnqueueMessage(scoped_ptr<MessageInTransit> message) {
DCHECK(message);
- MutexLocker locker(&mutex_);
+ base::AutoLock locker(lock_);
switch (channel_state_) {
case ChannelState::NOT_YET_ATTACHED:
@@ -53,7 +53,7 @@
unsigned client_port) {
DCHECK(client);
- MutexLocker locker(&mutex_);
+ base::AutoLock locker(lock_);
DCHECK(client_);
DCHECK(client != client_.get() || client_port != client_port_);
client_ = client;
@@ -62,7 +62,7 @@
}
void ChannelEndpoint::DetachFromClient() {
- MutexLocker locker(&mutex_);
+ base::AutoLock locker(lock_);
DCHECK(client_);
client_ = nullptr;
@@ -79,7 +79,7 @@
DCHECK(local_id.is_valid());
DCHECK(remote_id.is_valid());
- MutexLocker locker(&mutex_);
+ base::AutoLock locker(lock_);
DCHECK(channel_state_ == ChannelState::NOT_YET_ATTACHED);
DCHECK(!channel_);
DCHECK(!local_id_.is_valid());
@@ -119,7 +119,7 @@
scoped_refptr<ChannelEndpointClient> client;
unsigned client_port = 0;
{
- MutexLocker locker(&mutex_);
+ base::AutoLock locker(lock_);
if (client_) {
// Take a ref, and call |OnDetachFromChannel()| outside the lock.
@@ -155,7 +155,7 @@
bool ChannelEndpoint::WriteMessageNoLock(scoped_ptr<MessageInTransit> message) {
DCHECK(message);
- mutex_.AssertHeld();
+ lock_.AssertAcquired();
DCHECK(channel_);
DCHECK(local_id_.is_valid());
@@ -187,7 +187,7 @@
// -- impose significant cost in the common case.)
for (;;) {
{
- MutexLocker locker(&mutex_);
+ base::AutoLock locker(lock_);
if (!channel_ || !client_) {
// This isn't a failure per se. (It just means that, e.g., the other end
// of the message point closed first.)
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/channel_endpoint.h ('k') | third_party/mojo/src/mojo/edk/system/channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698