Chromium Code Reviews| 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 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Class that wraps low-level details of interacting with the client plugin. | 7 * Class that wraps low-level details of interacting with the client plugin. |
| 8 * | 8 * |
| 9 * This abstracts a <embed> element and controls the plugin which does | 9 * This abstracts a <embed> element and controls the plugin which does |
| 10 * the actual remoting work. It also handles differences between | 10 * the actual remoting work. It also handles differences between |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 | 320 |
| 321 } else if (message.method == 'mediaSourceData') { | 321 } else if (message.method == 'mediaSourceData') { |
| 322 if (!(message.data['buffer'] instanceof ArrayBuffer)) { | 322 if (!(message.data['buffer'] instanceof ArrayBuffer)) { |
| 323 console.error('Invalid mediaSourceData message:', message.data); | 323 console.error('Invalid mediaSourceData message:', message.data); |
| 324 return; | 324 return; |
| 325 } | 325 } |
| 326 if (!this.mediaSourceRenderer_) { | 326 if (!this.mediaSourceRenderer_) { |
| 327 console.error('Unexpected mediaSourceData.'); | 327 console.error('Unexpected mediaSourceData.'); |
| 328 return; | 328 return; |
| 329 } | 329 } |
| 330 // keyframe flag may be absent from the message. | |
| 331 var keyframe = !!message.data['keyframe']; | |
|
Jamie
2014/06/11 21:41:42
Does this pass jscompile? I'm surprised you don't
Sergey Ulanov
2014/06/11 23:41:12
Yes it does.
| |
| 330 this.mediaSourceRenderer_.onIncomingData( | 332 this.mediaSourceRenderer_.onIncomingData( |
| 331 (/** @type {ArrayBuffer} */ message.data['buffer'])); | 333 (/** @type {ArrayBuffer} */ message.data['buffer']), keyframe); |
| 332 } | 334 } |
| 333 }; | 335 }; |
| 334 | 336 |
| 335 /** | 337 /** |
| 336 * Deletes the plugin. | 338 * Deletes the plugin. |
| 337 */ | 339 */ |
| 338 remoting.ClientPlugin.prototype.cleanup = function() { | 340 remoting.ClientPlugin.prototype.cleanup = function() { |
| 339 this.plugin.parentNode.removeChild(this.plugin); | 341 this.plugin.parentNode.removeChild(this.plugin); |
| 340 }; | 342 }; |
| 341 | 343 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 701 this.plugin.style.width = width + 'px'; | 703 this.plugin.style.width = width + 'px'; |
| 702 this.plugin.style.height = height + 'px'; | 704 this.plugin.style.height = height + 'px'; |
| 703 // Center the plugin just underneath the "Connnecting..." dialog. | 705 // Center the plugin just underneath the "Connnecting..." dialog. |
| 704 var parentNode = this.plugin.parentNode; | 706 var parentNode = this.plugin.parentNode; |
| 705 var dialog = document.getElementById('client-dialog'); | 707 var dialog = document.getElementById('client-dialog'); |
| 706 var dialogRect = dialog.getBoundingClientRect(); | 708 var dialogRect = dialog.getBoundingClientRect(); |
| 707 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; | 709 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; |
| 708 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; | 710 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; |
| 709 } | 711 } |
| 710 }; | 712 }; |
| OLD | NEW |