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 * Module to support debug overlay window with connection stats. | 7 * Module to support debug overlay window with connection stats. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 19 matching lines...) Expand all Loading... |
30 /** @private */ | 30 /** @private */ |
31 this.plugin_ = plugin; | 31 this.plugin_ = plugin; |
32 | 32 |
33 var that = this; | 33 var that = this; |
34 | 34 |
35 /** @private */ | 35 /** @private */ |
36 this.timer_ = new base.RepeatingTimer(function(){ | 36 this.timer_ = new base.RepeatingTimer(function(){ |
37 that.update(plugin.getPerfStats()); | 37 that.update(plugin.getPerfStats()); |
38 }, 1000, true); | 38 }, 1000, true); |
39 | 39 |
40 remoting.windowShape.addCallback(this); | 40 remoting.windowShape.registerClientUI(this); |
41 }; | 41 }; |
42 | 42 |
43 remoting.ConnectionStats.prototype.dispose = function() { | 43 remoting.ConnectionStats.prototype.dispose = function() { |
44 base.dispose(this.timer_); | 44 base.dispose(this.timer_); |
45 this.timer_ = null; | 45 this.timer_ = null; |
46 this.plugin_ = null; | 46 this.plugin_ = null; |
| 47 remoting.windowShape.unregisterClientUI(this); |
47 }; | 48 }; |
48 | 49 |
49 /** | 50 /** |
50 * @return {remoting.ClientSession.PerfStats} The most recently-set PerfStats, | 51 * @return {remoting.ClientSession.PerfStats} The most recently-set PerfStats, |
51 * or null if update() has not yet been called. | 52 * or null if update() has not yet been called. |
52 */ | 53 */ |
53 remoting.ConnectionStats.prototype.mostRecent = function() { | 54 remoting.ConnectionStats.prototype.mostRecent = function() { |
54 return this.mostRecent_; | 55 return this.mostRecent_; |
55 }; | 56 }; |
56 | 57 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 var statistics = document.getElementById('statistics'); | 129 var statistics = document.getElementById('statistics'); |
129 this.statsElement_.innerText = ( | 130 this.statsElement_.innerText = ( |
130 'Bandwidth: ' + formatStatNumber(videoBandwidth, units) + | 131 'Bandwidth: ' + formatStatNumber(videoBandwidth, units) + |
131 ', Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps') + | 132 ', Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps') + |
132 ', Capture: ' + formatStatNumber(stats.captureLatency, 'ms') + | 133 ', Capture: ' + formatStatNumber(stats.captureLatency, 'ms') + |
133 ', Encode: ' + formatStatNumber(stats.encodeLatency, 'ms') + | 134 ', Encode: ' + formatStatNumber(stats.encodeLatency, 'ms') + |
134 ', Decode: ' + formatStatNumber(stats.decodeLatency, 'ms') + | 135 ', Decode: ' + formatStatNumber(stats.decodeLatency, 'ms') + |
135 ', Render: ' + formatStatNumber(stats.renderLatency, 'ms') + | 136 ', Render: ' + formatStatNumber(stats.renderLatency, 'ms') + |
136 ', Latency: ' + formatStatNumber(stats.roundtripLatency, 'ms')); | 137 ', Latency: ' + formatStatNumber(stats.roundtripLatency, 'ms')); |
137 }; | 138 }; |
OLD | NEW |