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

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

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_SCHEDULER_TQM_DELEGATE_FOR_TEST_H_
6 #define CONTENT_RENDERER_SCHEDULER_TQM_DELEGATE_FOR_TEST_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/test/simple_test_tick_clock.h"
12 #include "components/scheduler/child/scheduler_tqm_delegate.h"
13
14 namespace scheduler {
15
16 class TaskQueueManagerDelegateForTest;
17
18 class SchedulerTqmDelegateForTest : public SchedulerTqmDelegate {
19 public:
20 static scoped_refptr<SchedulerTqmDelegateForTest> Create(
21 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
22 std::unique_ptr<base::TickClock> time_source);
23
24 // SchedulerTqmDelegate implementation
25 void SetDefaultTaskRunner(
26 scoped_refptr<base::SingleThreadTaskRunner> task_runner) override;
27 void RestoreDefaultTaskRunner() override;
28 bool PostDelayedTask(const tracked_objects::Location& from_here,
29 const base::Closure& task,
30 base::TimeDelta delay) override;
31 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
32 const base::Closure& task,
33 base::TimeDelta delay) override;
34 bool RunsTasksOnCurrentThread() const override;
35 bool IsNested() const override;
36 base::TimeTicks NowTicks() override;
37
38 base::SingleThreadTaskRunner* default_task_runner() const {
39 return default_task_runner_.get();
40 }
41
42 protected:
43 ~SchedulerTqmDelegateForTest() override;
44
45 private:
46 SchedulerTqmDelegateForTest(
47 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
48 std::unique_ptr<base::TickClock> time_source);
49
50 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
51
52 scoped_refptr<TaskQueueManagerDelegateForTest> task_runner_;
53
54 DISALLOW_COPY_AND_ASSIGN(SchedulerTqmDelegateForTest);
55 };
56
57 } // namespace scheduler
58
59 #endif // CONTENT_RENDERER_SCHEDULER_TQM_DELEGATE_FOR_TEST_H_
OLDNEW
« no previous file with comments | « components/scheduler/child/scheduler_tqm_delegate.h ('k') | components/scheduler/child/scheduler_tqm_delegate_for_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698