mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 11:45:37 +00:00
Bug 1008092
- JS API to check whether array buffer object is neutered. r=sfink
This commit is contained in:
parent
9037e1639f
commit
15b8b19784
@ -1464,6 +1464,14 @@ extern JS_FRIEND_API(bool)
|
||||
JS_NeuterArrayBuffer(JSContext *cx, JS::HandleObject obj,
|
||||
NeuterDataDisposition changeData);
|
||||
|
||||
/*
|
||||
* Check whether the obj is ArrayBufferObject and neutered. Note that this
|
||||
* may return false if a security wrapper is encountered that denies the
|
||||
* unwrapping.
|
||||
*/
|
||||
extern JS_FRIEND_API(bool)
|
||||
JS_IsNeuteredArrayBufferObject(JSObject *obj);
|
||||
|
||||
/*
|
||||
* Check whether obj supports JS_GetDataView* APIs.
|
||||
*/
|
||||
|
@ -1042,6 +1042,18 @@ JS_NeuterArrayBuffer(JSContext *cx, HandleObject obj,
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
JS_IsNeuteredArrayBufferObject(JSObject *obj)
|
||||
{
|
||||
obj = CheckedUnwrap(obj);
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
return obj->is<ArrayBufferObject>()
|
||||
? obj->as<ArrayBufferObject>().isNeutered()
|
||||
: false;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSObject *)
|
||||
JS_NewArrayBuffer(JSContext *cx, uint32_t nbytes)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user