| 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_PLUGIN_THREAD_TASK_RUNNER_H_ | 5 #ifndef REMOTING_BASE_PLUGIN_THREAD_TASK_RUNNER_H_ |
| 6 #define REMOTING_BASE_PLUGIN_THREAD_TASK_RUNNER_H_ | 6 #define REMOTING_BASE_PLUGIN_THREAD_TASK_RUNNER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // This method must be called on the plugin thread. | 39 // This method must be called on the plugin thread. |
| 40 void DetachAndRunShutdownLoop(); | 40 void DetachAndRunShutdownLoop(); |
| 41 | 41 |
| 42 // Makes DetachAndRunShutdownLoop() stop processing tasks and return control | 42 // Makes DetachAndRunShutdownLoop() stop processing tasks and return control |
| 43 // to the caller. Calling Quit() before DetachAndRunShutdownLoop() causes | 43 // to the caller. Calling Quit() before DetachAndRunShutdownLoop() causes |
| 44 // the latter to exit immediately when called, without processing any delayed | 44 // the latter to exit immediately when called, without processing any delayed |
| 45 // shutdown tasks. This method can be called from any thread. | 45 // shutdown tasks. This method can be called from any thread. |
| 46 void Quit(); | 46 void Quit(); |
| 47 | 47 |
| 48 // base::SingleThreadTaskRunner interface. | 48 // base::SingleThreadTaskRunner interface. |
| 49 virtual bool PostDelayedTask( | 49 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 50 const tracked_objects::Location& from_here, | 50 const base::Closure& task, |
| 51 const base::Closure& task, | 51 base::TimeDelta delay) override; |
| 52 base::TimeDelta delay) override; | 52 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 53 virtual bool PostNonNestableDelayedTask( | 53 const base::Closure& task, |
| 54 const tracked_objects::Location& from_here, | 54 base::TimeDelta delay) override; |
| 55 const base::Closure& task, | 55 bool RunsTasksOnCurrentThread() const override; |
| 56 base::TimeDelta delay) override; | |
| 57 virtual bool RunsTasksOnCurrentThread() const override; | |
| 58 | 56 |
| 59 protected: | 57 protected: |
| 60 virtual ~PluginThreadTaskRunner(); | 58 ~PluginThreadTaskRunner() override; |
| 61 | 59 |
| 62 private: | 60 private: |
| 63 // Methods that can be called from any thread. | 61 // Methods that can be called from any thread. |
| 64 | 62 |
| 65 // Schedules RunTasks to be called on the plugin thread. | 63 // Schedules RunTasks to be called on the plugin thread. |
| 66 void PostRunTasks(); | 64 void PostRunTasks(); |
| 67 | 65 |
| 68 // Methods that are always called on the plugin thread. | 66 // Methods that are always called on the plugin thread. |
| 69 | 67 |
| 70 // Schedules RunDelayedTasks() to be called on the plugin thread. |when| | 68 // Schedules RunDelayedTasks() to be called on the plugin thread. |when| |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 117 |
| 120 // True if the shutdown task loop was been stopped. | 118 // True if the shutdown task loop was been stopped. |
| 121 bool stopped_; | 119 bool stopped_; |
| 122 | 120 |
| 123 DISALLOW_COPY_AND_ASSIGN(PluginThreadTaskRunner); | 121 DISALLOW_COPY_AND_ASSIGN(PluginThreadTaskRunner); |
| 124 }; | 122 }; |
| 125 | 123 |
| 126 } // namespace remoting | 124 } // namespace remoting |
| 127 | 125 |
| 128 #endif // REMOTING_BASE_PLUGIN_THREAD_TASK_RUNNER_H_ | 126 #endif // REMOTING_BASE_PLUGIN_THREAD_TASK_RUNNER_H_ |
| OLD | NEW |