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

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

Issue 615803002: Fix typo in host_installer.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 * @const 121 * @const
122 */ 122 */
123 var CHECK_INSTALL_INTERVAL_IN_MILLISECONDS = 1000; 123 var CHECK_INSTALL_INTERVAL_IN_MILLISECONDS = 1000;
124 124
125 /** @param {boolean} installed */ 125 /** @param {boolean} installed */
126 return this.isInstalled().then(function(installed){ 126 return this.isInstalled().then(function(installed){
127 if (installed) { 127 if (installed) {
128 return Promise.resolve(true); 128 return Promise.resolve(true);
129 } 129 }
130 130
131 if (that.downloadAndWaitForInstallPromise_ !== null) { 131 if (that.downloadAndWaitForInstallPromise_ === null) {
132 that.downloadAndWaitForInstallPromise_ = new Promise( 132 that.downloadAndWaitForInstallPromise_ = new Promise(
133 /** @param {Function} resolve */ 133 /** @param {Function} resolve */
134 function(resolve){ 134 function(resolve){
135 that.download(); 135 that.download();
136 that.checkInstallIntervalId_ = window.setInterval(function() { 136 that.checkInstallIntervalId_ = window.setInterval(function() {
137 /** @param {boolean} installed */ 137 /** @param {boolean} installed */
138 that.isInstalled().then(function(installed) { 138 that.isInstalled().then(function(installed) {
139 if (installed) { 139 if (installed) {
140 that.cancel(); 140 that.cancel();
141 resolve(); 141 resolve();
(...skipping 11 matching lines...) Expand all
153 * For example 153 * For example
154 * var promise = hostInstaller.downloadAndWaitForInstall(); 154 * var promise = hostInstaller.downloadAndWaitForInstall();
155 * hostInstaller.cancel(); // This will prevent |promise| from fulfilling. 155 * hostInstaller.cancel(); // This will prevent |promise| from fulfilling.
156 */ 156 */
157 remoting.HostInstaller.prototype.cancel = function() { 157 remoting.HostInstaller.prototype.cancel = function() {
158 if (this.checkInstallIntervalId_ !== null) { 158 if (this.checkInstallIntervalId_ !== null) {
159 window.clearInterval(this.checkInstallIntervalId_); 159 window.clearInterval(this.checkInstallIntervalId_);
160 this.checkInstallIntervalId_ = null; 160 this.checkInstallIntervalId_ = null;
161 } 161 }
162 this.downloadAndWaitForInstallPromise_ = null; 162 this.downloadAndWaitForInstallPromise_ = null;
163 }; 163 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698