Index: third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.cc |
diff --git a/third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.cc b/third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.cc |
index 051e10829c2bb06d3f17b031ce1904057044d89d..c9a15108a6975034840965decf0ac174a5a1e561 100644 |
--- a/third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.cc |
+++ b/third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.cc |
@@ -28,11 +28,9 @@ |
MockSimpleDispatcher() |
: state_(MOJO_HANDLE_SIGNAL_NONE, |
MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE) {} |
- explicit MockSimpleDispatcher(const HandleSignalsState& state) |
- : state_(state) {} |
void SetSatisfiedSignals(MojoHandleSignals new_satisfied_signals) { |
- MutexLocker locker(&mutex()); |
+ base::AutoLock locker(lock()); |
// Any new signals that are set should be satisfiable. |
CHECK_EQ(new_satisfied_signals & ~state_.satisfied_signals, |
@@ -47,7 +45,7 @@ |
} |
void SetSatisfiableSignals(MojoHandleSignals new_satisfiable_signals) { |
- MutexLocker locker(&mutex()); |
+ base::AutoLock locker(lock()); |
// Satisfied implies satisfiable. |
CHECK_EQ(new_satisfiable_signals & state_.satisfied_signals, |
@@ -68,17 +66,19 @@ |
scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() |
override { |
- scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher(state_)); |
+ scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher()); |
+ rv->state_ = state_; |
return scoped_refptr<Dispatcher>(rv.get()); |
} |
// |Dispatcher| override: |
HandleSignalsState GetHandleSignalsStateImplNoLock() const override { |
- mutex().AssertHeld(); |
+ lock().AssertAcquired(); |
return state_; |
} |
- HandleSignalsState state_ MOJO_GUARDED_BY(mutex()); |
+ // Protected by |lock()|: |
+ HandleSignalsState state_; |
MOJO_DISALLOW_COPY_AND_ASSIGN(MockSimpleDispatcher); |
}; |