| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 import json | 4 import json |
| 5 import logging | 5 import logging |
| 6 import socket | 6 import socket |
| 7 | 7 |
| 8 from chrome_remote_control import tab_crash_exception | 8 from telemetry import tab_crash_exception |
| 9 from chrome_remote_control import util | 9 from telemetry import util |
| 10 from chrome_remote_control import websocket | 10 from telemetry import websocket |
| 11 | 11 |
| 12 class InspectorException(Exception): | 12 class InspectorException(Exception): |
| 13 pass | 13 pass |
| 14 | 14 |
| 15 class InspectorBackend(object): | 15 class InspectorBackend(object): |
| 16 def __init__(self, backend, descriptor): | 16 def __init__(self, backend, descriptor): |
| 17 self._backend = backend | 17 self._backend = backend |
| 18 self._descriptor = descriptor | 18 self._descriptor = descriptor |
| 19 self._socket_url = descriptor['webSocketDebuggerUrl'] | 19 self._socket_url = descriptor['webSocketDebuggerUrl'] |
| 20 self._socket = websocket.create_connection( | 20 self._socket = websocket.create_connection( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return | 115 return |
| 116 def OnConsoleClose(self): | 116 def OnConsoleClose(self): |
| 117 pass | 117 pass |
| 118 inspector_backend.RegisterDomain('Console', | 118 inspector_backend.RegisterDomain('Console', |
| 119 OnConsoleNotification, OnConsoleClose) | 119 OnConsoleNotification, OnConsoleClose) |
| 120 """ | 120 """ |
| 121 assert domain_name not in self._domain_handlers | 121 assert domain_name not in self._domain_handlers |
| 122 self._domain_handlers[domain_name] = (notification_handler, | 122 self._domain_handlers[domain_name] = (notification_handler, |
| 123 will_close_handler) | 123 will_close_handler) |
| 124 | 124 |
| OLD | NEW |