OLD | NEW |
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 ---------------------------------------------------------------- | 9 // Constants ---------------------------------------------------------------- |
10 var kInterfaceIdNamespaceMask = 0x80000000; | 10 var kInterfaceIdNamespaceMask = 0x80000000; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 }; | 59 }; |
60 | 60 |
61 function AssociatedInterfaceRequest(interfaceEndpointHandle) { | 61 function AssociatedInterfaceRequest(interfaceEndpointHandle) { |
62 this.interfaceEndpointHandle = interfaceEndpointHandle; | 62 this.interfaceEndpointHandle = interfaceEndpointHandle; |
63 } | 63 } |
64 | 64 |
65 AssociatedInterfaceRequest.prototype.isValid = function() { | 65 AssociatedInterfaceRequest.prototype.isValid = function() { |
66 return this.interfaceEndpointHandle.isValid(); | 66 return this.interfaceEndpointHandle.isValid(); |
67 }; | 67 }; |
68 | 68 |
| 69 AssociatedInterfaceRequest.prototype.resetWithReason = function(reason) { |
| 70 this.interfaceEndpointHandle.reset(reason); |
| 71 }; |
| 72 |
69 function isMasterInterfaceId(interfaceId) { | 73 function isMasterInterfaceId(interfaceId) { |
70 return interfaceId === kMasterInterfaceId; | 74 return interfaceId === kMasterInterfaceId; |
71 } | 75 } |
72 | 76 |
73 function isValidInterfaceId(interfaceId) { | 77 function isValidInterfaceId(interfaceId) { |
74 return interfaceId !== kInvalidInterfaceId; | 78 return interfaceId !== kInvalidInterfaceId; |
75 } | 79 } |
76 | 80 |
77 var exports = {}; | 81 var exports = {}; |
78 exports.InterfacePtrInfo = InterfacePtrInfo; | 82 exports.InterfacePtrInfo = InterfacePtrInfo; |
79 exports.InterfaceRequest = InterfaceRequest; | 83 exports.InterfaceRequest = InterfaceRequest; |
80 exports.AssociatedInterfacePtrInfo = AssociatedInterfacePtrInfo; | 84 exports.AssociatedInterfacePtrInfo = AssociatedInterfacePtrInfo; |
81 exports.AssociatedInterfaceRequest = AssociatedInterfaceRequest; | 85 exports.AssociatedInterfaceRequest = AssociatedInterfaceRequest; |
82 exports.isMasterInterfaceId = isMasterInterfaceId; | 86 exports.isMasterInterfaceId = isMasterInterfaceId; |
83 exports.isValidInterfaceId = isValidInterfaceId; | 87 exports.isValidInterfaceId = isValidInterfaceId; |
84 exports.kInvalidInterfaceId = kInvalidInterfaceId; | 88 exports.kInvalidInterfaceId = kInvalidInterfaceId; |
85 exports.kMasterInterfaceId = kMasterInterfaceId; | 89 exports.kMasterInterfaceId = kMasterInterfaceId; |
86 exports.kInterfaceIdNamespaceMask = kInterfaceIdNamespaceMask; | 90 exports.kInterfaceIdNamespaceMask = kInterfaceIdNamespaceMask; |
87 | 91 |
88 return exports; | 92 return exports; |
89 }); | 93 }); |
OLD | NEW |