OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_BUDGET_POOL_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_BUDGET_POOL_H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_BUDGET_POOL_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_BUDGET_POOL_H_ |
7 | 7 |
8 #include <unordered_set> | 8 #include <unordered_set> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // a very long period after a single long task. | 109 // a very long period after a single long task. |
110 void SetMaxThrottlingDelay( | 110 void SetMaxThrottlingDelay( |
111 base::TimeTicks now, | 111 base::TimeTicks now, |
112 base::Optional<base::TimeDelta> max_throttling_delay); | 112 base::Optional<base::TimeDelta> max_throttling_delay); |
113 | 113 |
114 // Set minimal budget level required to run a task. If budget pool was | 114 // Set minimal budget level required to run a task. If budget pool was |
115 // exhausted, it needs to accumulate at least |min_budget_to_run| time units | 115 // exhausted, it needs to accumulate at least |min_budget_to_run| time units |
116 // to unblock and run tasks again. When unblocked, it still can run tasks | 116 // to unblock and run tasks again. When unblocked, it still can run tasks |
117 // when budget is positive but less than this level until being blocked | 117 // when budget is positive but less than this level until being blocked |
118 // until being blocked when budget reaches zero. | 118 // until being blocked when budget reaches zero. |
119 // This is needed for integration with WakeupBudgetPool to prevent a situation | 119 // This is needed for integration with WakeUpBudgetPool to prevent a situation |
120 // when wakeup happened but time budget pool allows only one task to run at | 120 // when wake_up happened but time budget pool allows only one task to run at |
121 // the moment. | 121 // the moment. |
122 // It is recommended to use the same value for this and WakeupBudgetPool's | 122 // It is recommended to use the same value for this and WakeUpBudgetPool's |
123 // wakeup window length. | 123 // wake_up window length. |
124 // NOTE: This does not have an immediate effect and does not call | 124 // NOTE: This does not have an immediate effect and does not call |
125 // BudgetPoolController::UnblockQueue. | 125 // BudgetPoolController::UnblockQueue. |
126 void SetMinBudgetLevelToRun(base::TimeTicks now, | 126 void SetMinBudgetLevelToRun(base::TimeTicks now, |
127 base::TimeDelta min_budget_level_to_run); | 127 base::TimeDelta min_budget_level_to_run); |
128 | 128 |
129 // Throttle task queues from this time budget pool if tasks are running | 129 // Throttle task queues from this time budget pool if tasks are running |
130 // for more than |cpu_percentage| per cent of wall time. | 130 // for more than |cpu_percentage| per cent of wall time. |
131 // This function does not affect internal time budget level. | 131 // This function does not affect internal time budget level. |
132 void SetTimeBudgetRecoveryRate(base::TimeTicks now, double cpu_percentage); | 132 void SetTimeBudgetRecoveryRate(base::TimeTicks now, double cpu_percentage); |
133 | 133 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 base::Callback<void(base::TimeDelta)> reporting_callback_; | 182 base::Callback<void(base::TimeDelta)> reporting_callback_; |
183 | 183 |
184 DISALLOW_COPY_AND_ASSIGN(CPUTimeBudgetPool); | 184 DISALLOW_COPY_AND_ASSIGN(CPUTimeBudgetPool); |
185 }; | 185 }; |
186 | 186 |
187 } // namespace scheduler | 187 } // namespace scheduler |
188 } // namespace blink | 188 } // namespace blink |
189 | 189 |
190 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_BUDGET_POOL_H_ | 190 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_BUDGET_POOL_H_ |
OLD | NEW |