| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MEDIA_CAST_TEST_SKEWED_SINGLE_THREAD_TASK_RUNNER_H_ | 5 #ifndef MEDIA_CAST_TEST_SKEWED_SINGLE_THREAD_TASK_RUNNER_H_ |
| 6 #define MEDIA_CAST_TEST_SKEWED_SINGLE_THREAD_TASK_RUNNER_H_ | 6 #define MEDIA_CAST_TEST_SKEWED_SINGLE_THREAD_TASK_RUNNER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 27 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| 28 | 28 |
| 29 // Set the delay multiplier to |skew|. | 29 // Set the delay multiplier to |skew|. |
| 30 void SetSkew(double skew); | 30 void SetSkew(double skew); |
| 31 | 31 |
| 32 // base::SingleThreadTaskRunner implementation. | 32 // base::SingleThreadTaskRunner implementation. |
| 33 bool PostDelayedTask(const tracked_objects::Location& from_here, | 33 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 34 base::OnceClosure task, | 34 base::OnceClosure task, |
| 35 base::TimeDelta delay) final; | 35 base::TimeDelta delay) final; |
| 36 | 36 |
| 37 bool RunsTasksOnCurrentThread() const final; | 37 bool RunsTasksInCurrentSequence() const final; |
| 38 | 38 |
| 39 // This function is currently not used, and will return false. | 39 // This function is currently not used, and will return false. |
| 40 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 40 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 41 base::OnceClosure task, | 41 base::OnceClosure task, |
| 42 base::TimeDelta delay) final; | 42 base::TimeDelta delay) final; |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 ~SkewedSingleThreadTaskRunner() final; | 45 ~SkewedSingleThreadTaskRunner() final; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 double skew_; | 48 double skew_; |
| 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(SkewedSingleThreadTaskRunner); | 51 DISALLOW_COPY_AND_ASSIGN(SkewedSingleThreadTaskRunner); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace test | 54 } // namespace test |
| 55 } // namespace cast | 55 } // namespace cast |
| 56 } // namespace media | 56 } // namespace media |
| 57 | 57 |
| 58 #endif // MEDIA_CAST_TEST_SKEWED_SINGLE_THREAD_TASK_RUNNER_H_ | 58 #endif // MEDIA_CAST_TEST_SKEWED_SINGLE_THREAD_TASK_RUNNER_H_ |
| OLD | NEW |