| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 164                                   LatencyComponentType type) { | 164                                   LatencyComponentType type) { | 
| 165   for (const auto& lc : other.latency_components()) { | 165   for (const auto& lc : other.latency_components()) { | 
| 166     if (lc.first.first == type) { | 166     if (lc.first.first == type) { | 
| 167       AddLatencyNumberWithTimestamp(lc.first.first, | 167       AddLatencyNumberWithTimestamp(lc.first.first, | 
| 168                                     lc.first.second, | 168                                     lc.first.second, | 
| 169                                     lc.second.sequence_number, | 169                                     lc.second.sequence_number, | 
| 170                                     lc.second.event_time, | 170                                     lc.second.event_time, | 
| 171                                     lc.second.event_count); | 171                                     lc.second.event_count); | 
| 172     } | 172     } | 
| 173   } | 173   } | 
|  | 174 | 
|  | 175   expected_queueing_time_on_dispatch_ = | 
|  | 176       other.expected_queueing_time_on_dispatch_; | 
| 174 } | 177 } | 
| 175 | 178 | 
| 176 void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { | 179 void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { | 
| 177   for (const auto& lc : other.latency_components()) { | 180   for (const auto& lc : other.latency_components()) { | 
| 178     if (!FindLatency(lc.first.first, lc.first.second, NULL)) { | 181     if (!FindLatency(lc.first.first, lc.first.second, NULL)) { | 
| 179       AddLatencyNumberWithTimestamp(lc.first.first, | 182       AddLatencyNumberWithTimestamp(lc.first.first, | 
| 180                                     lc.first.second, | 183                                     lc.first.second, | 
| 181                                     lc.second.sequence_number, | 184                                     lc.second.sequence_number, | 
| 182                                     lc.second.event_time, | 185                                     lc.second.event_time, | 
| 183                                     lc.second.event_count); | 186                                     lc.second.event_count); | 
| 184     } | 187     } | 
| 185   } | 188   } | 
|  | 189 | 
|  | 190   expected_queueing_time_on_dispatch_ = | 
|  | 191       other.expected_queueing_time_on_dispatch_; | 
| 186 } | 192 } | 
| 187 | 193 | 
| 188 void LatencyInfo::AddLatencyNumber(LatencyComponentType component, | 194 void LatencyInfo::AddLatencyNumber(LatencyComponentType component, | 
| 189                                    int64_t id, | 195                                    int64_t id, | 
| 190                                    int64_t component_sequence_number) { | 196                                    int64_t component_sequence_number) { | 
| 191   AddLatencyNumberWithTimestampImpl(component, id, component_sequence_number, | 197   AddLatencyNumberWithTimestampImpl(component, id, component_sequence_number, | 
| 192                                     base::TimeTicks::Now(), 1, nullptr); | 198                                     base::TimeTicks::Now(), 1, nullptr); | 
| 193 } | 199 } | 
| 194 | 200 | 
| 195 void LatencyInfo::AddLatencyNumberWithTraceName( | 201 void LatencyInfo::AddLatencyNumberWithTraceName( | 
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 356   LatencyMap::iterator it = latency_components_.begin(); | 362   LatencyMap::iterator it = latency_components_.begin(); | 
| 357   while (it != latency_components_.end()) { | 363   while (it != latency_components_.end()) { | 
| 358     if (it->first.first == type) | 364     if (it->first.first == type) | 
| 359       it = latency_components_.erase(it); | 365       it = latency_components_.erase(it); | 
| 360     else | 366     else | 
| 361       it++; | 367       it++; | 
| 362   } | 368   } | 
| 363 } | 369 } | 
| 364 | 370 | 
| 365 }  // namespace ui | 371 }  // namespace ui | 
| OLD | NEW | 
|---|