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

Unified Diff: third_party/WebKit/public/platform/WebScheduler.h

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698