| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 InspectorBackend.prototype.onMessage = function(data) { | 77 InspectorBackend.prototype.onMessage = function(data) { |
| 78 var message = JSON.parse(data); | 78 var message = JSON.parse(data); |
| 79 var result = this.dispatch_(message.method, message.params, message.id); | 79 var result = this.dispatch_(message.method, message.params, message.id); |
| 80 this.unansweredMessages_.push(message.id); | 80 this.unansweredMessages_.push(message.id); |
| 81 // FIXME: This magic return value is kinda hacky. | 81 // FIXME: This magic return value is kinda hacky. |
| 82 if (result != this.ASYNC_RESPONSE) | 82 if (result != this.ASYNC_RESPONSE) |
| 83 this.sendResponse(message.id, result); | 83 this.sendResponse(message.id, result); |
| 84 else { | 84 else { |
| 85 window.setTimeout(function(message_id) { | 85 window.setTimeout(function() { |
| 86 if (this.unansweredMessages_.indexOf(message_id) == -1) | 86 if (this.unansweredMessages_.indexOf(message.id) == -1) |
| 87 return; | 87 return; |
| 88 console.log("Error, failed to reply to " + descriptor | 88 console.log("Error, failed to reply to message id " + message.id); |
| 89 + " message id " + message_id); | 89 }.bind(this), this.MESSAGE_TIMEOUT_MS); |
| 90 }, this.MESSAGE_TIMEOUT_MS, this, message.id); | |
| 91 } | 90 } |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 InspectorBackend.prototype.sendResponse = function(message_id, result) { | 93 InspectorBackend.prototype.sendResponse = function(message_id, result) { |
| 95 var messageIndex = this.unansweredMessages_.indexOf(message_id); | 94 var messageIndex = this.unansweredMessages_.indexOf(message_id); |
| 96 if (messageIndex != -1) | 95 if (messageIndex != -1) |
| 97 this.unansweredMessages_.splice(messageIndex, 1); | 96 this.unansweredMessages_.splice(messageIndex, 1); |
| 98 else | 97 else |
| 99 console.log("Error, responding to unknown message id " + message_id); | 98 console.log("Error, responding to unknown message id " + message_id); |
| 100 var response = { | 99 var response = { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 115 | 114 |
| 116 var frontendHandle = internals.connectToService( | 115 var frontendHandle = internals.connectToService( |
| 117 "mojo:sky_inspector_server", inspector.InspectorFrontend.name); | 116 "mojo:sky_inspector_server", inspector.InspectorFrontend.name); |
| 118 window.frontendConnection = new connection.Connection( | 117 window.frontendConnection = new connection.Connection( |
| 119 frontendHandle, | 118 frontendHandle, |
| 120 InspectorBackend, | 119 InspectorBackend, |
| 121 inspector.InspectorFrontend.proxyClass); | 120 inspector.InspectorFrontend.proxyClass); |
| 122 | 121 |
| 123 window.frontend = frontendConnection.remote; | 122 window.frontend = frontendConnection.remote; |
| 124 </script> | 123 </script> |
| OLD | NEW |