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

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: sync to HEAD to get latest timeline changes. 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/inspector_network.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d24af66e0aa14bb53095c3f0c43e2189c71bb2f8..6e07c283f6c6f069e9a367249c5e8101d899a45c 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
@@ -21,6 +21,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):
@@ -44,6 +46,7 @@ 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
def __del__(self):
self._Disconnect()
@@ -191,13 +194,29 @@ 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:
+ options = recording_options.TimelineRecordingOptions()
+ if options.record_timeline:
+ self._timeline.Start()
+ if options.record_network:
+ self._network.timeline_recorder.Start()
def StopTimelineRecording(self):
- self._timeline.Stop()
+ data = []
+ timeline_data = self._timeline.Stop()
+ if timeline_data:
+ data.append(timeline_data)
+ network_data = self._network.timeline_recorder.Stop()
+ if network_data:
+ data.append(network_data)
+ if data:
+ self._timeline_model = timeline_model.TimelineModel(
+ timeline_data=data, shift_world_to_zero=False)
+ else:
+ self._timeline_model = None
# Network public methods.
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/inspector_network.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698