| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_LONG_TASK_TRACKER_H_ | |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_LONG_TASK_TRACKER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/time/time.h" | |
| 12 #include "public/platform/WebCommon.h" | |
| 13 | |
| 14 namespace blink { | |
| 15 namespace scheduler { | |
| 16 | |
| 17 // Records and reports long task times, above the threshold. | |
| 18 // The threshold is set to 50ms in the implementation. | |
| 19 class BLINK_PLATFORM_EXPORT LongTaskTracker { | |
| 20 public: | |
| 21 using LongTaskTiming = | |
| 22 std::vector<std::pair<base::TimeTicks, base::TimeDelta>>; | |
| 23 | |
| 24 LongTaskTracker(); | |
| 25 ~LongTaskTracker(); | |
| 26 | |
| 27 LongTaskTiming GetLongTaskTiming(); | |
| 28 void RecordLongTask(base::TimeTicks startTime, base::TimeDelta duration); | |
| 29 | |
| 30 private: | |
| 31 friend class LongTaskTrackerTest; | |
| 32 | |
| 33 LongTaskTiming long_task_times_; | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(LongTaskTracker); | |
| 36 }; | |
| 37 | |
| 38 } // namespace scheduler | |
| 39 } // namespace blink | |
| 40 | |
| 41 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_LONG_TASK_TRACKER_H
_ | |
| OLD | NEW |