Index: tools/perf/measurements/timeline_controller.py |
diff --git a/tools/perf/measurements/timeline_controller.py b/tools/perf/measurements/timeline_controller.py |
index 4cd0008b27de9fea89ba7ebe66f8e1593da1855e..b6381847d25e293006407bea970895ab78445ca0 100644 |
--- a/tools/perf/measurements/timeline_controller.py |
+++ b/tools/perf/measurements/timeline_controller.py |
@@ -49,15 +49,18 @@ class TimelineController(object): |
# Stop tracing. |
timeline_data = tab.browser.StopTracing() |
self._model = TimelineModel(timeline_data) |
- self._renderer_process = self._model.GetRendererProcessFromTabId(tab.id) |
- renderer_thread = self.model.GetRendererThreadFromTabId(tab.id) |
- |
+ threads_to_records_map = ( |
+ tir_module.GetThreadToInteractionRecordsMapsFromModel( |
+ self._model)) |
+ assert len(threads_to_records_map) == 1, ( |
+ 'timeline metrics only support interaction records issued from' |
+ 'a single thread.') |
+ renderer_thread = threads_to_records_map.keys()[0] |
+ interaction_records = threads_to_records_map.values()[0] |
+ self._renderer_process = renderer_thread.parent |
run_smooth_actions_record = None |
self._smooth_records = [] |
- for event in renderer_thread.async_slices: |
- if not tir_module.IsTimelineInteractionRecord(event.name): |
- continue |
- r = tir_module.TimelineInteractionRecord.FromAsyncEvent(event) |
+ for r in interaction_records: |
if r.label == RUN_SMOOTH_ACTIONS: |
assert run_smooth_actions_record is None, ( |
'TimelineController cannot issue more than 1 %s record' % |