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

Unified Diff: mojo/public/js/new_bindings/interface_types.js

Issue 2893493002: Mojo JS bindings: update the new bindings with the associated interface feature. (Closed)
Patch Set: . Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/js/new_bindings/interface_types.js
diff --git a/mojo/public/js/new_bindings/interface_types.js b/mojo/public/js/new_bindings/interface_types.js
index c52f6c7e551668129baca00fc46d5b8c4de82b61..3d35e8c7182facb22724f9980821e4e946b3489e 100644
--- a/mojo/public/js/new_bindings/interface_types.js
+++ b/mojo/public/js/new_bindings/interface_types.js
@@ -3,6 +3,13 @@
// found in the LICENSE file.
(function() {
+ var internal = mojo.internal;
+
+ // Constants ----------------------------------------------------------------
+ var kInterfaceIdNamespaceMask = 0x80000000;
+ var kMasterInterfaceId = 0x00000000;
+ var kInvalidInterfaceId = 0xFFFFFFFF;
+
// ---------------------------------------------------------------------------
function InterfacePtrInfo(handle, version) {
@@ -23,6 +30,15 @@
this.version = 0;
};
+ function AssociatedInterfacePtrInfo(interfaceEndpointHandle, version) {
+ this.interfaceEndpointHandle = interfaceEndpointHandle;
+ this.version = version;
+ }
+
+ AssociatedInterfacePtrInfo.prototype.isValid = function() {
+ return this.interfaceEndpointHandle.isValid();
+ };
+
// ---------------------------------------------------------------------------
function InterfaceRequest(handle) {
@@ -41,6 +57,33 @@
this.handle = null;
};
+ function AssociatedInterfaceRequest(interfaceEndpointHandle) {
+ this.interfaceEndpointHandle = interfaceEndpointHandle;
+ }
+
+ AssociatedInterfaceRequest.prototype.isValid = function() {
+ return this.interfaceEndpointHandle.isValid();
+ };
+
+ AssociatedInterfaceRequest.prototype.resetWithReason = function(reason) {
+ this.interfaceEndpointHandle.reset(reason);
+ };
+
+ function isMasterInterfaceId(interfaceId) {
+ return interfaceId === kMasterInterfaceId;
+ }
+
+ function isValidInterfaceId(interfaceId) {
+ return interfaceId !== kInvalidInterfaceId;
+ }
+
mojo.InterfacePtrInfo = InterfacePtrInfo;
mojo.InterfaceRequest = InterfaceRequest;
+ mojo.AssociatedInterfacePtrInfo = AssociatedInterfacePtrInfo;
+ mojo.AssociatedInterfaceRequest = AssociatedInterfaceRequest;
+ internal.isMasterInterfaceId = isMasterInterfaceId;
+ internal.isValidInterfaceId = isValidInterfaceId;
+ internal.kInvalidInterfaceId = kInvalidInterfaceId;
+ internal.kMasterInterfaceId = kMasterInterfaceId;
+ internal.kInterfaceIdNamespaceMask = kInterfaceIdNamespaceMask;
})();
« no previous file with comments | « mojo/public/js/new_bindings/connector.js ('k') | mojo/public/js/new_bindings/lib/control_message_handler.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698