Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: include/v8.h

Issue 2275033003: Blink-compatible serialization of ArrayBuffer transfer. (Closed)
Patch Set: Accepts Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index f173e8165f79fcefac562bfe58f5e96eaa6d8a4a..f8ae04de66a79d49d29cc3748beac2c02f918173 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -70,6 +70,7 @@ namespace v8 {
class AccessorSignature;
class Array;
+class ArrayBuffer;
class Boolean;
class BooleanObject;
class Context;
@@ -1689,6 +1690,14 @@ class V8_EXPORT ValueSerializer {
*/
std::vector<uint8_t> ReleaseBuffer();
+ /*
+ * Marks an ArrayBuffer as havings its contents transferred out of band.
+ * Pass the corresponding JSArrayBuffer in the deserializing context to
+ * ValueDeserializer::TransferArrayBuffer.
+ */
+ void TransferArrayBuffer(uint32_t transfer_id,
+ Local<ArrayBuffer> array_buffer);
+
private:
ValueSerializer(const ValueSerializer&) = delete;
void operator=(const ValueSerializer&) = delete;
@@ -1722,6 +1731,13 @@ class V8_EXPORT ValueDeserializer {
V8_WARN_UNUSED_RESULT MaybeLocal<Value> ReadValue(Local<Context> context);
/*
+ * Accepts the array buffer corresponding to the one passed previously to
+ * ValueSerializer::TransferArrayBuffer.
+ */
+ void TransferArrayBuffer(uint32_t transfer_id,
+ Local<ArrayBuffer> array_buffer);
+
+ /*
* Must be called before ReadHeader to enable support for reading the legacy
* wire format (i.e., which predates this being shipped).
*
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698