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 "ui/latency/latency_info.h" | 5 #include "ui/latency/latency_info.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 LatencyComponentType type) { | 166 LatencyComponentType type) { |
167 for (const auto& lc : other.latency_components()) { | 167 for (const auto& lc : other.latency_components()) { |
168 if (lc.first.first == type) { | 168 if (lc.first.first == type) { |
169 AddLatencyNumberWithTimestamp(lc.first.first, | 169 AddLatencyNumberWithTimestamp(lc.first.first, |
170 lc.first.second, | 170 lc.first.second, |
171 lc.second.sequence_number, | 171 lc.second.sequence_number, |
172 lc.second.event_time, | 172 lc.second.event_time, |
173 lc.second.event_count); | 173 lc.second.event_count); |
174 } | 174 } |
175 } | 175 } |
| 176 |
| 177 expected_queueing_time_on_dispatch_ = |
| 178 other.expected_queueing_time_on_dispatch_; |
| 179 |
176 trace_id_ = other.trace_id(); | 180 trace_id_ = other.trace_id(); |
177 coalesced_ = other.coalesced(); | 181 coalesced_ = other.coalesced(); |
178 // TODO(tdresser): Ideally we'd copy |began_| here as well, but |began_| isn't | 182 // TODO(tdresser): Ideally we'd copy |began_| here as well, but |began_| isn't |
179 // very intuitive, and we can actually begin multiple times across copied | 183 // very intuitive, and we can actually begin multiple times across copied |
180 // events. | 184 // events. |
181 terminated_ = other.terminated(); | 185 terminated_ = other.terminated(); |
182 } | 186 } |
183 | 187 |
184 void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { | 188 void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { |
185 for (const auto& lc : other.latency_components()) { | 189 for (const auto& lc : other.latency_components()) { |
186 if (!FindLatency(lc.first.first, lc.first.second, NULL)) { | 190 if (!FindLatency(lc.first.first, lc.first.second, NULL)) { |
187 AddLatencyNumberWithTimestamp(lc.first.first, | 191 AddLatencyNumberWithTimestamp(lc.first.first, |
188 lc.first.second, | 192 lc.first.second, |
189 lc.second.sequence_number, | 193 lc.second.sequence_number, |
190 lc.second.event_time, | 194 lc.second.event_time, |
191 lc.second.event_count); | 195 lc.second.event_count); |
192 } | 196 } |
193 } | 197 } |
| 198 |
| 199 expected_queueing_time_on_dispatch_ = |
| 200 other.expected_queueing_time_on_dispatch_; |
| 201 |
194 trace_id_ = other.trace_id(); | 202 trace_id_ = other.trace_id(); |
195 coalesced_ = other.coalesced(); | 203 coalesced_ = other.coalesced(); |
196 // TODO(tdresser): Ideally we'd copy |began_| here as well, but |began_| isn't | 204 // TODO(tdresser): Ideally we'd copy |began_| here as well, but |began_| isn't |
197 // very intuitive, and we can actually begin multiple times across copied | 205 // very intuitive, and we can actually begin multiple times across copied |
198 // events. | 206 // events. |
199 terminated_ = other.terminated(); | 207 terminated_ = other.terminated(); |
200 } | 208 } |
201 | 209 |
202 void LatencyInfo::AddLatencyNumber(LatencyComponentType component, | 210 void LatencyInfo::AddLatencyNumber(LatencyComponentType component, |
203 int64_t id, | 211 int64_t id, |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 LatencyMap::iterator it = latency_components_.begin(); | 380 LatencyMap::iterator it = latency_components_.begin(); |
373 while (it != latency_components_.end()) { | 381 while (it != latency_components_.end()) { |
374 if (it->first.first == type) | 382 if (it->first.first == type) |
375 it = latency_components_.erase(it); | 383 it = latency_components_.erase(it); |
376 else | 384 else |
377 it++; | 385 it++; |
378 } | 386 } |
379 } | 387 } |
380 | 388 |
381 } // namespace ui | 389 } // namespace ui |
OLD | NEW |