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 * The deserialized form of the chromoting host as returned by Apiary. | 7 * The deserialized form of the chromoting host as returned by Apiary. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
12 /** @suppress {duplicate} */ | 12 /** @suppress {duplicate} */ |
13 var remoting = remoting || {}; | 13 var remoting = remoting || {}; |
14 | 14 |
15 (function() { | 15 (function() { |
16 | 16 |
17 'use strict'; | 17 'use strict'; |
18 | 18 |
19 /** | 19 /** |
20 * @param {!string} hostId | 20 * @param {!string} hostId |
21 * | 21 * |
22 * TODO(kelvinp):Make fields private and expose them via getters. | 22 * TODO(kelvinp):Make fields private and expose them via getters. |
23 * @constructor | 23 * @constructor |
24 */ | 24 */ |
25 remoting.Host = function(hostId) { | 25 remoting.Host = function(hostId) { |
26 /** @const {string} */ | 26 /** @const {string} */ |
27 this.hostId = hostId; | 27 this.hostId = hostId; |
28 /** @type {string} */ | 28 /** @type {string} */ |
29 this.hostName = ''; | 29 this.hostName = ''; |
30 /** @type {string} */ | 30 /** |
| 31 * Either 'ONLINE' or 'OFFLINE'. |
| 32 * @type {string} |
| 33 */ |
31 this.status = ''; | 34 this.status = ''; |
32 /** @type {string} */ | 35 /** @type {string} */ |
33 this.jabberId = ''; | 36 this.jabberId = ''; |
34 /** @type {string} */ | 37 /** @type {string} */ |
35 this.publicKey = ''; | 38 this.publicKey = ''; |
36 /** @type {string} */ | 39 /** @type {string} */ |
37 this.hostVersion = ''; | 40 this.hostVersion = ''; |
38 /** @type {Array<string>} */ | 41 /** @type {Array<string>} */ |
39 this.tokenUrlPatterns = []; | 42 this.tokenUrlPatterns = []; |
40 /** @type {string} */ | 43 /** @type {string} */ |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 var hostMajorVersion = parseInt(host.hostVersion, 10); | 154 var hostMajorVersion = parseInt(host.hostVersion, 10); |
152 if (isNaN(hostMajorVersion)) { | 155 if (isNaN(hostMajorVersion)) { |
153 // Host versions 26 and higher include the version number in heartbeats, | 156 // Host versions 26 and higher include the version number in heartbeats, |
154 // so if it's missing then the host is at most version 25. | 157 // so if it's missing then the host is at most version 25. |
155 hostMajorVersion = 25; | 158 hostMajorVersion = 25; |
156 } | 159 } |
157 return (parseInt(webappVersion, 10) - hostMajorVersion) > 2; | 160 return (parseInt(webappVersion, 10) - hostMajorVersion) > 2; |
158 }; | 161 }; |
159 | 162 |
160 })(); | 163 })(); |
OLD | NEW |