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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/trace_result.py

Issue 29423005: telemetry: Add GetRendererProcessFromTab to timeline model. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix smoothness_unittest.py. Created 7 years, 2 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
Index: tools/telemetry/telemetry/core/backends/chrome/trace_result.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/trace_result.py b/tools/telemetry/telemetry/core/backends/chrome/trace_result.py
index bcbcc3a26707671c4351a29c05a16bb8ce95e12e..000d32bc291b414949814001cee9342e95d81fb4 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/trace_result.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/trace_result.py
@@ -3,14 +3,27 @@
# found in the LICENSE file.
class TraceResult(object):
nduca 2013/10/31 07:32:02 So okay, I remember now why impl was there. We've
ernstm 2013/11/05 00:25:05 Done.
- def __init__(self, impl):
- self._impl = impl
+ def __init__(self, tracing_data):
+ self._tracing_data = tracing_data
+ self._tab_to_marker_mapping = {}
def Serialize(self, f):
"""Serializes the trace result to a file-like object"""
- return self._impl.Serialize(f)
+ raise NotImplementedError()
def AsTimelineModel(self):
"""Parses the trace result into a timeline model for in-memory
nduca 2013/10/31 07:32:02 If you pass the marker mapping in to this construc
ernstm 2013/11/05 00:25:05 Done.
manipulation."""
- return self._impl.AsTimelineModel()
+ timeline = self._CreateTimelineModel()
+ for key, value in self._tab_to_marker_mapping.iteritems():
+ timeline_markers = timeline.FindTimelineMarkers(value)
+ assert(len(timeline_markers) == 1)
+ renderer_process = timeline_markers[0].start_thread.parent
+ timeline.AddMapping(key, renderer_process)
+ return timeline
+
+ def _CreateTimelineModel(self):
+ raise NotImplementedError()
+
+ def AddTabToMarkerMapping(self, tab, marker):
+ self._tab_to_marker_mapping[tab] = marker

Powered by Google App Engine
This is Rietveld 408576698