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

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

Issue 2556353004: Mojo JS bindings: code generator maps interface ptr and request to InterfacePtr and InterfaceReques… (Closed)
Patch Set: . Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 define("mojo/public/js/interface_types", [
6 "mojo/public/js/core",
7 ], function(core) {
8
9 // ---------------------------------------------------------------------------
10
11 function InterfacePtrInfo(handle, version) {
12 this.handle = handle;
13 this.version = version;
14 }
15
16 InterfacePtrInfo.prototype.isValid = function() {
17 return core.isHandle(this.handle);
18 };
19
20 InterfacePtrInfo.prototype.close = function() {
21 if (!this.isValid())
22 return;
23
24 core.close(this.handle);
25 this.handle = null;
26 this.version = 0;
27 };
28
29 // ---------------------------------------------------------------------------
30
31 function InterfaceRequest(handle) {
32 this.handle = handle;
33 }
34
35 InterfaceRequest.prototype.isValid = function() {
36 return core.isHandle(this.handle);
37 };
38
39 InterfaceRequest.prototype.close = function() {
40 if (!this.isValid())
41 return;
42
43 core.close(this.handle);
44 this.handle = null;
45 };
46
47 var exports = {};
48 exports.InterfacePtrInfo = InterfacePtrInfo;
49 exports.InterfaceRequest = InterfaceRequest;
50
51 return exports;
52 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698