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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/inspector_backend.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_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
index d68c60a2c13b41826c49d8e4c9f6e3deec05171a..1d6fabc2d367073cb761ffb876bbddd5b947f5d7 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
@@ -18,6 +18,8 @@ from telemetry.core.backends.chrome import inspector_runtime
from telemetry.core.backends.chrome import inspector_timeline
from telemetry.core.backends.chrome import websocket
from telemetry.core.heap import model
+from telemetry.core.timeline import model as timeline_model
+from telemetry.core.timeline import recording_options
class InspectorException(Exception):
pass
@@ -39,6 +41,8 @@ class InspectorBackend(object):
self._runtime = inspector_runtime.InspectorRuntime(self)
self._timeline = inspector_timeline.InspectorTimeline(self)
self._network = inspector_network.InspectorNetwork(self)
+ self._timeline_model = None
+ self._timeline_recording_options = None
tonyg 2014/03/04 05:27:31 Could we avoid stashing this object here by adding
bolian 2014/03/04 20:32:44 Done. I changed to use the existing _is_recording
def __del__(self):
self.Disconnect()
@@ -185,13 +189,28 @@ class InspectorBackend(object):
@property
def timeline_model(self):
- return self._timeline.timeline_model
+ return self._timeline_model
- def StartTimelineRecording(self):
- self._timeline.Start()
+ def StartTimelineRecording(self, options=None):
+ if not options:
+ self._timeline_recording_options = (
+ recording_options.TimelineRecordingOptions())
+ else:
+ self._timeline_recording_options = options
+
+ if self._timeline_recording_options.record_timeline:
+ self._timeline.Start()
+ if self._timeline_recording_options.record_network:
+ self._network.timeline_recorder.Start()
def StopTimelineRecording(self):
- self._timeline.Stop()
+ assert self._timeline_recording_options
+ self._timeline_model = timeline_model.TimelineModel()
+ if self._timeline_recording_options.record_timeline:
+ self._timeline.Stop(self._timeline_model)
+ if self._timeline_recording_options.record_network:
+ self._network.timeline_recorder.Stop(self._timeline_model)
+ self._timeline_model.Freeze()
tonyg 2014/03/04 05:27:31 Can we do something where we call ImportTraces() f
bolian 2014/03/04 20:32:44 Done.
# Network public methods.

Powered by Google App Engine
This is Rietveld 408576698