OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/output/begin_frame_args.h" | 5 #include "cc/output/begin_frame_args.h" |
6 | 6 |
7 #include "base/trace_event/trace_event_argument.h" | 7 #include "base/trace_event/trace_event_argument.h" |
8 #include "cc/proto/base_conversions.h" | 8 #include "cc/proto/base_conversions.h" |
9 #include "cc/proto/begin_main_frame_and_commit_state.pb.h" | 9 #include "cc/proto/begin_main_frame_and_commit_state.pb.h" |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 DCHECK_NE(type, BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX); | 91 DCHECK_NE(type, BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX); |
92 #ifdef NDEBUG | 92 #ifdef NDEBUG |
93 return BeginFrameArgs(frame_time, deadline, interval, type); | 93 return BeginFrameArgs(frame_time, deadline, interval, type); |
94 #else | 94 #else |
95 BeginFrameArgs args = BeginFrameArgs(frame_time, deadline, interval, type); | 95 BeginFrameArgs args = BeginFrameArgs(frame_time, deadline, interval, type); |
96 args.created_from = location; | 96 args.created_from = location; |
97 return args; | 97 return args; |
98 #endif | 98 #endif |
99 } | 99 } |
100 | 100 |
101 scoped_ptr<base::trace_event::ConvertableToTraceFormat> | 101 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
102 BeginFrameArgs::AsValue() const { | 102 BeginFrameArgs::AsValue() const { |
103 scoped_ptr<base::trace_event::TracedValue> state( | 103 std::unique_ptr<base::trace_event::TracedValue> state( |
104 new base::trace_event::TracedValue()); | 104 new base::trace_event::TracedValue()); |
105 AsValueInto(state.get()); | 105 AsValueInto(state.get()); |
106 return std::move(state); | 106 return std::move(state); |
107 } | 107 } |
108 | 108 |
109 void BeginFrameArgs::AsValueInto(base::trace_event::TracedValue* state) const { | 109 void BeginFrameArgs::AsValueInto(base::trace_event::TracedValue* state) const { |
110 state->SetString("type", "BeginFrameArgs"); | 110 state->SetString("type", "BeginFrameArgs"); |
111 state->SetString("subtype", TypeToString(type)); | 111 state->SetString("subtype", TypeToString(type)); |
112 state->SetDouble("frame_time_us", frame_time.ToInternalValue()); | 112 state->SetDouble("frame_time_us", frame_time.ToInternalValue()); |
113 state->SetDouble("deadline_us", deadline.ToInternalValue()); | 113 state->SetDouble("deadline_us", deadline.ToInternalValue()); |
(...skipping 28 matching lines...) Expand all Loading... |
142 // output. | 142 // output. |
143 base::TimeDelta BeginFrameArgs::DefaultEstimatedParentDrawTime() { | 143 base::TimeDelta BeginFrameArgs::DefaultEstimatedParentDrawTime() { |
144 return base::TimeDelta::FromMicroseconds(16666 / 3); | 144 return base::TimeDelta::FromMicroseconds(16666 / 3); |
145 } | 145 } |
146 | 146 |
147 base::TimeDelta BeginFrameArgs::DefaultInterval() { | 147 base::TimeDelta BeginFrameArgs::DefaultInterval() { |
148 return base::TimeDelta::FromMicroseconds(16666); | 148 return base::TimeDelta::FromMicroseconds(16666); |
149 } | 149 } |
150 | 150 |
151 } // namespace cc | 151 } // namespace cc |
OLD | NEW |