| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_BASE_AUTO_THREAD_TASK_RUNNER_H_ | 5 #ifndef REMOTING_BASE_AUTO_THREAD_TASK_RUNNER_H_ |
| 6 #define REMOTING_BASE_AUTO_THREAD_TASK_RUNNER_H_ | 6 #define REMOTING_BASE_AUTO_THREAD_TASK_RUNNER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 const base::Closure& stop_task); | 26 const base::Closure& stop_task); |
| 27 | 27 |
| 28 // SingleThreadTaskRunner implementation | 28 // SingleThreadTaskRunner implementation |
| 29 bool PostDelayedTask(const tracked_objects::Location& from_here, | 29 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 30 const base::Closure& task, | 30 const base::Closure& task, |
| 31 base::TimeDelta delay) override; | 31 base::TimeDelta delay) override; |
| 32 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 32 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 33 const base::Closure& task, | 33 const base::Closure& task, |
| 34 base::TimeDelta delay) override; | 34 base::TimeDelta delay) override; |
| 35 bool RunsTasksOnCurrentThread() const override; | 35 bool RunsTasksOnCurrentThread() const override; |
| 36 std::string GetThreadName() const override; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 ~AutoThreadTaskRunner() override; | 39 ~AutoThreadTaskRunner() override; |
| 39 | 40 |
| 40 // Task posted to |task_runner_| to notify the caller that it may be stopped. | 41 // Task posted to |task_runner_| to notify the caller that it may be stopped. |
| 41 base::Closure stop_task_; | 42 base::Closure stop_task_; |
| 42 | 43 |
| 43 // The wrapped task runner. | 44 // The wrapped task runner. |
| 44 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 45 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(AutoThreadTaskRunner); | 47 DISALLOW_COPY_AND_ASSIGN(AutoThreadTaskRunner); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace remoting | 50 } // namespace remoting |
| 50 | 51 |
| 51 #endif // REMOTING_BASE_AUTO_THREAD_TASK_RUNNER_H_ | 52 #endif // REMOTING_BASE_AUTO_THREAD_TASK_RUNNER_H_ |
| OLD | NEW |