Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: ui/events/latency_info.cc

Issue 140663003: Removed requirement for the renderer to know it's process ID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Windows Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/events/latency_info.h ('K') | « ui/events/latency_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« ui/events/latency_info.h ('K') | « ui/events/latency_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698