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

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

Issue 145923002: Added support to listen on Network.responseReceived and expose that through tab.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (inspector_network cleanup from previous API) Created 6 years, 10 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/inspector_timeline.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/inspector_timeline.py b/tools/telemetry/telemetry/core/backends/chrome/inspector_timeline.py
index 9492782139404bf820184371b4541b0368e587cb..0c469a7dd896466f0e8d46f81d4c0ffda9ea323f 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/inspector_timeline.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/inspector_timeline.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from telemetry.core.timeline import model
+from telemetry.core.backends.chrome import timeline_recorder
class TabBackendException(Exception):
@@ -10,7 +10,7 @@ class TabBackendException(Exception):
pass
-class InspectorTimeline(object):
+class InspectorTimeline(timeline_recorder.TimelineRecorder):
"""Implementation of dev tools timeline."""
class Recorder(object):
@@ -33,13 +33,9 @@ class InspectorTimeline(object):
self._tab.StopTimelineRecording()
def __init__(self, inspector_backend):
+ super(InspectorTimeline, self).__init__()
self._inspector_backend = inspector_backend
self._is_recording = False
- self._timeline_model = None
-
- @property
- def timeline_model(self):
- return self._timeline_model
def Start(self):
"""Starts recording."""
@@ -56,14 +52,14 @@ class InspectorTimeline(object):
}
self._SendSyncRequest(request)
- def Stop(self):
- """Stops recording and makes a TimelineModel with the event data."""
+ def Stop(self, timeline_model):
+ """Stops recording and import the event data to the timeline model."""
assert self._is_recording, 'Stop should be called after Start.'
request = {'method': 'Timeline.stop'}
result = self._SendSyncRequest(request)
raw_events = result['events']
- self._timeline_model = model.TimelineModel(
- event_data=raw_events, shift_world_to_zero=False)
+ timeline_model.ImportTraces(
+ [raw_events], shift_world_to_zero=False, freeze=False)
self._inspector_backend.UnregisterDomain('Timeline')
self._is_recording = False

Powered by Google App Engine
This is Rietveld 408576698