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 b94f121ae0d1775eeef0d35277f3c6d4ba22a848..dcb2f7eac7db4bb87bb6f21ef5791d8bb82b3159 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 <array> |
|
alex clarke (OOO till 29th)
2016/11/14 17:00:17
Is this needed?
tdresser
2016/12/15 13:17:00
Done.
|
| + |
| namespace blink { |
| namespace scheduler { |
| @@ -27,20 +29,31 @@ class BLINK_PLATFORM_EXPORT QueueingTimeEstimator { |
| DISALLOW_COPY_AND_ASSIGN(Client); |
| }; |
| + struct Data { |
| + base::TimeDelta current_expected_queueing_time; |
| + base::TimeDelta window_duration; |
| + base::TimeTicks window_start_time; |
| + base::TimeTicks current_task_start_time; |
| + }; |
| + |
| QueueingTimeEstimator(Client* client, base::TimeDelta window_duration); |
| + explicit QueueingTimeEstimator(const Data& data); |
| - void OnToplevelTaskCompleted(base::TimeTicks task_start_time, |
| - base::TimeTicks task_end_time); |
| + void OnTopLevelTaskStarted(base::TimeTicks task_start_time); |
| + void OnTopLevelTaskCompleted(base::TimeTicks task_end_time); |
| + |
| + // Returns all state except for the current |client_|. |
| + Data data() const { return data_; } |
|
Sami
2016/11/14 21:16:45
nit: I would make this return a const Data& and ha
tdresser
2016/12/15 13:17:00
Done.
|
| + |
| + base::TimeDelta EstimateQueueingTimeIncludingCurrentTask( |
| + base::TimeTicks now) const; |
| private: |
| bool TimePastWindowEnd(base::TimeTicks task_end_time); |
| Client* client_; // NOT OWNED. |
| + Data data_; |
| - base::TimeDelta current_expected_queueing_time_; |
| - base::TimeDelta window_duration_; |
| - base::TimeTicks window_start_time_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(QueueingTimeEstimator); |
| + DISALLOW_ASSIGN(QueueingTimeEstimator); |
| }; |
| } // namespace scheduler |