Index: mojo/public/cpp/bindings/lib/scratch_buffer.h |
diff --git a/mojo/public/cpp/bindings/lib/scratch_buffer.h b/mojo/public/cpp/bindings/lib/scratch_buffer.h |
index 462c6febc1300134dca077a10f3af08ace18d8bb..64dabce3502477d1e9b8b3a0343918160e2c8cec 100644 |
--- a/mojo/public/cpp/bindings/lib/scratch_buffer.h |
+++ b/mojo/public/cpp/bindings/lib/scratch_buffer.h |
@@ -24,7 +24,10 @@ class ScratchBuffer : public Buffer { |
MOJO_OVERRIDE; |
private: |
- enum { kMinSegmentSize = 512 }; |
+ enum { |
+ kMinSegmentSize = 512, |
+ kMaxSegmentSize = 1024 * 1024 * 1024, |
+ }; |
struct Segment { |
Segment* next; |
@@ -33,7 +36,7 @@ class ScratchBuffer : public Buffer { |
}; |
void* AllocateInSegment(Segment* segment, size_t num_bytes); |
- void AddOverflowSegment(size_t delta); |
+ bool AddOverflowSegment(size_t delta); |
char fixed_data_[kMinSegmentSize]; |
Segment fixed_; |