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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/long_task_tracker.h

Issue 2259013003: Move and rename TaskTimeTracker to public interface exposed to WebThread, use in WebPerf Agent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicitly check if task_start_time was set Created 4 years, 3 months 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 unified diff | Download patch
OLDNEW
(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 _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698