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

Side by Side Diff: content/child/scheduler/worker_scheduler_impl.h

Issue 1098033002: Remove dependency on cc::TestNowSource from scheduler code (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 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_CHILD_SCHEDULER_WORKER_SCHEDULER_IMPL_H_ 5 #ifndef CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_IMPL_H_
6 #define CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_IMPL_H_ 6 #define CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_IMPL_H_
7 7
8 #include "content/child/scheduler/worker_scheduler.h" 8 #include "content/child/scheduler/worker_scheduler.h"
9 #include "content/child/scheduler/scheduler_helper.h" 9 #include "content/child/scheduler/scheduler_helper.h"
10 10
(...skipping 19 matching lines...) Expand all
30 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() override; 30 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() override;
31 scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() override; 31 scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() override;
32 bool CanExceedIdleDeadlineIfRequired() const override; 32 bool CanExceedIdleDeadlineIfRequired() const override;
33 bool ShouldYieldForHighPriorityWork() override; 33 bool ShouldYieldForHighPriorityWork() override;
34 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; 34 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
35 void RemoveTaskObserver( 35 void RemoveTaskObserver(
36 base::MessageLoop::TaskObserver* task_observer) override; 36 base::MessageLoop::TaskObserver* task_observer) override;
37 void Init() override; 37 void Init() override;
38 void Shutdown() override; 38 void Shutdown() override;
39 39
40 void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source); 40 SchedulerHelper* GetSchedulerHelperForTesting();
41 void SetWorkBatchSizeForTesting(size_t work_batch_size); 41 void SetWorkBatchSizeForTesting(size_t work_batch_size);
42 base::TimeTicks CurrentIdleTaskDeadlineForTesting() const; 42 base::TimeTicks CurrentIdleTaskDeadlineForTesting() const;
43 43
44 protected: 44 protected:
45 // SchedulerHelperDelegate implementation: 45 // SchedulerHelperDelegate implementation:
46 bool CanEnterLongIdlePeriod( 46 bool CanEnterLongIdlePeriod(
47 base::TimeTicks now, 47 base::TimeTicks now,
48 base::TimeDelta* next_long_idle_period_delay_out) override; 48 base::TimeDelta* next_long_idle_period_delay_out) override;
49 void IsNotQuiescent() override {} 49 void IsNotQuiescent() override {}
50 50
51 private: 51 private:
52 void MaybeStartLongIdlePeriod(); 52 void MaybeStartLongIdlePeriod();
53 53
54 SchedulerHelper helper_; 54 SchedulerHelper helper_;
55 bool initialized_; 55 bool initialized_;
56 56
57 DISALLOW_COPY_AND_ASSIGN(WorkerSchedulerImpl); 57 DISALLOW_COPY_AND_ASSIGN(WorkerSchedulerImpl);
58 }; 58 };
59 59
60 } // namespace content 60 } // namespace content
61 61
62 #endif // CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_IMPL_H_ 62 #endif // CONTENT_CHILD_SCHEDULER_WORKER_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « content/child/scheduler/time_source.cc ('k') | content/child/scheduler/worker_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698