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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h

Issue 2476973002: [scheduler] Report background timer throttling intervention. (Closed)
Patch Set: base::Optional<base::Callback> -> base::Callback 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/Source/platform/scheduler/renderer/task_queue_throttler.h
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h
index 9829a6814ddcc48893c6dcc8c467824fcd31623a..71b20b2870331dad0b096ae02f3a40007e87d0f1 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h
@@ -85,6 +85,12 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer {
const char* Name() const;
+ // Set callback which will be called every time when this budget pool
+ // is throttled. Throttling duration (time until the queue is allowed
+ // to run again) is passed as a parameter to callback.
+ void SetReportingCallback(
+ base::Callback<void(base::TimeDelta)> reporting_callback);
+
// All queues should be removed before calling Close().
void Close();
@@ -141,6 +147,8 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer {
std::unordered_set<TaskQueue*> associated_task_queues_;
+ base::Callback<void(base::TimeDelta)> reporting_callback_;
+
DISALLOW_COPY_AND_ASSIGN(TimeBudgetPool);
};

Powered by Google App Engine
This is Rietveld 408576698