OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * | 7 * |
8 * HostInstaller allows the caller to download the host binary and monitor the | 8 * HostInstaller allows the caller to download the host binary and monitor the |
9 * install progress of the host by pinging the host periodically via native | 9 * install progress of the host by pinging the host periodically via native |
10 * messaging. | 10 * messaging. |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 /** @suppress {duplicate} */ | 26 /** @suppress {duplicate} */ |
27 var remoting = remoting || {}; | 27 var remoting = remoting || {}; |
28 | 28 |
29 (function() { | 29 (function() { |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 */ | 33 */ |
34 remoting.HostInstaller = function() { | 34 remoting.HostInstaller = function() { |
35 /** | 35 /** @private {Promise} */ |
36 * @type {Promise} | |
37 * @private | |
38 */ | |
39 this.downloadAndWaitForInstallPromise_ = null; | 36 this.downloadAndWaitForInstallPromise_ = null; |
40 | 37 |
41 /** | 38 /** @private {?number} */ |
42 * @type {?number} | |
43 * @private | |
44 */ | |
45 this.checkInstallIntervalId_ = null; | 39 this.checkInstallIntervalId_ = null; |
46 }; | 40 }; |
47 | 41 |
48 /** | 42 /** |
49 * @return {Promise} The promise will resolve to a boolean value indicating | 43 * @return {Promise} The promise will resolve to a boolean value indicating |
50 * whether the host is installed or not. | 44 * whether the host is installed or not. |
51 */ | 45 */ |
52 remoting.HostInstaller.isInstalled = function() { | 46 remoting.HostInstaller.isInstalled = function() { |
53 // Always do a fresh check as we don't get notified when the host is | 47 // Always do a fresh check as we don't get notified when the host is |
54 // uninstalled. | 48 // uninstalled. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 */ | 165 */ |
172 remoting.HostInstaller.prototype.cancel = function() { | 166 remoting.HostInstaller.prototype.cancel = function() { |
173 if (this.checkInstallIntervalId_ !== null) { | 167 if (this.checkInstallIntervalId_ !== null) { |
174 window.clearInterval(this.checkInstallIntervalId_); | 168 window.clearInterval(this.checkInstallIntervalId_); |
175 this.checkInstallIntervalId_ = null; | 169 this.checkInstallIntervalId_ = null; |
176 } | 170 } |
177 this.downloadAndWaitForInstallPromise_ = null; | 171 this.downloadAndWaitForInstallPromise_ = null; |
178 }; | 172 }; |
179 | 173 |
180 })(); | 174 })(); |
OLD | NEW |