OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * Class to communicate with the Host components via Native Messaging. | 7 * Class to communicate with the Host components via Native Messaging. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 }; | 358 }; |
359 | 359 |
360 /** | 360 /** |
361 * @return {void} Nothing. | 361 * @return {void} Nothing. |
362 * @private | 362 * @private |
363 */ | 363 */ |
364 remoting.HostNativeMessaging.prototype.onDisconnect_ = function() { | 364 remoting.HostNativeMessaging.prototype.onDisconnect_ = function() { |
365 console.error('Native Message port disconnected'); | 365 console.error('Native Message port disconnected'); |
366 | 366 |
367 // Notify the error-handlers of any requests that are still outstanding. | 367 // Notify the error-handlers of any requests that are still outstanding. |
368 for (var id in this.pendingReplies_) { | 368 var pendingReplies = this.pendingReplies_; |
369 this.pendingReplies_[/** @type {number} */(id)].onError( | 369 this.pendingReplies_ = {}; |
| 370 |
| 371 for (var id in pendingReplies) { |
| 372 pendingReplies[/** @type {number} */(id)].onError( |
370 remoting.Error.UNEXPECTED); | 373 remoting.Error.UNEXPECTED); |
371 } | 374 } |
372 this.pendingReplies_ = {}; | |
373 } | 375 } |
374 | 376 |
375 /** | 377 /** |
376 * @param {function(string):void} onDone Callback to be called with the | 378 * @param {function(string):void} onDone Callback to be called with the |
377 * local hostname. | 379 * local hostname. |
378 * @param {function(remoting.Error):void} onError The callback to be triggered | 380 * @param {function(remoting.Error):void} onError The callback to be triggered |
379 * on error. | 381 * on error. |
380 * @return {void} Nothing. | 382 * @return {void} Nothing. |
381 */ | 383 */ |
382 remoting.HostNativeMessaging.prototype.getHostName = | 384 remoting.HostNativeMessaging.prototype.getHostName = |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 * on error. | 591 * on error. |
590 * @return {void} Nothing. | 592 * @return {void} Nothing. |
591 */ | 593 */ |
592 remoting.HostNativeMessaging.prototype.getCredentialsFromAuthCode = | 594 remoting.HostNativeMessaging.prototype.getCredentialsFromAuthCode = |
593 function(authorizationCode, onDone, onError) { | 595 function(authorizationCode, onDone, onError) { |
594 this.postMessage_({ | 596 this.postMessage_({ |
595 type: 'getCredentialsFromAuthCode', | 597 type: 'getCredentialsFromAuthCode', |
596 authorizationCode: authorizationCode | 598 authorizationCode: authorizationCode |
597 }, onDone, onError); | 599 }, onDone, onError); |
598 }; | 600 }; |
OLD | NEW |