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

Side by Side Diff: components/scheduler/base/long_task_tracker.h

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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
« no previous file with comments | « components/scheduler/base/lazy_now.cc ('k') | components/scheduler/base/long_task_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 COMPONENTS_SCHEDULER_BASE_LONG_TASK_TRACKER_H_
6 #define COMPONENTS_SCHEDULER_BASE_LONG_TASK_TRACKER_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/time/time.h"
12 #include "components/scheduler/scheduler_export.h"
13
14 namespace scheduler {
15
16 // Records and reports long task times, above the threshold.
17 // The threshold is set to 50ms in the implementation.
18 class SCHEDULER_EXPORT LongTaskTracker {
19 public:
20 using LongTaskTiming =
21 std::vector<std::pair<base::TimeTicks, base::TimeDelta>>;
22
23 LongTaskTracker();
24 ~LongTaskTracker();
25
26 LongTaskTiming GetLongTaskTiming();
27 void RecordLongTask(base::TimeTicks startTime,
28 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
40 #endif // COMPONENTS_SCHEDULER_BASE_LONG_TASK_TRACKER_H_
OLDNEW
« no previous file with comments | « components/scheduler/base/lazy_now.cc ('k') | components/scheduler/base/long_task_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698