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

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

Issue 1441073006: Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last few changes Sami requested Created 5 years 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 COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
7 7
8 #include "base/time/tick_clock.h" 8 #include "base/time/tick_clock.h"
9 #include "components/scheduler/base/task_queue_manager.h" 9 #include "components/scheduler/base/task_queue_manager.h"
10 #include "components/scheduler/base/task_queue_selector.h" 10 #include "components/scheduler/base/task_queue_selector.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 virtual void OnUnregisterTaskQueue( 76 virtual void OnUnregisterTaskQueue(
77 const scoped_refptr<TaskQueue>& queue) = 0; 77 const scoped_refptr<TaskQueue>& queue) = 0;
78 }; 78 };
79 79
80 // Called once to set the Observer. This function is called on the main 80 // Called once to set the Observer. This function is called on the main
81 // thread. If |observer| is null, then no callbacks will occur. 81 // thread. If |observer| is null, then no callbacks will occur.
82 // Note |observer| is expected to outlive the SchedulerHelper. 82 // Note |observer| is expected to outlive the SchedulerHelper.
83 void SetObserver(Observer* observer); 83 void SetObserver(Observer* observer);
84 84
85 // Accessor methods. 85 // Accessor methods.
86 const scoped_refptr<RealTimeDomain>& real_time_domain() const; 86 RealTimeDomain* real_time_domain() const;
87 void RegisterTimeDomain(TimeDomain* time_domain);
88 void UnregisterTimeDomain(TimeDomain* time_domain);
87 const scoped_refptr<SchedulerTqmDelegate>& scheduler_tqm_delegate() const; 89 const scoped_refptr<SchedulerTqmDelegate>& scheduler_tqm_delegate() const;
88 bool GetAndClearSystemIsQuiescentBit(); 90 bool GetAndClearSystemIsQuiescentBit();
89 91
90 // Test helpers. 92 // Test helpers.
91 void SetWorkBatchSizeForTesting(size_t work_batch_size); 93 void SetWorkBatchSizeForTesting(size_t work_batch_size);
92 TaskQueueManager* GetTaskQueueManagerForTesting(); 94 TaskQueueManager* GetTaskQueueManagerForTesting();
93 95
94 private: 96 private:
95 friend class SchedulerHelperTest; 97 friend class SchedulerHelperTest;
96 98
97 base::ThreadChecker thread_checker_; 99 base::ThreadChecker thread_checker_;
98 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate_; 100 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate_;
99 scoped_ptr<TaskQueueManager> task_queue_manager_; 101 scoped_ptr<TaskQueueManager> task_queue_manager_;
100 scoped_refptr<TaskQueue> control_task_runner_; 102 scoped_refptr<TaskQueue> control_task_runner_;
101 scoped_refptr<TaskQueue> control_after_wakeup_task_runner_; 103 scoped_refptr<TaskQueue> control_after_wakeup_task_runner_;
102 scoped_refptr<TaskQueue> default_task_runner_; 104 scoped_refptr<TaskQueue> default_task_runner_;
103 105
104 Observer* observer_; // NOT OWNED 106 Observer* observer_; // NOT OWNED
105 const char* tracing_category_; 107 const char* tracing_category_;
106 const char* disabled_by_default_tracing_category_; 108 const char* disabled_by_default_tracing_category_;
107 109
108 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); 110 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper);
109 }; 111 };
110 112
111 } // namespace scheduler 113 } // namespace scheduler
112 114
113 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 115 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
OLDNEW
« no previous file with comments | « components/scheduler/child/idle_helper.cc ('k') | components/scheduler/child/scheduler_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698