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

Side by Side Diff: tools/perf/measurements/timeline_controller.py

Issue 386023004: Cleanup while reading code: Move GetJavaScriptMarker to be a free function instead of static functi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix tests. Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 from measurements import smooth_gesture_util 4 from measurements import smooth_gesture_util
5 5
6 from telemetry.core.backends.chrome import tracing_backend 6 from telemetry.core.backends.chrome import tracing_backend
7 from telemetry.timeline.model import TimelineModel 7 from telemetry.timeline.model import TimelineModel
8 from telemetry.page.actions import action_runner 8 from telemetry.page.actions import action_runner
9 from telemetry.web_perf import timeline_interaction_record as tir_module 9 from telemetry.web_perf import timeline_interaction_record as tir_module
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 self._model = TimelineModel(timeline_data) 49 self._model = TimelineModel(timeline_data)
50 self._renderer_process = self._model.GetRendererProcessFromTabId(tab.id) 50 self._renderer_process = self._model.GetRendererProcessFromTabId(tab.id)
51 renderer_thread = self.model.GetRendererThreadFromTabId(tab.id) 51 renderer_thread = self.model.GetRendererThreadFromTabId(tab.id)
52 52
53 run_smooth_actions_record = None 53 run_smooth_actions_record = None
54 self._smooth_records = [] 54 self._smooth_records = []
55 for event in renderer_thread.async_slices: 55 for event in renderer_thread.async_slices:
56 if not tir_module.IsTimelineInteractionRecord(event.name): 56 if not tir_module.IsTimelineInteractionRecord(event.name):
57 continue 57 continue
58 r = tir_module.TimelineInteractionRecord.FromAsyncEvent(event) 58 r = tir_module.TimelineInteractionRecord.FromAsyncEvent(event)
59 if r.logical_name == RUN_SMOOTH_ACTIONS: 59 if r.label == RUN_SMOOTH_ACTIONS:
60 assert run_smooth_actions_record is None, ( 60 assert run_smooth_actions_record is None, (
61 'TimelineController cannot issue more than 1 %s record' % 61 'TimelineController cannot issue more than 1 %s record' %
62 RUN_SMOOTH_ACTIONS) 62 RUN_SMOOTH_ACTIONS)
63 run_smooth_actions_record = r 63 run_smooth_actions_record = r
64 elif r.is_smooth: 64 elif r.is_smooth:
65 self._smooth_records.append( 65 self._smooth_records.append(
66 smooth_gesture_util.GetAdjustedInteractionIfContainGesture( 66 smooth_gesture_util.GetAdjustedInteractionIfContainGesture(
67 self.model, r)) 67 self.model, r))
68 68
69 # If there is no other smooth records, we make measurements on time range 69 # If there is no other smooth records, we make measurements on time range
(...skipping 12 matching lines...) Expand all
82 def model(self): 82 def model(self):
83 return self._model 83 return self._model
84 84
85 @property 85 @property
86 def renderer_process(self): 86 def renderer_process(self):
87 return self._renderer_process 87 return self._renderer_process
88 88
89 @property 89 @property
90 def smooth_records(self): 90 def smooth_records(self):
91 return self._smooth_records 91 return self._smooth_records
OLDNEW
« no previous file with comments | « tools/perf/measurements/smoothness_controller.py ('k') | tools/telemetry/telemetry/page/actions/action_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698