OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 (function() { | 5 (function() { |
6 var internal = mojo.internal; | 6 var internal = mojo.internal; |
7 | 7 |
8 function InterfaceEndpointClient(interfaceEndpointHandle, receiver, | 8 function InterfaceEndpointClient(interfaceEndpointHandle, receiver, |
9 interfaceVersion) { | 9 interfaceVersion) { |
10 this.controller_ = null; | 10 this.controller_ = null; |
(...skipping 29 matching lines...) Expand all Loading... |
40 this.controller_ = this.handle_.groupController().attachEndpointClient( | 40 this.controller_ = this.handle_.groupController().attachEndpointClient( |
41 this.handle_, this); | 41 this.handle_, this); |
42 }; | 42 }; |
43 | 43 |
44 InterfaceEndpointClient.prototype.onAssociationEvent = function( | 44 InterfaceEndpointClient.prototype.onAssociationEvent = function( |
45 associationEvent) { | 45 associationEvent) { |
46 if (associationEvent === internal.AssociationEvent.ASSOCIATED) { | 46 if (associationEvent === internal.AssociationEvent.ASSOCIATED) { |
47 this.initControllerIfNecessary_(); | 47 this.initControllerIfNecessary_(); |
48 } else if (associationEvent === | 48 } else if (associationEvent === |
49 internal.AssociationEvent.PEER_CLOSED_BEFORE_ASSOCIATION) { | 49 internal.AssociationEvent.PEER_CLOSED_BEFORE_ASSOCIATION) { |
50 timer.createOneShot(0, this.notifyError.bind(this, | 50 setTimeout(this.notifyError.bind(this, this.handle_.disconnectReason()), |
51 this.handle_.disconnectReason())); | 51 0); |
52 } | 52 } |
53 }; | 53 }; |
54 | 54 |
55 InterfaceEndpointClient.prototype.passHandle = function() { | 55 InterfaceEndpointClient.prototype.passHandle = function() { |
56 if (!this.handle_.isValid()) { | 56 if (!this.handle_.isValid()) { |
57 return new internal.InterfaceEndpointHandle(); | 57 return new internal.InterfaceEndpointHandle(); |
58 } | 58 } |
59 | 59 |
60 // Used to clear the previously set callback. | 60 // Used to clear the previously set callback. |
61 this.handle_.setAssociationEventHandler(undefined); | 61 this.handle_.setAssociationEventHandler(undefined); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 InterfaceEndpointClient.prototype.requireVersion = function(version) { | 212 InterfaceEndpointClient.prototype.requireVersion = function(version) { |
213 this.controlMessageProxy_.requireVersion(version); | 213 this.controlMessageProxy_.requireVersion(version); |
214 }; | 214 }; |
215 | 215 |
216 InterfaceEndpointClient.prototype.getEncounteredError = function() { | 216 InterfaceEndpointClient.prototype.getEncounteredError = function() { |
217 return this.encounteredError_; | 217 return this.encounteredError_; |
218 }; | 218 }; |
219 | 219 |
220 internal.InterfaceEndpointClient = InterfaceEndpointClient; | 220 internal.InterfaceEndpointClient = InterfaceEndpointClient; |
221 })(); | 221 })(); |
OLD | NEW |