| 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 "base/test/test_io_thread.h" | 5 #include "base/test/test_io_thread.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" |
| 8 | 9 |
| 9 namespace base { | 10 namespace base { |
| 10 | 11 |
| 11 TestIOThread::TestIOThread(Mode mode) | 12 TestIOThread::TestIOThread(Mode mode) |
| 12 : io_thread_("test_io_thread"), io_thread_started_(false) { | 13 : io_thread_("test_io_thread"), io_thread_started_(false) { |
| 13 switch (mode) { | 14 switch (mode) { |
| 14 case kAutoStart: | 15 case kAutoStart: |
| 15 Start(); | 16 Start(); |
| 16 return; | 17 return; |
| 17 case kManualStart: | 18 case kManualStart: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 36 io_thread_.Stop(); | 37 io_thread_.Stop(); |
| 37 io_thread_started_ = false; | 38 io_thread_started_ = false; |
| 38 } | 39 } |
| 39 | 40 |
| 40 void TestIOThread::PostTask(const tracked_objects::Location& from_here, | 41 void TestIOThread::PostTask(const tracked_objects::Location& from_here, |
| 41 const base::Closure& task) { | 42 const base::Closure& task) { |
| 42 task_runner()->PostTask(from_here, task); | 43 task_runner()->PostTask(from_here, task); |
| 43 } | 44 } |
| 44 | 45 |
| 45 } // namespace base | 46 } // namespace base |
| OLD | NEW |