| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/edk/system/mock_simple_dispatcher.h" | 5 #include "mojo/edk/system/mock_simple_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/edk/util/thread_annotations.h" | 8 #include "mojo/edk/util/thread_annotations.h" |
| 9 | 9 |
| 10 using mojo::util::MakeRefCounted; | 10 using mojo::util::MakeRefCounted; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return; | 43 return; |
| 44 | 44 |
| 45 state_.satisfiable_signals = new_satisfiable_signals; | 45 state_.satisfiable_signals = new_satisfiable_signals; |
| 46 HandleSignalsStateChangedNoLock(); | 46 HandleSignalsStateChangedNoLock(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 Dispatcher::Type MockSimpleDispatcher::GetType() const { | 49 Dispatcher::Type MockSimpleDispatcher::GetType() const { |
| 50 return Type::UNKNOWN; | 50 return Type::UNKNOWN; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool MockSimpleDispatcher::SupportsEntrypointClass( |
| 54 EntrypointClass entrypoint_class) const { |
| 55 return false; |
| 56 } |
| 57 |
| 53 MockSimpleDispatcher::MockSimpleDispatcher( | 58 MockSimpleDispatcher::MockSimpleDispatcher( |
| 54 MojoHandleSignals satisfied_signals, | 59 MojoHandleSignals satisfied_signals, |
| 55 MojoHandleSignals satisfiable_signals) | 60 MojoHandleSignals satisfiable_signals) |
| 56 : state_(satisfied_signals, satisfiable_signals) {} | 61 : state_(satisfied_signals, satisfiable_signals) {} |
| 57 | 62 |
| 58 MockSimpleDispatcher::MockSimpleDispatcher(const HandleSignalsState& state) | 63 MockSimpleDispatcher::MockSimpleDispatcher(const HandleSignalsState& state) |
| 59 : state_(state) {} | 64 : state_(state) {} |
| 60 | 65 |
| 61 MockSimpleDispatcher::~MockSimpleDispatcher() {} | 66 MockSimpleDispatcher::~MockSimpleDispatcher() {} |
| 62 | 67 |
| 63 RefPtr<Dispatcher> | 68 RefPtr<Dispatcher> |
| 64 MockSimpleDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() | 69 MockSimpleDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() |
| 65 MOJO_NO_THREAD_SAFETY_ANALYSIS { | 70 MOJO_NO_THREAD_SAFETY_ANALYSIS { |
| 66 return MakeRefCounted<MockSimpleDispatcher>(state_); | 71 return MakeRefCounted<MockSimpleDispatcher>(state_); |
| 67 } | 72 } |
| 68 | 73 |
| 69 HandleSignalsState MockSimpleDispatcher::GetHandleSignalsStateImplNoLock() | 74 HandleSignalsState MockSimpleDispatcher::GetHandleSignalsStateImplNoLock() |
| 70 const { | 75 const { |
| 71 mutex().AssertHeld(); | 76 mutex().AssertHeld(); |
| 72 return state_; | 77 return state_; |
| 73 } | 78 } |
| 74 | 79 |
| 75 } // namespace test | 80 } // namespace test |
| 76 } // namespace system | 81 } // namespace system |
| 77 } // namespace mojo | 82 } // namespace mojo |
| OLD | NEW |