@@ -4846,6 +4846,7 @@ enum class ArrayBufferCreationMode { kInternalized, kExternalized };
48464846
48474847/* *
48484848 * A wrapper around the backing store (i.e. the raw memory) of an array buffer.
4849+ * See a document linked in http://crbug.com/v8/9908 for more information.
48494850 *
48504851 * The allocation and destruction of backing stores is generally managed by
48514852 * V8. Clients should always use standard C++ memory ownership types (i.e.
@@ -4879,6 +4880,10 @@ class V8_EXPORT BackingStore : public v8::internal::BackingStoreBase {
48794880 bool IsShared () const ;
48804881
48814882 private:
4883+ /* *
4884+ * See [Shared]ArrayBuffer::GetBackingStore and
4885+ * [Shared]ArrayBuffer::NewBackingStore.
4886+ */
48824887 BackingStore ();
48834888};
48844889
@@ -5021,6 +5026,9 @@ class V8_EXPORT ArrayBuffer : public Object {
50215026 * |Allocator::Free| once all ArrayBuffers referencing it are collected by
50225027 * the garbage collector.
50235028 */
5029+ V8_DEPRECATE_SOON (
5030+ " Use the version that takes a BackingStore. "
5031+ " See http://crbug.com/v8/9908." )
50245032 static Local<ArrayBuffer> New(
50255033 Isolate* isolate, void * data, size_t byte_length,
50265034 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized );
@@ -5067,6 +5075,9 @@ class V8_EXPORT ArrayBuffer : public Object {
50675075 * Returns true if ArrayBuffer is externalized, that is, does not
50685076 * own its memory block.
50695077 */
5078+ V8_DEPRECATE_SOON (
5079+ " With v8::BackingStore externalized ArrayBuffers are "
5080+ " the same as ordinary ArrayBuffers. See http://crbug.com/v8/9908." )
50705081 bool IsExternal() const ;
50715082
50725083 /* *
@@ -5092,6 +5103,8 @@ class V8_EXPORT ArrayBuffer : public Object {
50925103 * deleter, which will call ArrayBuffer::Allocator::Free if the buffer
50935104 * was allocated with ArrayBuffer::Allocator::Allocate.
50945105 */
5106+ V8_DEPRECATE_SOON (
5107+ " Use GetBackingStore or Detach. See http://crbug.com/v8/9908." )
50955108 Contents Externalize();
50965109
50975110 /* *
@@ -5101,6 +5114,7 @@ class V8_EXPORT ArrayBuffer : public Object {
51015114 * With the new lifetime management of backing stores there is no need for
51025115 * externalizing, so this function exists only to make the transition easier.
51035116 */
5117+ V8_DEPRECATE_SOON (" This will be removed together with IsExternal." )
51045118 void Externalize(const std::shared_ptr<BackingStore>& backing_store);
51055119
51065120 /* *
@@ -5111,6 +5125,7 @@ class V8_EXPORT ArrayBuffer : public Object {
51115125 * The embedder should make sure to hold a strong reference to the
51125126 * ArrayBuffer while accessing this pointer.
51135127 */
5128+ V8_DEPRECATE_SOON (" Use GetBackingStore. See http://crbug.com/v8/9908." )
51145129 Contents GetContents();
51155130
51165131 /* *
@@ -5494,6 +5509,9 @@ class V8_EXPORT SharedArrayBuffer : public Object {
54945509 * specified. The memory block will not be reclaimed when a created
54955510 * SharedArrayBuffer is garbage-collected.
54965511 */
5512+ V8_DEPRECATE_SOON (
5513+ " Use the version that takes a BackingStore. "
5514+ " See http://crbug.com/v8/9908." )
54975515 static Local<SharedArrayBuffer> New(
54985516 Isolate* isolate, void * data, size_t byte_length,
54995517 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized );
@@ -5540,7 +5558,9 @@ class V8_EXPORT SharedArrayBuffer : public Object {
55405558 * Create a new SharedArrayBuffer over an existing memory block. Propagate
55415559 * flags to indicate whether the underlying buffer can be grown.
55425560 */
5543- V8_DEPRECATED (" Use New method with data, and byte_length instead." )
5561+ V8_DEPRECATED (
5562+ " Use the version that takes a BackingStore. "
5563+ " See http://crbug.com/v8/9908." )
55445564 static Local<SharedArrayBuffer> New(
55455565 Isolate* isolate, const SharedArrayBuffer::Contents&,
55465566 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized );
@@ -5549,6 +5569,9 @@ class V8_EXPORT SharedArrayBuffer : public Object {
55495569 * Returns true if SharedArrayBuffer is externalized, that is, does not
55505570 * own its memory block.
55515571 */
5572+ V8_DEPRECATE_SOON (
5573+ " With v8::BackingStore externalized SharedArrayBuffers are the same "
5574+ " as ordinary SharedArrayBuffers. See http://crbug.com/v8/9908." )
55525575 bool IsExternal() const ;
55535576
55545577 /* *
@@ -5563,6 +5586,8 @@ class V8_EXPORT SharedArrayBuffer : public Object {
55635586 * v8::Isolate::CreateParams::array_buffer_allocator.
55645587 *
55655588 */
5589+ V8_DEPRECATE_SOON (
5590+ " Use GetBackingStore or Detach. See http://crbug.com/v8/9908." )
55665591 Contents Externalize();
55675592
55685593 /* *
@@ -5572,6 +5597,7 @@ class V8_EXPORT SharedArrayBuffer : public Object {
55725597 * With the new lifetime management of backing stores there is no need for
55735598 * externalizing, so this function exists only to make the transition easier.
55745599 */
5600+ V8_DEPRECATE_SOON (" This will be removed together with IsExternal." )
55755601 void Externalize(const std::shared_ptr<BackingStore>& backing_store);
55765602
55775603 /* *
@@ -5586,6 +5612,7 @@ class V8_EXPORT SharedArrayBuffer : public Object {
55865612 * by the allocator specified in
55875613 * v8::Isolate::CreateParams::array_buffer_allocator.
55885614 */
5615+ V8_DEPRECATE_SOON (" Use GetBackingStore. See http://crbug.com/v8/9908." )
55895616 Contents GetContents();
55905617
55915618 /* *
0 commit comments