Chromium Code Reviews| Index: third_party/WebKit/public/platform/WebScheduler.h |
| diff --git a/third_party/WebKit/public/platform/WebScheduler.h b/third_party/WebKit/public/platform/WebScheduler.h |
| index 71365c4a51bb04e1930d37c535146f93d9e194cb..e88caaf52d7e562cb51e8952318b3d75d0e69574 100644 |
| --- a/third_party/WebKit/public/platform/WebScheduler.h |
| +++ b/third_party/WebKit/public/platform/WebScheduler.h |
| @@ -14,9 +14,7 @@ |
| #include <memory> |
| namespace blink { |
| - |
| class WebTaskRunner; |
| -class WebView; |
| // This class is used to submit tasks and pass other information from Blink to |
| // the platform's scheduler. |
| @@ -32,6 +30,18 @@ class BLINK_PLATFORM_EXPORT WebScheduler { |
| virtual void ReportIntervention(const WebString& message) = 0; |
| }; |
| + // Helper interface to plumb various settings from WebSettings to scheduler. |
| + class BLINK_PLATFORM_EXPORT WebSchedulerSettings { |
|
Sami
2016/11/04 16:50:28
Instead of adding this generic interface, how woul
altimin
2016/11/07 15:19:49
Per offline discussion, renamed to WebViewSchedule
|
| + public: |
| + virtual ~WebSchedulerSettings() {} |
| + |
| + // Background throttling aggressiveness settings. |
| + virtual float expensiveBackgroundThrottlingCPUBudget() = 0; |
| + virtual float expensiveBackgroundThrottlingInitialBudget() = 0; |
| + virtual float expensiveBackgroundThrottlingMaxBudget() = 0; |
| + virtual float expensiveBackgroundThrottlingMaxDelay() = 0; |
| + }; |
| + |
| virtual ~WebScheduler() {} |
| // Called to prevent any more pending tasks from running. Must be called on |
| @@ -76,7 +86,8 @@ class BLINK_PLATFORM_EXPORT WebScheduler { |
| // Creates a new WebViewScheduler for a given WebView. Must be called from |
| // the associated WebThread. |
| virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler( |
| - InterventionReporter*) = 0; |
| + InterventionReporter*, |
| + WebSchedulerSettings*) = 0; |
| // Suspends the timer queue and increments the timer queue suspension count. |
| // May only be called from the main thread. |