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

Unified Diff: tools/telemetry/telemetry/inspector_timeline.py

Issue 11931026: Revert 177087. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | « tools/telemetry/telemetry/inspector_runtime.py ('k') | tools/telemetry/telemetry/page_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/inspector_timeline.py
===================================================================
--- tools/telemetry/telemetry/inspector_timeline.py (revision 177224)
+++ tools/telemetry/telemetry/inspector_timeline.py (working copy)
@@ -4,7 +4,7 @@
from telemetry.timeline_event import TimelineEvent
from telemetry.timeline_model import TimelineModel
-class TabBackendException(Exception):
+class InspectorBackendException(Exception):
pass
class InspectorTimeline(object):
@@ -20,8 +20,9 @@
def __exit__(self, *args):
self._timeline.Stop()
- def __init__(self, tab_backend):
- self._tab_backend = tab_backend
+ def __init__(self, inspector_backend, tab):
+ self._inspector_backend = inspector_backend
+ self._tab = tab
self._is_recording = False
self._timeline_model = None
@@ -34,24 +35,24 @@
return
self._is_recording = True
self._timeline_model = TimelineModel()
- self._tab_backend.RegisterDomain('Timeline',
+ self._inspector_backend.RegisterDomain('Timeline',
self._OnNotification, self._OnClose)
req = {'method': 'Timeline.start'}
self._SendSyncRequest(req)
def Stop(self):
if not self._is_recording:
- raise TabBackendException('Stop() called but not started')
+ raise InspectorBackendException('Stop() called but not started')
self._is_recording = False
self._timeline_model.DidFinishRecording()
req = {'method': 'Timeline.stop'}
self._SendSyncRequest(req)
- self._tab_backend.UnregisterDomain('Timeline')
+ self._inspector_backend.UnregisterDomain('Timeline')
def _SendSyncRequest(self, req, timeout=60):
- res = self._tab_backend.SyncRequest(req, timeout)
+ res = self._inspector_backend.SyncRequest(req, timeout)
if 'error' in res:
- raise TabBackendException(res['error']['message'])
+ raise InspectorBackendException(res['error']['message'])
return res['result']
def _OnNotification(self, msg):
@@ -119,5 +120,5 @@
def _OnClose(self):
if self._is_recording:
- raise TabBackendException('InspectTimeline received OnClose whilst '
+ raise InspectorBackendException('InspectTimeline received OnClose whilst '
'recording.')
« no previous file with comments | « tools/telemetry/telemetry/inspector_runtime.py ('k') | tools/telemetry/telemetry/page_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698