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 // --------------------------------------------------------------------------- | 8 // --------------------------------------------------------------------------- |
9 | 9 |
10 // |output| could be an interface pointer, InterfacePtrInfo or | 10 // |output| could be an interface pointer, InterfacePtrInfo or |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 this.reset(); | 122 this.reset(); |
123 return result; | 123 return result; |
124 }; | 124 }; |
125 | 125 |
126 InterfacePtrController.prototype.getProxy = function() { | 126 InterfacePtrController.prototype.getProxy = function() { |
127 this.configureProxyIfNecessary_(); | 127 this.configureProxyIfNecessary_(); |
128 return this.proxy_; | 128 return this.proxy_; |
129 }; | 129 }; |
130 | 130 |
131 InterfacePtrController.prototype.waitForNextMessageForTesting = function() { | |
132 this.configureProxyIfNecessary_(); | |
133 this.router_.waitForNextMessageForTesting(); | |
134 }; | |
135 | |
136 InterfacePtrController.prototype.configureProxyIfNecessary_ = function() { | 131 InterfacePtrController.prototype.configureProxyIfNecessary_ = function() { |
137 if (!this.handle_) | 132 if (!this.handle_) |
138 return; | 133 return; |
139 | 134 |
140 this.router_ = new internal.Router(this.handle_, true); | 135 this.router_ = new internal.Router(this.handle_, true); |
141 this.handle_ = null; | 136 this.handle_ = null; |
142 | 137 |
143 this.interfaceEndpointClient_ = new internal.InterfaceEndpointClient( | 138 this.interfaceEndpointClient_ = new internal.InterfaceEndpointClient( |
144 this.router_.createLocalEndpointHandle(internal.kMasterInterfaceId)); | 139 this.router_.createLocalEndpointHandle(internal.kMasterInterfaceId)); |
145 | 140 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 Binding.prototype.unbind = function() { | 253 Binding.prototype.unbind = function() { |
259 if (!this.isBound()) | 254 if (!this.isBound()) |
260 return new mojo.InterfaceRequest(null); | 255 return new mojo.InterfaceRequest(null); |
261 | 256 |
262 var result = new mojo.InterfaceRequest(this.router_.connector_.handle_); | 257 var result = new mojo.InterfaceRequest(this.router_.connector_.handle_); |
263 this.router_.connector_.handle_ = null; | 258 this.router_.connector_.handle_ = null; |
264 this.close(); | 259 this.close(); |
265 return result; | 260 return result; |
266 }; | 261 }; |
267 | 262 |
268 Binding.prototype.waitForNextMessageForTesting = function() { | |
269 this.router_.waitForNextMessageForTesting(); | |
270 }; | |
271 | |
272 // --------------------------------------------------------------------------- | 263 // --------------------------------------------------------------------------- |
273 | 264 |
274 function BindingSetEntry(bindingSet, interfaceType, bindingType, impl, | 265 function BindingSetEntry(bindingSet, interfaceType, bindingType, impl, |
275 requestOrHandle, bindingId) { | 266 requestOrHandle, bindingId) { |
276 this.bindingSet_ = bindingSet; | 267 this.bindingSet_ = bindingSet; |
277 this.bindingId_ = bindingId; | 268 this.bindingId_ = bindingId; |
278 this.binding_ = new bindingType(interfaceType, impl, | 269 this.binding_ = new bindingType(interfaceType, impl, |
279 requestOrHandle); | 270 requestOrHandle); |
280 | 271 |
281 this.binding_.setConnectionErrorHandler(function(reason) { | 272 this.binding_.setConnectionErrorHandler(function(reason) { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 AssociatedBindingSet.prototype.constructor = AssociatedBindingSet; | 539 AssociatedBindingSet.prototype.constructor = AssociatedBindingSet; |
549 | 540 |
550 mojo.makeRequest = makeRequest; | 541 mojo.makeRequest = makeRequest; |
551 mojo.AssociatedInterfacePtrController = AssociatedInterfacePtrController; | 542 mojo.AssociatedInterfacePtrController = AssociatedInterfacePtrController; |
552 mojo.AssociatedBinding = AssociatedBinding; | 543 mojo.AssociatedBinding = AssociatedBinding; |
553 mojo.AssociatedBindingSet = AssociatedBindingSet; | 544 mojo.AssociatedBindingSet = AssociatedBindingSet; |
554 mojo.Binding = Binding; | 545 mojo.Binding = Binding; |
555 mojo.BindingSet = BindingSet; | 546 mojo.BindingSet = BindingSet; |
556 mojo.InterfacePtrController = InterfacePtrController; | 547 mojo.InterfacePtrController = InterfacePtrController; |
557 })(); | 548 })(); |
OLD | NEW |