Index: third_party/mojo/src/mojo/edk/system/core_test_base.cc |
diff --git a/third_party/mojo/src/mojo/edk/system/core_test_base.cc b/third_party/mojo/src/mojo/edk/system/core_test_base.cc |
index bfdcb1bcc39e26e2eae1e2b54321414640255781..2552fd28100674279a4af28c87a11b32504f3811 100644 |
--- a/third_party/mojo/src/mojo/edk/system/core_test_base.cc |
+++ b/third_party/mojo/src/mojo/edk/system/core_test_base.cc |
@@ -43,7 +43,7 @@ class MockDispatcher : public Dispatcher { |
// |Dispatcher| protected methods: |
void CloseImplNoLock() override { |
info_->IncrementCloseCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
} |
MojoResult WriteMessageImplNoLock( |
@@ -52,7 +52,7 @@ class MockDispatcher : public Dispatcher { |
std::vector<DispatcherTransport>* transports, |
MojoWriteMessageFlags /*flags*/) override { |
info_->IncrementWriteMessageCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
if (num_bytes > GetConfiguration().max_message_num_bytes) |
return MOJO_RESULT_RESOURCE_EXHAUSTED; |
@@ -69,7 +69,7 @@ class MockDispatcher : public Dispatcher { |
uint32_t* num_dispatchers, |
MojoReadMessageFlags /*flags*/) override { |
info_->IncrementReadMessageCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
if (num_dispatchers) { |
*num_dispatchers = 1; |
@@ -86,7 +86,7 @@ class MockDispatcher : public Dispatcher { |
UserPointer<uint32_t> /*num_bytes*/, |
MojoWriteDataFlags /*flags*/) override { |
info_->IncrementWriteDataCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return MOJO_RESULT_UNIMPLEMENTED; |
} |
@@ -95,13 +95,13 @@ class MockDispatcher : public Dispatcher { |
UserPointer<uint32_t> /*buffer_num_bytes*/, |
MojoWriteDataFlags /*flags*/) override { |
info_->IncrementBeginWriteDataCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return MOJO_RESULT_UNIMPLEMENTED; |
} |
MojoResult EndWriteDataImplNoLock(uint32_t /*num_bytes_written*/) override { |
info_->IncrementEndWriteDataCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return MOJO_RESULT_UNIMPLEMENTED; |
} |
@@ -109,7 +109,7 @@ class MockDispatcher : public Dispatcher { |
UserPointer<uint32_t> /*num_bytes*/, |
MojoReadDataFlags /*flags*/) override { |
info_->IncrementReadDataCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return MOJO_RESULT_UNIMPLEMENTED; |
} |
@@ -117,13 +117,13 @@ class MockDispatcher : public Dispatcher { |
UserPointer<uint32_t> /*buffer_num_bytes*/, |
MojoReadDataFlags /*flags*/) override { |
info_->IncrementBeginReadDataCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return MOJO_RESULT_UNIMPLEMENTED; |
} |
MojoResult EndReadDataImplNoLock(uint32_t /*num_bytes_read*/) override { |
info_->IncrementEndReadDataCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
return MOJO_RESULT_UNIMPLEMENTED; |
} |
@@ -132,7 +132,7 @@ class MockDispatcher : public Dispatcher { |
uint32_t /*context*/, |
HandleSignalsState* signals_state) override { |
info_->IncrementAddAwakableCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
if (signals_state) |
*signals_state = HandleSignalsState(); |
if (info_->IsAddAwakableAllowed()) { |
@@ -146,14 +146,14 @@ class MockDispatcher : public Dispatcher { |
void RemoveAwakableImplNoLock(Awakable* /*awakable*/, |
HandleSignalsState* signals_state) override { |
info_->IncrementRemoveAwakableCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
if (signals_state) |
*signals_state = HandleSignalsState(); |
} |
void CancelAllAwakablesNoLock() override { |
info_->IncrementCancelAllAwakablesCallCount(); |
- lock().AssertAcquired(); |
+ mutex().AssertHeld(); |
} |
scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() |
@@ -215,167 +215,167 @@ CoreTestBase_MockHandleInfo::~CoreTestBase_MockHandleInfo() { |
} |
unsigned CoreTestBase_MockHandleInfo::GetCtorCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return ctor_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetDtorCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return dtor_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetCloseCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return close_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetWriteMessageCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return write_message_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetReadMessageCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return read_message_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetWriteDataCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return write_data_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetBeginWriteDataCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return begin_write_data_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetEndWriteDataCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return end_write_data_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetReadDataCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return read_data_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetBeginReadDataCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return begin_read_data_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetEndReadDataCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return end_read_data_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetAddAwakableCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return add_awakable_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetRemoveAwakableCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return remove_awakable_call_count_; |
} |
unsigned CoreTestBase_MockHandleInfo::GetCancelAllAwakablesCallCount() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return cancel_all_awakables_call_count_; |
} |
size_t CoreTestBase_MockHandleInfo::GetAddedAwakableSize() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return added_awakables_.size(); |
} |
Awakable* CoreTestBase_MockHandleInfo::GetAddedAwakableAt(unsigned i) const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return added_awakables_[i]; |
} |
void CoreTestBase_MockHandleInfo::IncrementCtorCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
ctor_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementDtorCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
dtor_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementCloseCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
close_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementWriteMessageCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
write_message_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementReadMessageCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
read_message_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementWriteDataCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
write_data_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementBeginWriteDataCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
begin_write_data_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementEndWriteDataCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
end_write_data_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementReadDataCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
read_data_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementBeginReadDataCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
begin_read_data_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementEndReadDataCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
end_read_data_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementAddAwakableCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
add_awakable_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementRemoveAwakableCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
remove_awakable_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::IncrementCancelAllAwakablesCallCount() { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
cancel_all_awakables_call_count_++; |
} |
void CoreTestBase_MockHandleInfo::AllowAddAwakable(bool alllow) { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
add_awakable_allowed_ = alllow; |
} |
bool CoreTestBase_MockHandleInfo::IsAddAwakableAllowed() const { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
return add_awakable_allowed_; |
} |
void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) { |
- base::AutoLock locker(lock_); |
+ MutexLocker locker(&mutex_); |
added_awakables_.push_back(awakable); |
} |