| Index: ui/events/latency_info.cc
|
| diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc
|
| index a3a11828db041ee90e844c9076a4d3bd70fb24e3..62a184bf35e5557764089a796fd2594fe21286fb 100644
|
| --- a/ui/events/latency_info.cc
|
| +++ b/ui/events/latency_info.cc
|
| @@ -235,4 +235,40 @@ void LatencyInfo::TraceEventType(const char* event_type) {
|
| event_type);
|
| }
|
|
|
| +void LatencyInfo::AnnotateWithProcessId(
|
| + std::vector<ui::LatencyInfo>& latency_info,
|
| + base::ProcessId process_id) {
|
| + for (size_t i = 0; i < latency_info.size(); i++) {
|
| + latency_info[i].AnnotateComponentsWithProcessId(process_id);
|
| + }
|
| +}
|
| +
|
| +void LatencyInfo::AnnotateComponentsWithProcessId(base::ProcessId process_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 process ID is kNullProcessId, patch it with the
|
| + // correct value.
|
| + int component_process_id = (lc->first.second >> 32) & 0xffffffff;
|
| + if (component_process_id == base::kNullProcessId) {
|
| + // Generate a new component entry
|
| + int routing_id = lc->first.second & 0xffffffff;
|
| + int64 id = routing_id | (static_cast<int64>(process_id) << 32);
|
| + LatencyMap::key_type key = std::make_pair(component_type, id);
|
| + latency_components[key] = lc->second;
|
| +
|
| + // Remove the old entry
|
| + LatencyMap::iterator eraseIter = lc;
|
| + ++lc;
|
| + latency_components.erase(eraseIter);
|
| +
|
| + continue;
|
| + }
|
| + }
|
| +
|
| + ++lc;
|
| + }
|
| +}
|
| +
|
| } // namespace ui
|
|
|