Index: src/value-serializer.h |
diff --git a/src/value-serializer.h b/src/value-serializer.h |
index 1ed9457b779033cc8e0ed3e5074c544f800131b4..d300e39aa715035519c28e779867538602fa9f45 100644 |
--- a/src/value-serializer.h |
+++ b/src/value-serializer.h |
@@ -86,7 +86,7 @@ class ValueSerializer { |
private: |
// Managing allocations of the internal buffer. |
- void ExpandBuffer(size_t required_capacity); |
+ Maybe<bool> ExpandBuffer(size_t required_capacity); |
// Writing the wire format. |
void WriteTag(SerializationTag tag); |
@@ -96,7 +96,7 @@ class ValueSerializer { |
void WriteZigZag(T value); |
void WriteOneByteString(Vector<const uint8_t> chars); |
void WriteTwoByteString(Vector<const uc16> chars); |
- uint8_t* ReserveRawBytes(size_t bytes); |
+ Maybe<uint8_t*> ReserveRawBytes(size_t bytes); |
// Writing V8 objects of various kinds. |
void WriteOddball(Oddball* oddball); |
@@ -134,11 +134,14 @@ class ValueSerializer { |
V8_NOINLINE void ThrowDataCloneError(MessageTemplate::Template template_index, |
Handle<Object> arg0); |
+ Maybe<bool> ThrowIfOutOfMemory(); |
+ |
Isolate* const isolate_; |
v8::ValueSerializer::Delegate* const delegate_; |
uint8_t* buffer_ = nullptr; |
size_t buffer_size_ = 0; |
size_t buffer_capacity_ = 0; |
+ bool out_of_memory_ = false; |
Zone zone_; |
// To avoid extra lookups in the identity map, ID+1 is actually stored in the |