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

Side by Side Diff: tools/telemetry/telemetry/web_perf/timeline_based_measurement.py

Issue 309533016: Remove the weak dictionary that maps tab objects to it markers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « tools/telemetry/telemetry/page/actions/action_runner_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4
5 import logging 5 import logging
6 import os 6 import os
7 7
8 from telemetry.core import util 8 from telemetry.core import util
9 from telemetry.core.backends.chrome import tracing_backend 9 from telemetry.core.backends.chrome import tracing_backend
10 from telemetry.core.timeline import model as model_module 10 from telemetry.core.timeline import model as model_module
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 os.path.join(trace_dir, 'trace')) + '.json' 144 os.path.join(trace_dir, 'trace')) + '.json'
145 try: 145 try:
146 with open(trace_file_path, 'w') as f: 146 with open(trace_file_path, 'w') as f:
147 trace_result.Serialize(f) 147 trace_result.Serialize(f)
148 results.AddValue(string_value_module.StringValue( 148 results.AddValue(string_value_module.StringValue(
149 page, 'trace_path', 'string', trace_file_path)) 149 page, 'trace_path', 'string', trace_file_path))
150 except IOError, e: 150 except IOError, e:
151 logging.error('Cannot open %s. %s' % (trace_file_path, e)) 151 logging.error('Cannot open %s. %s' % (trace_file_path, e))
152 152
153 model = model_module.TimelineModel(trace_result) 153 model = model_module.TimelineModel(trace_result)
154 renderer_thread = model.GetRendererThreadFromTab(tab) 154 renderer_thread = model.GetRendererThreadFromTabId(tab.id)
155 meta_metrics = _TimelineBasedMetrics( 155 meta_metrics = _TimelineBasedMetrics(
156 model, renderer_thread, self.CreateMetricsForTimelineInteractionRecord) 156 model, renderer_thread, self.CreateMetricsForTimelineInteractionRecord)
157 meta_metrics.AddResults(results) 157 meta_metrics.AddResults(results)
158 158
159 def CleanUpAfterPage(self, page, tab): 159 def CleanUpAfterPage(self, page, tab):
160 if tab.browser.is_tracing_running: 160 if tab.browser.is_tracing_running:
161 tab.browser.StopTracing() 161 tab.browser.StopTracing()
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/page/actions/action_runner_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698