Bug 1529298 - Consistently use "ArrayBuffer" instead of the vaguer "array buffer" in ArrayBuffer-related JSAPI descriptions. r=sfink

This commit is contained in:
Jeff Walden 2019-02-18 22:52:42 -08:00
Родитель 2c3a26a56b
Коммит adf8ccf080
2 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -2021,12 +2021,12 @@ JS_PUBLIC_API void JS_SetAllNonReservedSlotsToUndefined(JSContext* cx,
JSObject* objArg); JSObject* objArg);
/** /**
* Create a new array buffer with the given |contents|, which may be null only * Create a new ArrayBuffer with the given |contents|, which may be null only
* if |nbytes == 0|. |contents| must be allocated compatible with deallocation * if |nbytes == 0|. |contents| must be allocated compatible with deallocation
* by |JS_free|. * by |JS_free|.
* *
* If and only if an array buffer is successfully created and returned, * If and only if an ArrayBuffer is successfully created and returned,
* ownership of |contents| is transferred to the new array buffer. * ownership of |contents| is transferred to the new ArrayBuffer.
*/ */
extern JS_PUBLIC_API JSObject* JS_NewArrayBufferWithContents(JSContext* cx, extern JS_PUBLIC_API JSObject* JS_NewArrayBufferWithContents(JSContext* cx,
size_t nbytes, size_t nbytes,
@ -2039,11 +2039,11 @@ using BufferContentsFreeFunc = void (*)(void* contents, void* userData);
} /* namespace JS */ } /* namespace JS */
/** /**
* Create a new array buffer with the given contents. The contents must not be * Create a new ArrayBuffer with the given contents. The contents must not be
* modified by any other code, internal or external. * modified by any other code, internal or external.
* *
* When the array buffer is ready to be disposed of, `freeFunc(contents, * When the ArrayBuffer is ready to be disposed of, `freeFunc(contents,
* freeUserData)` will be called to release the array buffer's reference on the * freeUserData)` will be called to release the ArrayBuffer's reference on the
* contents. * contents.
* *
* `freeFunc()` must not call any JSAPI functions that could cause a garbage * `freeFunc()` must not call any JSAPI functions that could cause a garbage
@ -2058,7 +2058,7 @@ using BufferContentsFreeFunc = void (*)(void* contents, void* userData);
* new malloc buffer. `freeFunc()` must be threadsafe, and may be called from * new malloc buffer. `freeFunc()` must be threadsafe, and may be called from
* any thread. * any thread.
* *
* This allows array buffers to be used with embedder objects that use reference * This allows ArrayBuffers to be used with embedder objects that use reference
* counting, for example. In that case the caller is responsible * counting, for example. In that case the caller is responsible
* for incrementing the reference count before passing the contents to this * for incrementing the reference count before passing the contents to this
* function. This also allows using non-reference-counted contents that must be * function. This also allows using non-reference-counted contents that must be
@ -2090,24 +2090,24 @@ extern JS_PUBLIC_API JSObject* JS_NewArrayBufferWithUserOwnedContents(
JSContext* cx, size_t nbytes, void* contents); JSContext* cx, size_t nbytes, void* contents);
/** /**
* Steal the contents of the given array buffer. The array buffer has its * Steal the contents of the given ArrayBuffer. The ArrayBuffer has its length
* length set to 0 and its contents array cleared. The caller takes ownership * set to 0 and its contents array cleared. The caller takes ownership of the
* of the return value and must free it or transfer ownership via * return value and must free it or transfer ownership via
* JS_NewArrayBufferWithContents when done using it. * JS_NewArrayBufferWithContents when done using it.
*/ */
extern JS_PUBLIC_API void* JS_StealArrayBufferContents(JSContext* cx, extern JS_PUBLIC_API void* JS_StealArrayBufferContents(JSContext* cx,
JS::HandleObject obj); JS::HandleObject obj);
/** /**
* Create a new mapped array buffer with the given memory mapped contents. It * Create a new mapped ArrayBuffer with the given memory mapped contents. It
* must be legal to free the contents pointer by unmapping it. On success, * must be legal to free the contents pointer by unmapping it. On success,
* ownership is transferred to the new mapped array buffer. * ownership is transferred to the new mapped ArrayBuffer.
*/ */
extern JS_PUBLIC_API JSObject* JS_NewMappedArrayBufferWithContents( extern JS_PUBLIC_API JSObject* JS_NewMappedArrayBufferWithContents(
JSContext* cx, size_t nbytes, void* contents); JSContext* cx, size_t nbytes, void* contents);
/** /**
* Create memory mapped array buffer contents. * Create memory mapped ArrayBuffer contents.
* Caller must take care of closing fd after calling this function. * Caller must take care of closing fd after calling this function.
*/ */
extern JS_PUBLIC_API void* JS_CreateMappedArrayBufferContents(int fd, extern JS_PUBLIC_API void* JS_CreateMappedArrayBufferContents(int fd,
@ -2115,7 +2115,7 @@ extern JS_PUBLIC_API void* JS_CreateMappedArrayBufferContents(int fd,
size_t length); size_t length);
/** /**
* Release the allocated resource of mapped array buffer contents before the * Release the allocated resource of mapped ArrayBuffer contents before the
* object is created. * object is created.
* If a new object has been created by JS_NewMappedArrayBufferWithContents() * If a new object has been created by JS_NewMappedArrayBufferWithContents()
* with this content, then JS_DetachArrayBuffer() should be used instead to * with this content, then JS_DetachArrayBuffer() should be used instead to

Просмотреть файл

@ -1794,7 +1794,7 @@ extern JS_FRIEND_API bool JS_IsArrayBufferObject(JSObject* obj);
extern JS_FRIEND_API bool JS_IsSharedArrayBufferObject(JSObject* obj); extern JS_FRIEND_API bool JS_IsSharedArrayBufferObject(JSObject* obj);
/** /**
* Return the available byte length of an array buffer. * Return the available byte length of an ArrayBuffer.
* *
* |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known
* that it would pass such a test: it is an ArrayBuffer or a wrapper of an * that it would pass such a test: it is an ArrayBuffer or a wrapper of an
@ -1849,7 +1849,7 @@ extern JS_FRIEND_API bool JS_IsMappedArrayBufferObject(JSObject* obj);
extern JS_FRIEND_API uint32_t JS_GetTypedArrayLength(JSObject* obj); extern JS_FRIEND_API uint32_t JS_GetTypedArrayLength(JSObject* obj);
/** /**
* Return the byte offset from the start of an array buffer to the start of a * Return the byte offset from the start of an ArrayBuffer to the start of a
* typed array view. * typed array view.
* *
* |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow