| |
- __builtin__.object
-
- InspectorWebsocket
- telemetry.core.exceptions.Error(exceptions.Exception)
-
- WebSocketDisconnected
class InspectorWebsocket(__builtin__.object) |
| |
Methods defined here:
- AsyncRequest(self, req, callback)
- Sends an async request and returns immediately.
Response will be handled in the |callback| later when DispatchNotifications
is invoked.
Args:
callback: a function that takes inspector's response as the argument.
- Connect(self, url, timeout=10)
- Connects the websocket.
Raises:
websocket.WebSocketException
socket.error
- Disconnect(self)
- Disconnects the inspector websocket.
Raises:
websocket.WebSocketException
socket.error
- DispatchNotifications(self, timeout=10)
- Waits for responses from the websocket, dispatching them as necessary.
Raises:
websocket.WebSocketException: Error from websocket library.
socket.error: Error from websocket library.
exceptions.WebSocketDisconnected: The socket was disconnected.
- RegisterDomain(self, domain_name, notification_handler)
- Registers a given domain for handling notification methods.
For example, given inspector_backend:
def OnConsoleNotification(msg):
if msg['method'] == 'Console.messageAdded':
print msg['params']['message']
inspector_backend.RegisterDomain('Console', OnConsoleNotification)
Args:
domain_name: The devtools domain name. E.g., 'Tracing', 'Memory', 'Page'.
notification_handler: Handler for devtools notification. Will be
called if a devtools notification with matching domain is received
via DispatchNotifications. The handler accepts a single paramater:
the JSON object representing the notification.
- SendAndIgnoreResponse(self, req)
- Sends a request without waiting for a response.
Raises:
websocket.WebSocketException: Error from websocket library.
socket.error: Error from websocket library.
exceptions.WebSocketDisconnected: The socket was disconnected.
- SyncRequest(self, req, timeout=10)
- Sends a request and waits for a response.
Raises:
websocket.WebSocketException: Error from websocket library.
socket.error: Error from websocket library.
exceptions.WebSocketDisconnected: The socket was disconnected.
- UnregisterDomain(self, domain_name)
- Unregisters a previously registered domain.
- __init__(self)
- Create a websocket handler for communicating with Inspectors.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- METHOD_NOT_FOUND_CODE = -32601
|
|