Index: ui/events/latency_info.cc |
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc |
index dd5e11c3141899d3a1350a6def8fc30950b4a281..fe32ed3327bd4868bdb55001fc7b01ad4bf3d2ad 100644 |
--- a/ui/events/latency_info.cc |
+++ b/ui/events/latency_info.cc |
@@ -248,4 +248,29 @@ void LatencyInfo::TraceEventType(const char* event_type) { |
event_type); |
} |
+void LatencyInfo::FixMissingComponentIds(int64 component_id) { |
+ LatencyMap::iterator lc = latency_components.begin(); |
+ while (lc != latency_components.end()) { |
+ LatencyComponentType component_type = lc->first.first; |
+ if (component_type == WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT) { |
+ // If the component's ID is 0, patch it with the |
+ // correct value. |
+ if (lc->first.second == 0) { |
+ // Generate a new component entry |
+ LatencyMap::key_type key = std::make_pair(component_type, component_id); |
+ latency_components[key] = lc->second; |
+ |
+ // Remove the old entry |
+ LatencyMap::iterator eraseIter = lc; |
+ ++lc; |
+ latency_components.erase(eraseIter); |
jbauman
2014/01/17 00:02:29
how about "latency_components.erase(lc++);" instea
|
+ |
+ continue; |
+ } |
+ } |
+ |
+ ++lc; |
+ } |
+} |
+ |
} // namespace ui |