OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 var remoting = remoting || {}; | 5 var remoting = remoting || {}; |
6 | 6 |
7 (function() { | 7 (function() { |
8 'use strict'; | 8 'use strict'; |
9 | 9 |
10 window.addEventListener('blur', pluginLostFocus_, false); | 10 window.addEventListener('blur', pluginLostFocus_, false); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 } | 351 } |
352 | 352 |
353 remoting.cancelShare = function() { | 353 remoting.cancelShare = function() { |
354 remoting.debug.log('Canceling share...'); | 354 remoting.debug.log('Canceling share...'); |
355 var plugin = document.getElementById(remoting.HOST_PLUGIN_ID); | 355 var plugin = document.getElementById(remoting.HOST_PLUGIN_ID); |
356 plugin.disconnect(); | 356 plugin.disconnect(); |
357 disableTimeoutCountdown_(); | 357 disableTimeoutCountdown_(); |
358 } | 358 } |
359 | 359 |
360 function updateStatistics() { | 360 function updateStatistics() { |
361 if (!remoting.session) | |
362 return; | |
Jamie
2011/08/25 22:57:14
I think I'd combine these with || rather than havi
Lambros
2011/08/25 23:11:30
I prefer to leave as-is, if that's OK. I find con
| |
361 if (remoting.session.state != remoting.ClientSession.State.CONNECTED) | 363 if (remoting.session.state != remoting.ClientSession.State.CONNECTED) |
362 return; | 364 return; |
363 var stats = remoting.session.stats(); | 365 var stats = remoting.session.stats(); |
364 | 366 |
365 var units = ''; | 367 var units = ''; |
366 var videoBandwidth = stats['video_bandwidth']; | 368 var videoBandwidth = stats['video_bandwidth']; |
367 if (videoBandwidth < 1024) { | 369 if (videoBandwidth < 1024) { |
368 units = 'Bps'; | 370 units = 'Bps'; |
369 } else if (videoBandwidth < 1048576) { | 371 } else if (videoBandwidth < 1048576) { |
370 units = 'KiBps'; | 372 units = 'KiBps'; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
630 return result; | 632 return result; |
631 default: | 633 default: |
632 return NULL; | 634 return NULL; |
633 } | 635 } |
634 } | 636 } |
635 | 637 |
636 }()); | 638 }()); |
637 | 639 |
638 // Shortcut to save typing now that this is the only way to show the debug log. | 640 // Shortcut to save typing now that this is the only way to show the debug log. |
639 var tdl = remoting.toggleDebugLog; | 641 var tdl = remoting.toggleDebugLog; |
OLD | NEW |