Chromium Code Reviews| 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..18ac433107dcf8cb42854b19105e042ace8377a2 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,8 @@ |
| #include "base/time/time.h" |
| #include "public/platform/WebCommon.h" |
| +#include <memory> |
| + |
| namespace base { |
| class TickClock; |
| } |
| @@ -33,10 +35,15 @@ class BLINK_PLATFORM_EXPORT QueueingTimeEstimator { |
| QueueingTimeEstimator(Client* client, base::TimeDelta window_duration); |
| - void OnToplevelTaskCompleted(base::TimeTicks task_start_time, |
| + void OnTopLevelTaskStarted(base::TimeTicks task_start_time); |
| + void OnTopLevelTaskCompleted(base::TimeTicks task_start_time, |
| base::TimeTicks task_end_time); |
| + base::TimeDelta EstimateQueueingTimeIncludingCurrentTask(base::TimeTicks now) const; |
| + |
| private: |
| + // Returns a clone of this object, with the |client_| set to |client|. |
| + std::unique_ptr<QueueingTimeEstimator> CloneWithClient(Client* client) const; |
|
Sami
2016/08/24 14:56:01
Is it necessary for this to be a heap allocation?
tdresser
2016/08/24 17:22:50
Done.
|
| bool TimePastWindowEnd(base::TimeTicks task_end_time); |
| Client* client_; // NOT OWNED. |
| @@ -44,6 +51,9 @@ class BLINK_PLATFORM_EXPORT QueueingTimeEstimator { |
| base::TimeDelta window_duration_; |
| base::TimeTicks window_start_time_; |
| + // Only used when including active task in estimated queueing time. |
| + base::TimeTicks current_task_start_time_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(QueueingTimeEstimator); |
| }; |