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

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

Issue 2744963002: Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: Throw the error with the string being the stack trace needed to debug layouts which don't output an… Created 3 years, 8 months 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
« no previous file with comments | « mojo/public/js/constants.cc ('k') | mojo/public/js/lib/control_message_handler.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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/interface_types", [ 5 define("mojo/public/js/interface_types", [
6 "mojo/public/js/core", 6 "mojo/public/js/core",
7 ], function(core) { 7 ], function(core) {
8 8
9 // Constants ----------------------------------------------------------------
10 var kInterfaceIdNamespaceMask = 0x80000000;
11 var kMasterInterfaceId = 0x00000000;
12 var kInvalidInterfaceId = 0xFFFFFFFF;
13
9 // --------------------------------------------------------------------------- 14 // ---------------------------------------------------------------------------
10 15
11 function InterfacePtrInfo(handle, version) { 16 function InterfacePtrInfo(handle, version) {
12 this.handle = handle; 17 this.handle = handle;
13 this.version = version; 18 this.version = version;
14 } 19 }
15 20
16 InterfacePtrInfo.prototype.isValid = function() { 21 InterfacePtrInfo.prototype.isValid = function() {
17 return core.isHandle(this.handle); 22 return core.isHandle(this.handle);
18 }; 23 };
(...skipping 18 matching lines...) Expand all
37 }; 42 };
38 43
39 InterfaceRequest.prototype.close = function() { 44 InterfaceRequest.prototype.close = function() {
40 if (!this.isValid()) 45 if (!this.isValid())
41 return; 46 return;
42 47
43 core.close(this.handle); 48 core.close(this.handle);
44 this.handle = null; 49 this.handle = null;
45 }; 50 };
46 51
52 function isMasterInterfaceId(interfaceId) {
53 return interfaceId === kMasterInterfaceId;
54 }
55
56 function isValidInterfaceId(interfaceId) {
57 return interfaceId !== kInvalidInterfaceId;
58 }
59
47 var exports = {}; 60 var exports = {};
48 exports.InterfacePtrInfo = InterfacePtrInfo; 61 exports.InterfacePtrInfo = InterfacePtrInfo;
49 exports.InterfaceRequest = InterfaceRequest; 62 exports.InterfaceRequest = InterfaceRequest;
63 exports.isMasterInterfaceId = isMasterInterfaceId;
64 exports.isValidInterfaceId = isValidInterfaceId;
65 exports.kInvalidInterfaceId = kInvalidInterfaceId;
66 exports.kMasterInterfaceId = kMasterInterfaceId;
67 exports.kInterfaceIdNamespaceMask = kInterfaceIdNamespaceMask;
50 68
51 return exports; 69 return exports;
52 }); 70 });
OLDNEW
« no previous file with comments | « mojo/public/js/constants.cc ('k') | mojo/public/js/lib/control_message_handler.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698