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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/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: Clean-ups. Created 7 years, 1 month 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/chrome_trace_result.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/chrome_trace_result.py b/tools/telemetry/telemetry/core/backends/chrome/chrome_trace_result.py
new file mode 100644
index 0000000000000000000000000000000000000000..7ff6c1066b9890e73b9c807bded7df8bf6855b67
--- /dev/null
+++ b/tools/telemetry/telemetry/core/backends/chrome/chrome_trace_result.py
@@ -0,0 +1,28 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+class ChromeTraceResult(object):
+ def __init__(self, tracing_data, tab_to_marker_mapping):
nduca 2013/11/05 19:42:20 tab_to_marker_mapping=None as a default if its no
ernstm 2013/11/05 22:27:05 Done.
+ self._tracing_data = tracing_data
+ self._tab_to_marker_mapping = tab_to_marker_mapping
+
+ def Serialize(self, f):
+ """Serializes the trace result to a file-like object"""
+ raise NotImplementedError()
+
+ def AsTimelineModel(self):
+ """Parses the trace result into a timeline model for in-memory
+ manipulation."""
+ timeline = self._CreateTimelineModel()
+ if self._tab_to_marker_mapping:
+ 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.AddCoreObjectToContainerMapping(key, renderer_process)
+ return timeline
+
+ def _CreateTimelineModel(self):
+ raise NotImplementedError()

Powered by Google App Engine
This is Rietveld 408576698