Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: components/scheduler/child/single_thread_idle_task_runner.h

Issue 1058873010: Move blink scheduler implementation into a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_CHILD_SCHEDULER_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TASK_RUNNER_H_
6 #define CONTENT_CHILD_SCHEDULER_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ 6 #define COMPONENTS_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TASK_RUNNER_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 13
14 namespace content { 14 namespace scheduler {
15 15
16 // A SingleThreadIdleTaskRunner is a task runner for running idle tasks. Idle 16 // A SingleThreadIdleTaskRunner is a task runner for running idle tasks. Idle
17 // tasks have an unbound argument which is bound to a deadline 17 // tasks have an unbound argument which is bound to a deadline
18 // (in base::TimeTicks) when they are run. The idle task is expected to 18 // (in base::TimeTicks) when they are run. The idle task is expected to
19 // complete by this deadline. 19 // complete by this deadline.
20 class SingleThreadIdleTaskRunner 20 class SingleThreadIdleTaskRunner
21 : public base::RefCountedThreadSafe<SingleThreadIdleTaskRunner> { 21 : public base::RefCountedThreadSafe<SingleThreadIdleTaskRunner> {
22 public: 22 public:
23 typedef base::Callback<void(base::TimeTicks)> IdleTask; 23 typedef base::Callback<void(base::TimeTicks)> IdleTask;
24 24
(...skipping 28 matching lines...) Expand all
53 53
54 scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_; 54 scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_;
55 scoped_refptr<base::SingleThreadTaskRunner> after_wakeup_task_runner_; 55 scoped_refptr<base::SingleThreadTaskRunner> after_wakeup_task_runner_;
56 base::Callback<void(base::TimeTicks*)> deadline_supplier_; 56 base::Callback<void(base::TimeTicks*)> deadline_supplier_;
57 const char* tracing_category_; 57 const char* tracing_category_;
58 base::WeakPtr<SingleThreadIdleTaskRunner> weak_scheduler_ptr_; 58 base::WeakPtr<SingleThreadIdleTaskRunner> weak_scheduler_ptr_;
59 base::WeakPtrFactory<SingleThreadIdleTaskRunner> weak_factory_; 59 base::WeakPtrFactory<SingleThreadIdleTaskRunner> weak_factory_;
60 DISALLOW_COPY_AND_ASSIGN(SingleThreadIdleTaskRunner); 60 DISALLOW_COPY_AND_ASSIGN(SingleThreadIdleTaskRunner);
61 }; 61 };
62 62
63 } // namespace content 63 } // namespace scheduler
64 64
65 #endif // CONTENT_CHILD_SCHEDULER_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ 65 #endif // COMPONENTS_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TASK_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698