Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: remoting/webapp/host.js

Issue 12905012: Webapp changes to support third party authentication (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, update patch Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/webapp/cs_third_party_auth_trampoline.js ('k') | remoting/webapp/jscompiler_hacks.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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';
(...skipping 12 matching lines...) Expand all
23 /** @type {string} */ 23 /** @type {string} */
24 this.hostId = ''; 24 this.hostId = '';
25 /** @type {string} */ 25 /** @type {string} */
26 this.status = ''; 26 this.status = '';
27 /** @type {string} */ 27 /** @type {string} */
28 this.jabberId = ''; 28 this.jabberId = '';
29 /** @type {string} */ 29 /** @type {string} */
30 this.publicKey = ''; 30 this.publicKey = '';
31 /** @type {string} */ 31 /** @type {string} */
32 this.hostVersion = ''; 32 this.hostVersion = '';
33 /** @type {Array.<string>} */
34 this.tokenUrlPatterns = [];
33 }; 35 };
34 36
35 /** 37 /**
36 * Determine whether a host needs to be manually updated. This is the case if 38 * Determine whether a host needs to be manually updated. This is the case if
37 * the host's major version number is more than 1 lower than that of the web- 39 * the host's major version number is more than 1 lower than that of the web-
38 * app (a difference of 1 is tolerated due to the different update mechanisms) 40 * app (a difference of 1 is tolerated due to the different update mechanisms)
39 * and if the host is on-line (off-line hosts are not expected to auto-update). 41 * and if the host is on-line (off-line hosts are not expected to auto-update).
40 * 42 *
41 * @param {remoting.Host} host The host information from the directory. 43 * @param {remoting.Host} host The host information from the directory.
42 * @param {string|number} webappVersion The version number of the web-app, in 44 * @param {string|number} webappVersion The version number of the web-app, in
43 * either dotted-decimal notation notation, or directly represented by the 45 * either dotted-decimal notation notation, or directly represented by the
44 * major version. 46 * major version.
45 * @return {boolean} True if the host is on-line but out-of-date. 47 * @return {boolean} True if the host is on-line but out-of-date.
46 */ 48 */
47 remoting.Host.needsUpdate = function(host, webappVersion) { 49 remoting.Host.needsUpdate = function(host, webappVersion) {
48 if (host.status != 'ONLINE') { 50 if (host.status != 'ONLINE') {
49 return false; 51 return false;
50 } 52 }
51 var hostMajorVersion = parseInt(host.hostVersion, 10); 53 var hostMajorVersion = parseInt(host.hostVersion, 10);
52 if (isNaN(hostMajorVersion)) { 54 if (isNaN(hostMajorVersion)) {
53 // Host versions 26 and higher include the version number in heartbeats, 55 // Host versions 26 and higher include the version number in heartbeats,
54 // so if it's missing then the host is at most version 25. 56 // so if it's missing then the host is at most version 25.
55 hostMajorVersion = 25; 57 hostMajorVersion = 25;
56 } 58 }
57 return (parseInt(webappVersion, 10) - hostMajorVersion) > 1; 59 return (parseInt(webappVersion, 10) - hostMajorVersion) > 1;
58 }; 60 };
OLDNEW
« no previous file with comments | « remoting/webapp/cs_third_party_auth_trampoline.js ('k') | remoting/webapp/jscompiler_hacks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698