Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 86aa8b7d2d0d3bce9b0163ae0cfd7432776508b1..d699a3c9e00d75990a69e7f6a119f1a3b7f80512 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -1710,6 +1710,19 @@ class V8_EXPORT ValueSerializer { |
virtual Maybe<bool> WriteHostObject(Isolate* isolate, Local<Object> object); |
/* |
+ * Called when the ValueSerializer is going to serialize a |
+ * SharedArrayBuffer object. The embedder must return an ID for the |
+ * object, using the same ID if this SharedArrayBuffer has already been |
+ * serialized in this buffer. When deserializing, this ID will be passed to |
+ * ValueDeserializer::TransferSharedArrayBuffer as |transfer_id|. |
+ * |
+ * If the object cannot be serialized, an |
+ * exception should be thrown and Nothing<uint32_t>() returned. |
+ */ |
+ virtual Maybe<uint32_t> TransferSharedArrayBuffer(Isolate* isolate, |
jbroman
2016/12/13 20:56:00
Do we want to use the word "transfer" here, given
binji
2016/12/14 23:58:30
AIUI, the thought is that transferring is defined
binji
2016/12/15 23:24:45
I went with GetSharedArrayBufferId, I think that's
|
+ Local<Object> object); |
jbroman
2016/12/13 20:56:00
I'd expect the argument to be Local<SharedArrayBuf
binji
2016/12/14 23:58:30
Done.
|
+ |
+ /* |
* Allocates memory for the buffer of at least the size provided. The actual |
* size (which may be greater or equal) is written to |actual_size|. If no |
* buffer has been allocated yet, nullptr will be provided. |
@@ -1763,8 +1776,10 @@ class V8_EXPORT ValueSerializer { |
/* |
* Similar to TransferArrayBuffer, but for SharedArrayBuffer. |
*/ |
- void TransferSharedArrayBuffer(uint32_t transfer_id, |
- Local<SharedArrayBuffer> shared_array_buffer); |
+ V8_DEPRECATE_SOON("Use Delegate::TransferSharedArrayBuffer", |
+ void TransferSharedArrayBuffer( |
+ uint32_t transfer_id, |
+ Local<SharedArrayBuffer> shared_array_buffer)); |
/* |
* Write raw data in various common formats to the buffer. |