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

Side by Side Diff: mojo/public/js/associated_bindings.js

Issue 2844133003: Add associated binding set. Add associated_binding.html layout test. (Closed)
Patch Set: Simplify binding and associated bindings code. Fix associated_binding.html test. Created 3 years, 7 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
« no previous file with comments | « no previous file | mojo/public/js/bindings.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!this.isBound()) { 228 if (!this.isBound()) {
224 return new types.AssociatedInterfaceRequest(null); 229 return new types.AssociatedInterfaceRequest(null);
225 } 230 }
226 231
227 var result = new types.AssociatedInterfaceRequest( 232 var result = new types.AssociatedInterfaceRequest(
228 this.interfaceEndpointClient_.passHandle()); 233 this.interfaceEndpointClient_.passHandle());
229 this.close(); 234 this.close();
230 return result; 235 return result;
231 }; 236 };
232 237
238 // ---------------------------------------------------------------------------
239
240 function AssociatedBindingSet(interfaceType) {
241 bindings.BindingSet.call(this, interfaceType);
242 this.bindingType = AssociatedBinding;
yzshen1 2017/04/27 23:46:00 Please make this a private member.
wangjimmy 2017/04/28 03:02:07 Done.
243 }
244
245 AssociatedBindingSet.prototype = Object.create(bindings.BindingSet.prototype);
246 AssociatedBindingSet.prototype.constructor = AssociatedBindingSet;
247
233 var exports = {}; 248 var exports = {};
234 exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo; 249 exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo;
235 exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest; 250 exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest;
236 exports.makeRequest = makeRequest; 251 exports.makeRequest = makeRequest;
237 exports.AssociatedInterfacePtrController = AssociatedInterfacePtrController; 252 exports.AssociatedInterfacePtrController = AssociatedInterfacePtrController;
238 exports.AssociatedBinding = AssociatedBinding; 253 exports.AssociatedBinding = AssociatedBinding;
254 exports.AssociatedBindingSet = AssociatedBindingSet;
239 255
240 return exports; 256 return exports;
241 }); 257 });
OLDNEW
« no previous file with comments | « no previous file | mojo/public/js/bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698