Lines Matching full:this

2 // Use of this source code is governed by a BSD-style license that can be
40 this.version = 0;
42 this.interfaceType_ = interfaceType;
43 this.router_ = null;
44 this.interfaceEndpointClient_ = null;
45 this.proxy_ = null;
50 this.handle_ = null;
53 this.bind(ptrInfoOrHandle);
57 this.reset();
60 this.version = ptrInfoOrHandle.version;
61 this.handle_ = ptrInfoOrHandle.handle;
63 this.handle_ = ptrInfoOrHandle;
68 return this.interfaceEndpointClient_ !== null || this.handle_ !== null;
74 this.version = 0;
75 if (this.interfaceEndpointClient_) {
76 this.interfaceEndpointClient_.close();
77 this.interfaceEndpointClient_ = null;
79 if (this.router_) {
80 this.router_.close();
81 this.router_ = null;
83 this.proxy_ = null;
85 if (this.handle_) {
86 this.handle_.close();
87 this.handle_ = null;
92 if (this.isBound()) {
93 this.configureProxyIfNecessary_();
94 this.interfaceEndpointClient_.close(reason);
95 this.interfaceEndpointClient_ = null;
97 this.reset();
102 if (!this.isBound())
105 this.configureProxyIfNecessary_();
106 this.interfaceEndpointClient_.setConnectionErrorHandler(callback);
111 if (this.router_) {
114 this.router_.connector_.handle_, this.version);
115 this.router_.connector_.handle_ = null;
117 // This also handles the case when this object is not bound.
118 result = new mojo.InterfacePtrInfo(this.handle_, this.version);
119 this.handle_ = null;
122 this.reset();
127 this.configureProxyIfNecessary_();
128 return this.proxy_;
132 if (!this.handle_)
135 this.router_ = new internal.Router(this.handle_, true);
136 this.handle_ = null;
138 this.interfaceEndpointClient_ = new internal.InterfaceEndpointClient(
139 this.router_.createLocalEndpointHandle(internal.kMasterInterfaceId));
141 this.interfaceEndpointClient_ .setPayloadValidators([
142 this.interfaceType_.validateResponse]);
143 this.proxy_ = new this.interfaceType_.proxyClass(
144 this.interfaceEndpointClient_);
149 this.version = version;
153 this.configureProxyIfNecessary_();
154 return this.interfaceEndpointClient_.queryVersion().then(
155 onQueryVersion.bind(this));
159 this.configureProxyIfNecessary_();
161 if (this.version >= version) {
164 this.version = version;
165 this.interfaceEndpointClient_.requireVersion(version);
184 this.interfaceType_ = interfaceType;
185 this.impl_ = impl;
186 this.router_ = null;
187 this.interfaceEndpointClient_ = null;
188 this.stub_ = null;
191 this.bind(requestOrHandle);
195 return this.router_ !== null;
199 var ptr = new this.interfaceType_.ptrClass();
201 this.bind(makeRequest(ptr));
206 this.close();
213 this.router_ = new internal.Router(handle);
215 this.stub_ = new this.interfaceType_.stubClass(this.impl_);
216 this.interfaceEndpointClient_ = new internal.InterfaceEndpointClient(
217 this.router_.createLocalEndpointHandle(internal.kMasterInterfaceId),
218 this.stub_, this.interfaceType_.kVersion);
220 this.interfaceEndpointClient_ .setPayloadValidators([
221 this.interfaceType_.validateRequest]);
225 if (!this.isBound())
228 if (this.interfaceEndpointClient_) {
229 this.interfaceEndpointClient_.close();
230 this.interfaceEndpointClient_ = null;
233 this.router_.close();
234 this.router_ = null;
235 this.stub_ = null;
239 if (this.interfaceEndpointClient_) {
240 this.interfaceEndpointClient_.close(reason);
241 this.interfaceEndpointClient_ = null;
243 this.close();
247 if (!this.isBound()) {
250 this.interfaceEndpointClient_.setConnectionErrorHandler(callback);
254 if (!this.isBound())
257 var result = new mojo.InterfaceRequest(this.router_.connector_.handle_);
258 this.router_.connector_.handle_ = null;
259 this.close();
267 this.bindingSet_ = bindingSet;
268 this.bindingId_ = bindingId;
269 this.binding_ = new bindingType(interfaceType, impl,
272 this.binding_.setConnectionErrorHandler(function(reason) {
273 this.bindingSet_.onConnectionError(bindingId, reason);
274 }.bind(this));
278 this.binding_.close();
282 this.interfaceType_ = interfaceType;
283 this.nextBindingId_ = 0;
284 this.bindings_ = new Map();
285 this.errorHandler_ = null;
286 this.bindingType_ = Binding;
290 return this.bindings_.size == 0;
294 this.bindings_.set(
295 this.nextBindingId_,
296 new BindingSetEntry(this, this.interfaceType_, this.bindingType_, impl,
297 requestOrHandle, this.nextBindingId_));
298 ++this.nextBindingId_;
302 for (var entry of this.bindings_.values())
304 this.bindings_.clear();
308 this.errorHandler_ = callback;
312 this.bindings_.delete(bindingId);
314 if (this.errorHandler_)
315 this.errorHandler_(reason);
331 // this.senderBinding_ = null;
335 // this.senderBinding_ = new AssociatedBinding(mojom.IntegerSender,
361 this.version = 0;
363 this.interfaceType_ = interfaceType;
364 this.interfaceEndpointClient_ = null;
365 this.proxy_ = null;
368 this.bind(associatedPtrInfo);
374 this.reset();
375 this.version = associatedPtrInfo.version;
377 this.interfaceEndpointClient_ = new internal.InterfaceEndpointClient(
380 this.interfaceEndpointClient_ .setPayloadValidators([
381 this.interfaceType_.validateResponse]);
382 this.proxy_ = new this.interfaceType_.proxyClass(
383 this.interfaceEndpointClient_);
387 return this.interfaceEndpointClient_ !== null;
391 this.version = 0;
392 if (this.interfaceEndpointClient_) {
393 this.interfaceEndpointClient_.close();
394 this.interfaceEndpointClient_ = null;
396 if (this.proxy_) {
397 this.proxy_ = null;
403 if (this.isBound()) {
404 this.interfaceEndpointClient_.close(reason);
405 this.interfaceEndpointClient_ = null;
407 this.reset();
411 // on this interface will be dropped (and may already have been dropped).
413 return this.interfaceEndpointClient_ ?
414 this.interfaceEndpointClient_.getEncounteredError() : false;
419 if (!this.isBound()) {
423 this.interfaceEndpointClient_.setConnectionErrorHandler(callback);
427 if (!this.isBound()) {
432 this.interfaceEndpointClient_.passHandle(), this.version);
433 this.reset();
438 return this.proxy_;
443 this.version = version;
447 return this.interfaceEndpointClient_.queryVersion().then(
448 onQueryVersion.bind(this));
453 if (this.version >= version) {
456 this.version = version;
457 this.interfaceEndpointClient_.requireVersion(version);
465 this.interfaceType_ = interfaceType;
466 this.impl_ = impl;
467 this.interfaceEndpointClient_ = null;
468 this.stub_ = null;
471 this.bind(associatedInterfaceRequest);
476 return this.interfaceEndpointClient_ !== null;
480 this.close();
482 this.stub_ = new this.interfaceType_.stubClass(this.impl_);
483 this.interfaceEndpointClient_ = new internal.InterfaceEndpointClient(
484 associatedInterfaceRequest.interfaceEndpointHandle, this.stub_,
485 this.interfaceType_.kVersion);
487 this.interfaceEndpointClient_ .setPayloadValidators([
488 this.interfaceType_.validateRequest]);
493 if (!this.isBound()) {
497 if (this.interfaceEndpointClient_) {
498 this.interfaceEndpointClient_.close();
499 this.interfaceEndpointClient_ = null;
502 this.stub_ = null;
506 if (this.interfaceEndpointClient_) {
507 this.interfaceEndpointClient_.close(reason);
508 this.interfaceEndpointClient_ = null;
510 this.close();
514 if (!this.isBound()) {
517 this.interfaceEndpointClient_.setConnectionErrorHandler(callback);
521 if (!this.isBound()) {
526 this.interfaceEndpointClient_.passHandle());
527 this.close();
534 mojo.BindingSet.call(this, interfaceType);
535 this.bindingType_ = AssociatedBinding;