| OLD | NEW |
| 1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright 2013 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 */ | 4 */ |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @fileoverview | 7 * @fileoverview |
| 8 * The sandbox side of the application/sandbox WCS interface, used by the | 8 * The sandbox side of the application/sandbox WCS interface, used by the |
| 9 * sandbox to exchange messages with the application. | 9 * sandbox to exchange messages with the application. |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 'use strict'; | 12 'use strict'; |
| 13 | 13 |
| 14 /** @suppress {duplicate} */ | 14 /** @suppress {duplicate} */ |
| 15 var remoting = remoting || {}; | 15 var remoting = remoting || {}; |
| 16 | 16 |
| 17 /** @constructor */ | 17 /** @constructor */ |
| 18 remoting.WcsSandboxContent = function() { | 18 remoting.WcsSandboxContent = function() { |
| 19 /** | 19 /** @private {Window} */ |
| 20 * @type {Window} | |
| 21 * @private | |
| 22 */ | |
| 23 this.parentWindow_ = null; | 20 this.parentWindow_ = null; |
| 24 /** | 21 /** @private {number} */ |
| 25 * @type {number} | |
| 26 * @private | |
| 27 */ | |
| 28 this.nextXhrId_ = 0; | 22 this.nextXhrId_ = 0; |
| 29 /** | 23 /** @private {Object<number, XMLHttpRequest>} */ |
| 30 * @type {Object<number, XMLHttpRequest>} | |
| 31 * @private | |
| 32 */ | |
| 33 this.pendingXhrs_ = {}; | 24 this.pendingXhrs_ = {}; |
| 34 | 25 |
| 35 window.addEventListener('message', this.onMessage_.bind(this), false); | 26 window.addEventListener('message', this.onMessage_.bind(this), false); |
| 36 }; | 27 }; |
| 37 | 28 |
| 38 /** | 29 /** |
| 39 * Event handler to process messages from the application. | 30 * Event handler to process messages from the application. |
| 40 * | 31 * |
| 41 * @param {Event} event | 32 * @param {Event} event |
| 42 */ | 33 */ |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 }; | 212 }; |
| 222 | 213 |
| 223 remoting.settings = new remoting.Settings(); | 214 remoting.settings = new remoting.Settings(); |
| 224 remoting.sandboxContent = new remoting.WcsSandboxContent(); | 215 remoting.sandboxContent = new remoting.WcsSandboxContent(); |
| 225 } | 216 } |
| 226 | 217 |
| 227 window.addEventListener('load', onSandboxInit, false); | 218 window.addEventListener('load', onSandboxInit, false); |
| 228 | 219 |
| 229 /** @type {remoting.WcsSandboxContent} */ | 220 /** @type {remoting.WcsSandboxContent} */ |
| 230 remoting.sandboxContent = null; | 221 remoting.sandboxContent = null; |
| OLD | NEW |