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

Unified Diff: src/value-serializer.h

Issue 2696133007: ValueSerializer: Add SetTreatArrayBufferViewsAsHostObjects() flag (Closed)
Patch Set: ValueSerializer: Add SetTreatArrayBufferViewsAsHostObjects() flag Created 3 years, 10 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 | « src/api.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/value-serializer.h
diff --git a/src/value-serializer.h b/src/value-serializer.h
index 6262c2eaabe5cfb024380b9099c8a5a45e522f8c..4f3fb2cf00e41bbb2bbae71ea3c183a6e3543b1d 100644
--- a/src/value-serializer.h
+++ b/src/value-serializer.h
@@ -84,6 +84,15 @@ class ValueSerializer {
void WriteRawBytes(const void* source, size_t length);
void WriteDouble(double value);
+ /*
+ * Indicate whether to treat ArrayBufferView objects as host objects,
+ * i.e. pass them to Delegate::WriteHostObject. This should not be
+ * called when no Delegate was passed.
+ *
+ * The default is not to treat ArrayBufferViews as host objects.
+ */
+ void SetTreatArrayBufferViewsAsHostObjects(bool mode);
+
private:
// Managing allocations of the internal buffer.
Maybe<bool> ExpandBuffer(size_t required_capacity);
@@ -138,6 +147,7 @@ class ValueSerializer {
Isolate* const isolate_;
v8::ValueSerializer::Delegate* const delegate_;
+ bool treat_array_buffer_views_as_host_objects_ = false;
uint8_t* buffer_ = nullptr;
size_t buffer_size_ = 0;
size_t buffer_capacity_ = 0;
« no previous file with comments | « src/api.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698