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

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

Issue 10198006: Trap exceptions calling getDaemonConfig on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 function onConfig(configStr) { 312 function onConfig(configStr) {
313 var config = /** @type {Object.<string,string>} */ JSON.parse(configStr); 313 var config = /** @type {Object.<string,string>} */ JSON.parse(configStr);
314 if (typeof config['host_id'] == 'string') { 314 if (typeof config['host_id'] == 'string') {
315 var hostId = config['host_id']; 315 var hostId = config['host_id'];
316 that.setHost(hostList.getHostForId(hostId)); 316 that.setHost(hostList.getHostForId(hostId));
317 } else { 317 } else {
318 that.setHost(null); 318 that.setHost(null);
319 } 319 }
320 onDone(); 320 onDone();
321 }; 321 };
322 this.plugin_.getDaemonConfig(onConfig); 322 try {
323 this.plugin_.getDaemonConfig(onConfig);
324 } catch (err) {
325 this.setHost(null);
326 onDone();
Wez 2012/04/24 02:17:21 nit: You could just onConfig('{}') here.
327 }
323 }; 328 };
324 329
325 /** @type {remoting.HostController} */ 330 /** @type {remoting.HostController} */
326 remoting.hostController = null; 331 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