| 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="/mojo/services/public/sky/application.sky" as="application" /> |
| 4 <import src="/sky/services/inspector/inspector.mojom.sky" as="inspector" /> | 5 <import src="/sky/services/inspector/inspector.mojom.sky" as="inspector" /> |
| 5 <import src="console-agent.sky" as="ConsoleAgent" /> | 6 <import src="console-agent.sky" as="ConsoleAgent" /> |
| 6 <import src="dom-agent.sky" as="DOMAgent" /> | 7 <import src="dom-agent.sky" as="DOMAgent" /> |
| 7 <import src="page-agent.sky" as="PageAgent" /> | 8 <import src="page-agent.sky" as="PageAgent" /> |
| 8 <import src="worker-agent.sky" as="WorkerAgent" /> | 9 <import src="worker-agent.sky" as="WorkerAgent" /> |
| 9 <import src="runtime-agent.sky" as="RuntimeAgent" /> | 10 <import src="runtime-agent.sky" as="RuntimeAgent" /> |
| 10 <import src="indexeddb-agent.sky" as="IndexedDBAgent" /> | 11 <import src="indexeddb-agent.sky" as="IndexedDBAgent" /> |
| 11 <import src="css-agent.sky" as="CSSAgent" /> | 12 <import src="css-agent.sky" as="CSSAgent" /> |
| 12 <script> | 13 <script> |
| 13 function InspectorBackend(frontend) { | 14 function InspectorBackend(frontend) { |
| 14 this.frontend = frontend; | |
| 15 var domAgent = new DOMAgent(this); | 15 var domAgent = new DOMAgent(this); |
| 16 this.agents = { | 16 this.agents = { |
| 17 Console: new ConsoleAgent(), | 17 Console: new ConsoleAgent(), |
| 18 DOM: domAgent, | 18 DOM: domAgent, |
| 19 Page: new PageAgent(this), | 19 Page: new PageAgent(this), |
| 20 Worker: new WorkerAgent(), | 20 Worker: new WorkerAgent(), |
| 21 Runtime: new RuntimeAgent(this), | 21 Runtime: new RuntimeAgent(this), |
| 22 CSS: new CSSAgent(domAgent), | 22 CSS: new CSSAgent(domAgent), |
| 23 IndexedDB: new IndexedDBAgent(), | 23 IndexedDB: new IndexedDBAgent(), |
| 24 }; | 24 }; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 var messageIndex = this.unansweredMessages_.indexOf(message_id); | 97 var messageIndex = this.unansweredMessages_.indexOf(message_id); |
| 98 if (messageIndex != -1) | 98 if (messageIndex != -1) |
| 99 this.unansweredMessages_.splice(messageIndex, 1); | 99 this.unansweredMessages_.splice(messageIndex, 1); |
| 100 else | 100 else |
| 101 console.log("Error, responding to unknown message id " + message_id); | 101 console.log("Error, responding to unknown message id " + message_id); |
| 102 var response = { | 102 var response = { |
| 103 id: message_id, | 103 id: message_id, |
| 104 }; | 104 }; |
| 105 if (typeof result !== "undefined") | 105 if (typeof result !== "undefined") |
| 106 response.result = result; | 106 response.result = result; |
| 107 this.frontend.sendMessage(JSON.stringify(response)); | 107 window.frontend.sendMessage(JSON.stringify(response)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 InspectorBackend.prototype.sendMessage = function(method, params) { | 110 InspectorBackend.prototype.sendMessage = function(method, params) { |
| 111 var message = JSON.stringify({ | 111 var message = JSON.stringify({ |
| 112 method: method, | 112 method: method, |
| 113 params: params, | 113 params: params, |
| 114 }); | 114 }); |
| 115 this.frontend.sendMessage(message); | 115 window.frontend.sendMessage(message); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 var frontendHandle = internals.connectToService( | 118 (function() { |
| 119 "mojo:sky_inspector_server", inspector.InspectorFrontend.name); | 119 var app = new application.Application(internals.passShellProxyHandle()); |
| 120 window.frontendConnection = new connection.Connection( | 120 var tracingApp = app.shell.connectToApplication("mojo:sky_inspector_server"); |
| 121 frontendHandle, | 121 tracingApp.provideService(inspector.InspectorBackend, InspectorBackend); |
| 122 InspectorBackend, | |
| 123 inspector.InspectorFrontend.proxyClass); | |
| 124 | 122 |
| 125 window.frontend = frontendConnection.remote; | 123 window.frontend = tracingApp.requestService(inspector.InspectorFrontend); |
| 124 })(); |
| 125 |
| 126 |
| 126 </script> | 127 </script> |
| OLD | NEW |