OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bindings", [ | 5 define("mojo/public/js/bindings", [ |
6 "mojo/public/js/connection", | 6 "mojo/public/js/connection", |
7 "mojo/public/js/core", | 7 "mojo/public/js/core", |
8 "mojo/public/js/interface_types", | 8 "mojo/public/js/interface_types", |
9 ], function(connection, core, types) { | 9 ], function(connection, core, types) { |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 }; | 181 }; |
182 | 182 |
183 // --------------------------------------------------------------------------- | 183 // --------------------------------------------------------------------------- |
184 | 184 |
185 function BindingSetEntry(bindingSet, interfaceType, impl, requestOrHandle, | 185 function BindingSetEntry(bindingSet, interfaceType, impl, requestOrHandle, |
186 bindingId) { | 186 bindingId) { |
187 this.bindingSet_ = bindingSet; | 187 this.bindingSet_ = bindingSet; |
188 this.bindingId_ = bindingId; | 188 this.bindingId_ = bindingId; |
189 this.binding_ = new Binding(interfaceType, impl, requestOrHandle); | 189 this.binding_ = new Binding(interfaceType, impl, requestOrHandle); |
190 | 190 |
191 this.binding_.setConnectionErrorHandler( | 191 this.binding_.setConnectionErrorHandler(function() { |
192 () => this.bindingSet_.onConnectionError(bindingId)); | 192 this.bindingSet_.onConnectionError(bindingId); |
| 193 }.bind(this)); |
193 } | 194 } |
194 | 195 |
195 BindingSetEntry.prototype.close = function() { | 196 BindingSetEntry.prototype.close = function() { |
196 this.binding_.close(); | 197 this.binding_.close(); |
197 }; | 198 }; |
198 | 199 |
199 function BindingSet(interfaceType) { | 200 function BindingSet(interfaceType) { |
200 this.interfaceType_ = interfaceType; | 201 this.interfaceType_ = interfaceType; |
201 this.nextBindingId_ = 0; | 202 this.nextBindingId_ = 0; |
202 this.bindings_ = new Map(); | 203 this.bindings_ = new Map(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // TODO(yzshen): Remove the following exports. | 244 // TODO(yzshen): Remove the following exports. |
244 exports.EmptyProxy = connection.EmptyProxy; | 245 exports.EmptyProxy = connection.EmptyProxy; |
245 exports.EmptyStub = connection.EmptyStub; | 246 exports.EmptyStub = connection.EmptyStub; |
246 exports.ProxyBase = connection.ProxyBase; | 247 exports.ProxyBase = connection.ProxyBase; |
247 exports.ProxyBindings = connection.ProxyBindings; | 248 exports.ProxyBindings = connection.ProxyBindings; |
248 exports.StubBase = connection.StubBase; | 249 exports.StubBase = connection.StubBase; |
249 exports.StubBindings = connection.StubBindings; | 250 exports.StubBindings = connection.StubBindings; |
250 | 251 |
251 return exports; | 252 return exports; |
252 }); | 253 }); |
OLD | NEW |