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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.h

Issue 2273703002: Force events to be non blocking if main thread is unresponsive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. 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/base/queueing_time_estimator.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.h b/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.h
index 21db2557f17485ea8c0dc6347c5ab92914f6d7b4..6cc657cdaace54a86e12ba9fb5e9c529ba68aff1 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.h
@@ -9,6 +9,9 @@
#include "base/time/time.h"
#include "public/platform/WebCommon.h"
+#include <array>
+#include <memory>
+
namespace base {
class TickClock;
}
@@ -31,10 +34,19 @@ class BLINK_PLATFORM_EXPORT QueueingTimeEstimator {
DISALLOW_COPY_AND_ASSIGN(Client);
};
+ using SerializedQueueingTimeEstimator = std::array<int64_t, 4>;
Sami 2016/11/03 16:43:15 Could this be a normal struct instead? That way we
+
QueueingTimeEstimator(Client* client, base::TimeDelta window_duration);
+ explicit QueueingTimeEstimator(
+ SerializedQueueingTimeEstimator serialized_queueing_time_estimator);
+
+ void OnTopLevelTaskStarted(base::TimeTicks task_start_time);
+ void OnTopLevelTaskCompleted(base::TimeTicks task_end_time);
+
+ SerializedQueueingTimeEstimator Serialize() const;
- void OnToplevelTaskCompleted(base::TimeTicks task_start_time,
- base::TimeTicks task_end_time);
+ base::TimeDelta EstimateQueueingTimeIncludingCurrentTask(
+ base::TimeTicks now) const;
private:
bool TimePastWindowEnd(base::TimeTicks task_end_time);
@@ -43,8 +55,9 @@ class BLINK_PLATFORM_EXPORT QueueingTimeEstimator {
base::TimeDelta current_expected_queueing_time_;
base::TimeDelta window_duration_;
base::TimeTicks window_start_time_;
+ base::TimeTicks current_task_start_time_;
- DISALLOW_COPY_AND_ASSIGN(QueueingTimeEstimator);
+ DISALLOW_ASSIGN(QueueingTimeEstimator);
};
} // namespace scheduler

Powered by Google App Engine
This is Rietveld 408576698