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 define("mojo/public/js/associated_bindings", [ | 5 define("mojo/public/js/associated_bindings", [ |
| 6 "mojo/public/js/bindings", |
6 "mojo/public/js/core", | 7 "mojo/public/js/core", |
7 "mojo/public/js/interface_types", | 8 "mojo/public/js/interface_types", |
8 "mojo/public/js/lib/interface_endpoint_client", | 9 "mojo/public/js/lib/interface_endpoint_client", |
9 "mojo/public/js/lib/interface_endpoint_handle", | 10 "mojo/public/js/lib/interface_endpoint_handle", |
10 ], function(core, types, interfaceEndpointClient, interfaceEndpointHandle) { | 11 ], function(bindings, |
| 12 core, |
| 13 types, |
| 14 interfaceEndpointClient, |
| 15 interfaceEndpointHandle) { |
11 | 16 |
12 var InterfaceEndpointClient = interfaceEndpointClient.InterfaceEndpointClient; | 17 var InterfaceEndpointClient = interfaceEndpointClient.InterfaceEndpointClient; |
13 | 18 |
14 // --------------------------------------------------------------------------- | 19 // --------------------------------------------------------------------------- |
15 | 20 |
16 function makeRequest(associatedInterfacePtrInfo) { | 21 function makeRequest(associatedInterfacePtrInfo) { |
17 var {handle0, handle1} = | 22 var {handle0, handle1} = |
18 interfaceEndpointHandle.createPairPendingAssociation(); | 23 interfaceEndpointHandle.createPairPendingAssociation(); |
19 | 24 |
20 associatedInterfacePtrInfo.interfaceEndpointHandle = handle0; | 25 associatedInterfacePtrInfo.interfaceEndpointHandle = handle0; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 if (!this.isBound()) { | 235 if (!this.isBound()) { |
231 return new types.AssociatedInterfaceRequest(null); | 236 return new types.AssociatedInterfaceRequest(null); |
232 } | 237 } |
233 | 238 |
234 var result = new types.AssociatedInterfaceRequest( | 239 var result = new types.AssociatedInterfaceRequest( |
235 this.interfaceEndpointClient_.passHandle()); | 240 this.interfaceEndpointClient_.passHandle()); |
236 this.close(); | 241 this.close(); |
237 return result; | 242 return result; |
238 }; | 243 }; |
239 | 244 |
| 245 // --------------------------------------------------------------------------- |
| 246 |
| 247 function AssociatedBindingSet(interfaceType) { |
| 248 bindings.BindingSet.call(this, interfaceType); |
| 249 this.bindingType_ = AssociatedBinding; |
| 250 } |
| 251 |
| 252 AssociatedBindingSet.prototype = Object.create(bindings.BindingSet.prototype); |
| 253 AssociatedBindingSet.prototype.constructor = AssociatedBindingSet; |
| 254 |
240 var exports = {}; | 255 var exports = {}; |
241 exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo; | 256 exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo; |
242 exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest; | 257 exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest; |
243 exports.makeRequest = makeRequest; | 258 exports.makeRequest = makeRequest; |
244 exports.AssociatedInterfacePtrController = AssociatedInterfacePtrController; | 259 exports.AssociatedInterfacePtrController = AssociatedInterfacePtrController; |
245 exports.AssociatedBinding = AssociatedBinding; | 260 exports.AssociatedBinding = AssociatedBinding; |
| 261 exports.AssociatedBindingSet = AssociatedBindingSet; |
246 | 262 |
247 return exports; | 263 return exports; |
248 }); | 264 }); |
OLD | NEW |