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

Unified Diff: third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.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/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);
};

Powered by Google App Engine
This is Rietveld 408576698