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

Side by Side Diff: content/renderer/scheduler/deadline_task_runner.h

Issue 1025323003: Introduce a SchedulerHelper in content/child/scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_RENDERER_SCHEDULER_DEADLINE_TASK_RUNNER_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_DEADLINE_TASK_RUNNER_H_
6 #define CONTENT_RENDERER_SCHEDULER_DEADLINE_TASK_RUNNER_H_ 6 #define CONTENT_RENDERER_SCHEDULER_DEADLINE_TASK_RUNNER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.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 #include "content/child/scheduler/cancelable_closure_holder.h"
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 #include "content/renderer/scheduler/cancelable_closure_holder.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 // Runs a posted task at latest by a given deadline, but possibly sooner. 18 // Runs a posted task at latest by a given deadline, but possibly sooner.
19 class CONTENT_EXPORT DeadlineTaskRunner { 19 class CONTENT_EXPORT DeadlineTaskRunner {
20 public: 20 public:
21 DeadlineTaskRunner(const base::Closure& callback, 21 DeadlineTaskRunner(const base::Closure& callback,
22 scoped_refptr<base::SingleThreadTaskRunner> task_runner); 22 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
23 23
24 ~DeadlineTaskRunner(); 24 ~DeadlineTaskRunner();
(...skipping 16 matching lines...) Expand all
41 base::Closure callback_; 41 base::Closure callback_;
42 base::TimeTicks deadline_; 42 base::TimeTicks deadline_;
43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(DeadlineTaskRunner); 45 DISALLOW_COPY_AND_ASSIGN(DeadlineTaskRunner);
46 }; 46 };
47 47
48 } // namespace content 48 } // namespace content
49 49
50 #endif // CONTENT_RENDERER_SCHEDULER_DEADLINE_TASK_RUNNER_H_ 50 #endif // CONTENT_RENDERER_SCHEDULER_DEADLINE_TASK_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698