OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ | 5 #ifndef CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
6 #define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ | 6 #define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/base/rolling_time_delta_history.h" | 9 #include "cc/base/rolling_time_delta_history.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 }; | 27 }; |
28 class UMAReporter; | 28 class UMAReporter; |
29 | 29 |
30 CompositorTimingHistory( | 30 CompositorTimingHistory( |
31 UMACategory uma_category, | 31 UMACategory uma_category, |
32 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 32 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
33 virtual ~CompositorTimingHistory(); | 33 virtual ~CompositorTimingHistory(); |
34 | 34 |
35 void AsValueInto(base::trace_event::TracedValue* state) const; | 35 void AsValueInto(base::trace_event::TracedValue* state) const; |
36 | 36 |
| 37 // Deprecated: http://crbug.com/552004 |
37 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() const; | 38 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() const; |
| 39 |
| 40 // The main thread responsiveness depends heavily on whether or not the |
| 41 // on_critical_path flag is set, so we record response times separately. |
| 42 virtual base::TimeDelta BeginMainFrameQueueDurationCriticalEstimate() const; |
| 43 virtual base::TimeDelta BeginMainFrameQueueDurationNotCriticalEstimate() |
| 44 const; |
| 45 virtual base::TimeDelta BeginMainFrameStartToCommitDurationEstimate() const; |
38 virtual base::TimeDelta CommitToReadyToActivateDurationEstimate() const; | 46 virtual base::TimeDelta CommitToReadyToActivateDurationEstimate() const; |
39 virtual base::TimeDelta PrepareTilesDurationEstimate() const; | 47 virtual base::TimeDelta PrepareTilesDurationEstimate() const; |
40 virtual base::TimeDelta ActivateDurationEstimate() const; | 48 virtual base::TimeDelta ActivateDurationEstimate() const; |
41 virtual base::TimeDelta DrawDurationEstimate() const; | 49 virtual base::TimeDelta DrawDurationEstimate() const; |
42 | 50 |
43 void SetRecordingEnabled(bool enabled); | 51 void SetRecordingEnabled(bool enabled); |
44 | 52 |
45 void WillBeginMainFrame(); | 53 void WillBeginMainFrame(bool on_critical_path); |
| 54 void BeginMainFrameStarted(base::TimeTicks main_thread_start_time); |
46 void BeginMainFrameAborted(); | 55 void BeginMainFrameAborted(); |
47 void DidCommit(); | 56 void DidCommit(); |
48 void WillPrepareTiles(); | 57 void WillPrepareTiles(); |
49 void DidPrepareTiles(); | 58 void DidPrepareTiles(); |
50 void ReadyToActivate(); | 59 void ReadyToActivate(); |
51 void WillActivate(); | 60 void WillActivate(); |
52 void DidActivate(); | 61 void DidActivate(); |
53 void WillDraw(); | 62 void WillDraw(); |
54 void DidDraw(); | 63 void DidDraw(); |
55 | 64 |
56 protected: | 65 protected: |
57 static scoped_ptr<UMAReporter> CreateUMAReporter(UMACategory category); | 66 static scoped_ptr<UMAReporter> CreateUMAReporter(UMACategory category); |
58 virtual base::TimeTicks Now() const; | 67 virtual base::TimeTicks Now() const; |
59 | 68 |
60 bool enabled_; | 69 bool enabled_; |
61 | 70 |
62 RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history_; | 71 RollingTimeDeltaHistory begin_main_frame_sent_to_commit_duration_history_; |
| 72 RollingTimeDeltaHistory begin_main_frame_queue_duration_critical_history_; |
| 73 RollingTimeDeltaHistory begin_main_frame_queue_duration_not_critical_history_; |
| 74 RollingTimeDeltaHistory begin_main_frame_start_to_commit_duration_history_; |
63 RollingTimeDeltaHistory commit_to_ready_to_activate_duration_history_; | 75 RollingTimeDeltaHistory commit_to_ready_to_activate_duration_history_; |
64 RollingTimeDeltaHistory prepare_tiles_duration_history_; | 76 RollingTimeDeltaHistory prepare_tiles_duration_history_; |
65 RollingTimeDeltaHistory activate_duration_history_; | 77 RollingTimeDeltaHistory activate_duration_history_; |
66 RollingTimeDeltaHistory draw_duration_history_; | 78 RollingTimeDeltaHistory draw_duration_history_; |
67 | 79 |
| 80 bool begin_main_frame_on_critical_path_; |
68 base::TimeTicks begin_main_frame_sent_time_; | 81 base::TimeTicks begin_main_frame_sent_time_; |
| 82 base::TimeTicks begin_main_frame_start_time_; |
69 base::TimeTicks commit_time_; | 83 base::TimeTicks commit_time_; |
70 base::TimeTicks start_prepare_tiles_time_; | 84 base::TimeTicks start_prepare_tiles_time_; |
71 base::TimeTicks start_activate_time_; | 85 base::TimeTicks start_activate_time_; |
72 base::TimeTicks start_draw_time_; | 86 base::TimeTicks start_draw_time_; |
73 | 87 |
74 scoped_ptr<UMAReporter> uma_reporter_; | 88 scoped_ptr<UMAReporter> uma_reporter_; |
75 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 89 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
76 | 90 |
77 private: | 91 private: |
78 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory); | 92 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory); |
79 }; | 93 }; |
80 | 94 |
81 } // namespace cc | 95 } // namespace cc |
82 | 96 |
83 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ | 97 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
OLD | NEW |