| OLD | NEW |
| 1 <import src="/mojo/public/sky/connection.sky" as="connection" /> | 1 <import src="/mojo/public/sky/connection.sky" as="connection" /> |
| 2 <import src="/mojo/public/sky/core.sky" as="core" /> | 2 <import src="/mojo/public/sky/core.sky" as="core" /> |
| 3 <import src="/mojo/public/sky/support.sky" as="support" /> | 3 <import src="/mojo/public/sky/support.sky" as="support" /> |
| 4 <import src="/sky/services/inspector/inspector.mojom.sky" as="inspector" /> | 4 <import src="/sky/services/inspector/inspector.mojom.sky" as="inspector" /> |
| 5 <import src="console-agent.sky" as="ConsoleAgent" /> | 5 <import src="console-agent.sky" as="ConsoleAgent" /> |
| 6 <import src="dom-agent.sky" as="DOMAgent" /> | 6 <import src="dom-agent.sky" as="DOMAgent" /> |
| 7 <import src="page-agent.sky" as="PageAgent" /> | 7 <import src="page-agent.sky" as="PageAgent" /> |
| 8 <import src="worker-agent.sky" as="WorkerAgent" /> | 8 <import src="worker-agent.sky" as="WorkerAgent" /> |
| 9 <import src="runtime-agent.sky" as="RuntimeAgent" /> | 9 <import src="runtime-agent.sky" as="RuntimeAgent" /> |
| 10 <import src="indexeddb-agent.sky" as="IndexedDBAgent" /> | 10 <import src="indexeddb-agent.sky" as="IndexedDBAgent" /> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 try { | 62 try { |
| 63 return agent[methodName](params); | 63 return agent[methodName](params); |
| 64 } catch(ex) { | 64 } catch(ex) { |
| 65 console.log(descriptor + ": " + ex); | 65 console.log(descriptor + ": " + ex); |
| 66 } | 66 } |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 InspectorBackend.prototype.onMessage = function(data) { | 69 InspectorBackend.prototype.onMessage = function(data) { |
| 70 console.log("onMessage"); |
| 70 var message = JSON.parse(data); | 71 var message = JSON.parse(data); |
| 71 var result = this.dispatch_(message.method, message.params); | 72 var result = this.dispatch_(message.method, message.params); |
| 72 var response = { | 73 var response = { |
| 73 id: message.id, | 74 id: message.id, |
| 74 }; | 75 }; |
| 75 if (typeof result !== "undefined") | 76 if (typeof result !== "undefined") |
| 76 response.result = result; | 77 response.result = result; |
| 77 this.frontend.sendMessage(JSON.stringify(response)); | 78 this.frontend.sendMessage(JSON.stringify(response)); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 InspectorBackend.prototype.sendMessage = function(method, params) { | 81 InspectorBackend.prototype.sendMessage = function(method, params) { |
| 81 var message = JSON.stringify({ | 82 var message = JSON.stringify({ |
| 82 method: method, | 83 method: method, |
| 83 params: params, | 84 params: params, |
| 84 }); | 85 }); |
| 85 this.frontend.sendMessage(message); | 86 this.frontend.sendMessage(message); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 var frontendHandle = internals.connectToService( | 89 var frontendHandle = internals.connectToService( |
| 89 "mojo:sky_inspector_server", inspector.InspectorFrontend.name); | 90 "mojo:sky_inspector_server", inspector.InspectorFrontend.name); |
| 90 window.frontendConnection = new connection.Connection( | 91 window.frontendConnection = new connection.Connection( |
| 91 frontendHandle, | 92 frontendHandle, |
| 92 InspectorBackend, | 93 InspectorBackend, |
| 93 inspector.InspectorFrontend.proxyClass); | 94 inspector.InspectorFrontend.proxyClass); |
| 94 | 95 |
| 95 window.frontend = frontendConnection.remote; | 96 window.frontend = frontendConnection.remote; |
| 96 frontend.listen(9898); | 97 console.log("inspector.sky" + window.frontend); |
| 97 </script> | 98 </script> |
| OLD | NEW |