| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/dispatcher.h" | 5 #include "mojo/edk/system/dispatcher.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Trivial subclass that makes the constructor public. | 23 // Trivial subclass that makes the constructor public. |
| 24 class TrivialDispatcher final : public Dispatcher { | 24 class TrivialDispatcher final : public Dispatcher { |
| 25 public: | 25 public: |
| 26 TrivialDispatcher() {} | 26 TrivialDispatcher() {} |
| 27 | 27 |
| 28 Type GetType() const override { return Type::UNKNOWN; } | 28 Type GetType() const override { return Type::UNKNOWN; } |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 friend class base::RefCountedThreadSafe<TrivialDispatcher>; | |
| 32 ~TrivialDispatcher() override {} | 31 ~TrivialDispatcher() override {} |
| 33 | 32 |
| 34 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() | 33 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() |
| 35 override { | 34 override { |
| 36 mutex().AssertHeld(); | 35 mutex().AssertHeld(); |
| 37 return scoped_refptr<Dispatcher>(new TrivialDispatcher()); | 36 return scoped_refptr<Dispatcher>(new TrivialDispatcher()); |
| 38 } | 37 } |
| 39 | 38 |
| 40 MOJO_DISALLOW_COPY_AND_ASSIGN(TrivialDispatcher); | 39 MOJO_DISALLOW_COPY_AND_ASSIGN(TrivialDispatcher); |
| 41 }; | 40 }; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 event.Signal(); | 296 event.Signal(); |
| 298 } // Joins all the threads. | 297 } // Joins all the threads. |
| 299 | 298 |
| 300 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); | 299 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); |
| 301 } | 300 } |
| 302 } | 301 } |
| 303 | 302 |
| 304 } // namespace | 303 } // namespace |
| 305 } // namespace system | 304 } // namespace system |
| 306 } // namespace mojo | 305 } // namespace mojo |
| OLD | NEW |