Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_EDK_TEST_SIMPLE_TEST_THREAD_ | |
| 6 #define MOJO_EDK_TEST_SIMPLE_TEST_THREAD_ | |
| 7 | |
| 8 #include "base/threading/simple_thread.h" | |
| 9 #include "mojo/public/cpp/system/macros.h" | |
| 10 | |
| 11 namespace mojo { | |
| 12 namespace test { | |
| 13 | |
| 14 // Class to help simple threads (with no message loops) in tests. | |
| 15 class SimpleTestThread : public base::DelegateSimpleThread::Delegate { | |
| 16 public: | |
| 17 SimpleTestThread(); | |
| 18 ~SimpleTestThread() override; | |
| 19 | |
| 20 // Starts the thread. | |
| 21 void Start(); | |
| 22 | |
| 23 // Joins the thread; this must be called if the thread was started. | |
| 24 void Join(); | |
| 25 | |
| 26 // Note: Subclasses must implement: | |
|
vardhan
2015/09/23 23:36:22
Could this note be above the class?
viettrungluu
2015/09/23 23:37:13
It could be, but it's sitting there as a placehold
| |
| 27 // virtual void Run() = 0; | |
| 28 // TODO(vtl): When we stop using |base::DelegateSimpleThread|, this will | |
| 29 // directly become part of our interface. | |
| 30 | |
| 31 private: | |
| 32 base::DelegateSimpleThread thread_; | |
| 33 | |
| 34 MOJO_DISALLOW_COPY_AND_ASSIGN(SimpleTestThread); | |
| 35 }; | |
| 36 | |
| 37 } // namespace test | |
| 38 } // namespace mojo | |
| 39 | |
| 40 #endif // MOJO_EDK_TEST_SIMPLE_TEST_THREAD_ | |
| OLD | NEW |