blob: f82789d2e97cf0e0ddff90dc584a4f23360a8768 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function() {
// ---------------------------------------------------------------------------
function InterfacePtrInfo(handle, version) {
this.handle = handle;
this.version = version;
}
InterfacePtrInfo.prototype.isValid = function() {
return this.handle instanceof MojoHandle;
};
InterfacePtrInfo.prototype.close = function() {
if (!this.isValid())
return;
this.handle.close();
this.handle = null;
this.version = 0;
};
// ---------------------------------------------------------------------------
function InterfaceRequest(handle) {
this.handle = handle;
}
InterfaceRequest.prototype.isValid = function() {
return this.handle instanceof MojoHandle;
};
InterfaceRequest.prototype.close = function() {
if (!this.isValid())
return;
this.handle.close();
this.handle = null;
};
mojoBindings.InterfacePtrInfo = InterfacePtrInfo;
mojoBindings.InterfaceRequest = InterfaceRequest;
})();