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 #include "cc/scheduler/begin_frame_tracker.h" | 5 #include "cc/scheduler/begin_frame_tracker.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 BeginFrameTracker::BeginFrameTracker(const tracked_objects::Location& location) | 9 BeginFrameTracker::BeginFrameTracker(const tracked_objects::Location& location) |
10 : location_(location), | 10 : location_(location), |
11 location_string_(location.ToString()), | 11 location_string_(location.ToString()), |
12 current_updated_at_(), | 12 current_updated_at_(), |
13 current_args_(), | 13 current_args_(), |
14 current_finished_at_(base::TraceTicks::FromInternalValue(-1)) { | 14 current_finished_at_(base::TraceTicks::FromInternalValue(-1)) { |
15 } | 15 } |
16 | 16 |
17 BeginFrameTracker::~BeginFrameTracker() { | 17 BeginFrameTracker::~BeginFrameTracker() { |
18 } | 18 } |
19 | 19 |
20 void BeginFrameTracker::Start(BeginFrameArgs new_args) { | 20 void BeginFrameTracker::Start(BeginFrameArgs new_args) { |
21 // Trace the frame time being passed between BeginFrameTrackers. | 21 // Trace the frame time being passed between BeginFrameTrackers. |
| 22 TRACE_EVENT_WITH_FLOW0("toplevel", "BeginFrameTracker::Start", |
| 23 new_args.frame_time.ToInternalValue(), |
| 24 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); |
22 TRACE_EVENT_FLOW_STEP0( | 25 TRACE_EVENT_FLOW_STEP0( |
23 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs", | 26 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs", |
24 new_args.frame_time.ToInternalValue(), location_string_); | 27 new_args.frame_time.ToInternalValue(), location_string_); |
25 | 28 |
26 // Trace this specific begin frame tracker Start/Finish times. | 29 // Trace this specific begin frame tracker Start/Finish times. |
27 TRACE_EVENT_ASYNC_BEGIN2( | 30 TRACE_EVENT_ASYNC_BEGIN2( |
28 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), | 31 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), |
29 location_string_.c_str(), new_args.frame_time.ToInternalValue(), | 32 location_string_.c_str(), new_args.frame_time.ToInternalValue(), |
30 "new args", new_args.AsValue(), "current args", current_args_.AsValue()); | 33 "new args", new_args.AsValue(), "current args", current_args_.AsValue()); |
31 | 34 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 117 |
115 const BeginFrameArgs& BeginFrameTracker::DangerousMethodCurrentOrLast() const { | 118 const BeginFrameArgs& BeginFrameTracker::DangerousMethodCurrentOrLast() const { |
116 if (!HasFinished()) { | 119 if (!HasFinished()) { |
117 return Current(); | 120 return Current(); |
118 } else { | 121 } else { |
119 return Last(); | 122 return Last(); |
120 } | 123 } |
121 } | 124 } |
122 | 125 |
123 } // namespace cc | 126 } // namespace cc |
OLD | NEW |