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

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

Issue 10535070: Don't deregister the host if it wasn't stopped. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« 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 (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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 /** @constructor */ 10 /** @constructor */
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 * @param {function(remoting.HostController.AsyncResult):void} callback 235 * @param {function(remoting.HostController.AsyncResult):void} callback
236 * Callback to be called when finished. 236 * Callback to be called when finished.
237 * @return {void} Nothing. 237 * @return {void} Nothing.
238 */ 238 */
239 remoting.HostController.prototype.stop = function(callback) { 239 remoting.HostController.prototype.stop = function(callback) {
240 /** @type {remoting.HostController} */ 240 /** @type {remoting.HostController} */
241 var that = this; 241 var that = this;
242 242
243 /** @param {remoting.HostController.AsyncResult} result */ 243 /** @param {remoting.HostController.AsyncResult} result */
244 function onStopped(result) { 244 function onStopped(result) {
245 if (that.localHost && that.localHost.hostId) { 245 if (result == remoting.HostController.AsyncResult.OK &&
246 that.localHost && that.localHost.hostId) {
246 remoting.HostList.unregisterHostById(that.localHost.hostId); 247 remoting.HostList.unregisterHostById(that.localHost.hostId);
247 } 248 }
248 callback(result); 249 callback(result);
249 }; 250 };
250 this.plugin_.stopDaemon(onStopped); 251 this.plugin_.stopDaemon(onStopped);
251 }; 252 };
252 253
253 /** 254 /**
254 * Parse a stringified host configuration and return it as a dictionary if it 255 * Parse a stringified host configuration and return it as a dictionary if it
255 * is well-formed and contains both host_id and xmpp_login keys. null is 256 * is well-formed and contains both host_id and xmpp_login keys. null is
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 try { 363 try {
363 this.plugin_.getDaemonConfig(onConfig); 364 this.plugin_.getDaemonConfig(onConfig);
364 } catch (err) { 365 } catch (err) {
365 this.setHost(null); 366 this.setHost(null);
366 onDone(); 367 onDone();
367 } 368 }
368 }; 369 };
369 370
370 /** @type {remoting.HostController} */ 371 /** @type {remoting.HostController} */
371 remoting.hostController = null; 372 remoting.hostController = null;
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