OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_TIME_OBSERVER_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_TIME_OBSERVER_H_ |
6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_TIME_OBSERVER_H_ | 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_TIME_OBSERVER_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "public/platform/WebCommon.h" | 9 #include "public/platform/WebCommon.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 namespace scheduler { | 12 namespace scheduler { |
13 | 13 |
14 class TaskQueue; | 14 class TaskQueue; |
15 | 15 |
16 // TaskTimeObserver provides an API for observing completion of renderer tasks. | 16 // TaskTimeObserver provides an API for observing completion of renderer tasks. |
17 class BLINK_PLATFORM_EXPORT TaskTimeObserver { | 17 class BLINK_PLATFORM_EXPORT TaskTimeObserver { |
18 public: | 18 public: |
19 TaskTimeObserver() {} | 19 TaskTimeObserver() {} |
20 virtual ~TaskTimeObserver() {} | 20 virtual ~TaskTimeObserver() {} |
21 | 21 |
| 22 // Callback to be called when task is started. |
| 23 // |task_queue| - TaskQueue on which this task was run, |
| 24 // |start_time| - time in seconds when task started to run, |
| 25 virtual void ReportTaskStartTime(double start_time) {} |
| 26 |
22 // Callback to be called when task is completed. | 27 // Callback to be called when task is completed. |
23 // |task_queue| - TaskQueue on which this task was run, | 28 // |task_queue| - TaskQueue on which this task was run, |
24 // |start_time| - time in seconds when task started to run, | 29 // |start_time| - time in seconds when task started to run, |
25 // |end_time| - time in seconds when task was completed. | 30 // |end_time| - time in seconds when task was completed. |
26 virtual void ReportTaskTime(TaskQueue* task_queue, | 31 virtual void ReportTaskEndTime(TaskQueue* task_queue, |
27 double start_time, | 32 double start_time, |
28 double end_time) = 0; | 33 double end_time) = 0; |
29 | 34 |
30 private: | 35 private: |
31 DISALLOW_COPY_AND_ASSIGN(TaskTimeObserver); | 36 DISALLOW_COPY_AND_ASSIGN(TaskTimeObserver); |
32 }; | 37 }; |
33 | 38 |
34 } // namespace scheduler | 39 } // namespace scheduler |
35 } // namespace blink | 40 } // namespace blink |
36 | 41 |
37 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_TIME_OBSERVER_
H_ | 42 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_TIME_OBSERVER_
H_ |
OLD | NEW |