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

Side by Side Diff: telemetry/telemetry/internal/backends/chrome_inspector/inspector_storage.py

Issue 3013243002: Refactor websocket connections logic with devtool Storage domain to a separate class (Closed)
Patch Set: Created 3 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from telemetry.core import exceptions
6
7
8 class InspectorStorage(object):
9 def __init__(self, inspector_websocket):
10 self._websocket = inspector_websocket
11 self._websocket.RegisterDomain('Storage', self._OnNotification)
12
13 def _OnNotification(self, msg):
14 # TODO: track storage events
15 # (https://chromedevtools.github.io/devtools-protocol/tot/Storage/)
16 pass
17
18 def ClearDataForOrigin(self, url, timeout):
19 res = self._websocket.SyncRequest(
20 {'method': 'Storage.clearDataForOrigin',
21 'params': {
22 'origin': url,
23 'storageTypes': 'all',
24 }}, timeout)
25 if 'error' in res:
perezju 2017/09/22 12:59:19 for a follow up, but maybe something like this sho
nednguyen 2017/09/22 13:02:40 Yeah, I was thinking the same too.
26 raise exceptions.StoryActionError(res['error']['message'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698