| 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 THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TA
SK_RUNNER_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TA
SK_RUNNER_H_ |
| 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TA
SK_RUNNER_H_ | 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TA
SK_RUNNER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
| 17 #include "public/platform/WebCommon.h" | 17 #include "public/platform/WebCommon.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 namespace trace_event { | 20 namespace trace_event { |
| 21 class BlameContext; | 21 class BlameContext; |
| 22 } | 22 } |
| 23 } | 23 } // namespace base |
| 24 | 24 |
| 25 namespace blink { | 25 namespace blink { |
| 26 namespace scheduler { | 26 namespace scheduler { |
| 27 class IdleHelper; | 27 class IdleHelper; |
| 28 | 28 |
| 29 // A SingleThreadIdleTaskRunner is a task runner for running idle tasks. Idle | 29 // A SingleThreadIdleTaskRunner is a task runner for running idle tasks. Idle |
| 30 // tasks have an unbound argument which is bound to a deadline | 30 // tasks have an unbound argument which is bound to a deadline |
| 31 // (in base::TimeTicks) when they are run. The idle task is expected to | 31 // (in base::TimeTicks) when they are run. The idle task is expected to |
| 32 // complete by this deadline. | 32 // complete by this deadline. |
| 33 class SingleThreadIdleTaskRunner | 33 class SingleThreadIdleTaskRunner |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 void RunTask(IdleTask idle_task); | 94 void RunTask(IdleTask idle_task); |
| 95 | 95 |
| 96 void EnqueueReadyDelayedIdleTasks(); | 96 void EnqueueReadyDelayedIdleTasks(); |
| 97 | 97 |
| 98 using DelayedIdleTask = | 98 using DelayedIdleTask = |
| 99 std::pair<const tracked_objects::Location, base::Closure>; | 99 std::pair<const tracked_objects::Location, base::Closure>; |
| 100 | 100 |
| 101 scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_; | 101 scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_; |
| 102 std::multimap<base::TimeTicks, DelayedIdleTask> delayed_idle_tasks_; | 102 std::multimap<base::TimeTicks, DelayedIdleTask> delayed_idle_tasks_; |
| 103 Delegate* delegate_; // NOT OWNED | 103 Delegate* delegate_; // NOT OWNED |
| 104 base::trace_event::BlameContext* blame_context_; // Not owned. | 104 base::trace_event::BlameContext* blame_context_; // Not owned. |
| 105 base::WeakPtr<SingleThreadIdleTaskRunner> weak_scheduler_ptr_; | 105 base::WeakPtr<SingleThreadIdleTaskRunner> weak_scheduler_ptr_; |
| 106 base::WeakPtrFactory<SingleThreadIdleTaskRunner> weak_factory_; | 106 base::WeakPtrFactory<SingleThreadIdleTaskRunner> weak_factory_; |
| 107 DISALLOW_COPY_AND_ASSIGN(SingleThreadIdleTaskRunner); | 107 DISALLOW_COPY_AND_ASSIGN(SingleThreadIdleTaskRunner); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace scheduler | 110 } // namespace scheduler |
| 111 } // namespace blink | 111 } // namespace blink |
| 112 | 112 |
| 113 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_SINGLE_THREAD_IDLE
_TASK_RUNNER_H_ | 113 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_SINGLE_THREAD_IDLE
_TASK_RUNNER_H_ |
| OLD | NEW |