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

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

Issue 11819018: [Telemetry] Clean separation between tab (public API) and tab_backend (Chrome implementation). Flat… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make unit tests pass and merge. 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
diff --git a/tools/telemetry/telemetry/inspector_timeline.py b/tools/telemetry/telemetry/inspector_timeline.py
index 7daf6fc5f0e218976c1acd38ac6d1843dd1087d2..3089454e1846ffc5a728cebe1f51a07cea085f50 100644
--- a/tools/telemetry/telemetry/inspector_timeline.py
+++ b/tools/telemetry/telemetry/inspector_timeline.py
@@ -4,7 +4,7 @@
from telemetry.timeline_event import TimelineEvent
from telemetry.timeline_model import TimelineModel
-class InspectorBackendException(Exception):
+class TabBackendException(Exception):
pass
class InspectorTimeline(object):
@@ -20,9 +20,8 @@ class InspectorTimeline(object):
def __exit__(self, *args):
self._timeline.Stop()
- def __init__(self, inspector_backend, tab):
- self._inspector_backend = inspector_backend
- self._tab = tab
+ def __init__(self, tab_backend):
+ self._tab_backend = tab_backend
self._is_recording = False
self._timeline_model = None
@@ -35,24 +34,24 @@ class InspectorTimeline(object):
return
self._is_recording = True
self._timeline_model = TimelineModel()
- self._inspector_backend.RegisterDomain('Timeline',
+ self._tab_backend.RegisterDomain('Timeline',
self._OnNotification, self._OnClose)
req = {'method': 'Timeline.start'}
self._SendSyncRequest(req)
def Stop(self):
if not self._is_recording:
- raise InspectorBackendException('Stop() called but not started')
+ raise TabBackendException('Stop() called but not started')
self._is_recording = False
self._timeline_model.DidFinishRecording()
req = {'method': 'Timeline.stop'}
self._SendSyncRequest(req)
- self._inspector_backend.UnregisterDomain('Timeline')
+ self._tab_backend.UnregisterDomain('Timeline')
def _SendSyncRequest(self, req, timeout=60):
- res = self._inspector_backend.SyncRequest(req, timeout)
+ res = self._tab_backend.SyncRequest(req, timeout)
if 'error' in res:
- raise InspectorBackendException(res['error']['message'])
+ raise TabBackendException(res['error']['message'])
return res['result']
def _OnNotification(self, msg):
@@ -120,5 +119,5 @@ class InspectorTimeline(object):
def _OnClose(self):
if self._is_recording:
- raise InspectorBackendException('InspectTimeline received OnClose whilst '
+ raise TabBackendException('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