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

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

Issue 1310103002: 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 c9a15108a6975034840965decf0ac174a5a1e561..051e10829c2bb06d3f17b031ce1904057044d89d 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,9 +28,11 @@ class MockSimpleDispatcher final : public SimpleDispatcher {
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) {
- base::AutoLock locker(lock());
+ MutexLocker locker(&mutex());
// Any new signals that are set should be satisfiable.
CHECK_EQ(new_satisfied_signals & ~state_.satisfied_signals,
@@ -45,7 +47,7 @@ class MockSimpleDispatcher final : public SimpleDispatcher {
}
void SetSatisfiableSignals(MojoHandleSignals new_satisfiable_signals) {
- base::AutoLock locker(lock());
+ MutexLocker locker(&mutex());
// Satisfied implies satisfiable.
CHECK_EQ(new_satisfiable_signals & state_.satisfied_signals,
@@ -66,19 +68,17 @@ class MockSimpleDispatcher final : public SimpleDispatcher {
scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock()
override {
- scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher());
- rv->state_ = state_;
+ scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher(state_));
return scoped_refptr<Dispatcher>(rv.get());
}
// |Dispatcher| override:
HandleSignalsState GetHandleSignalsStateImplNoLock() const override {
- lock().AssertAcquired();
+ mutex().AssertHeld();
return state_;
}
- // Protected by |lock()|:
- HandleSignalsState state_;
+ HandleSignalsState state_ MOJO_GUARDED_BY(mutex());
MOJO_DISALLOW_COPY_AND_ASSIGN(MockSimpleDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698