Revision 2.4.4.
Fix bug with hangs on very large sparse arrays.
Try harder to free up memory when running out of space.
Add heap snapshots to JSON format to API.
Recalibrate benchmarks.
Review URL: http://codereview.chromium.org/3421009
git-svn-id: http://v8.googlecode.com/svn/trunk@5462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/include/v8.h b/include/v8.h
index b89c244..0613d58 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3196,6 +3196,34 @@
};
+/**
+ * An interface for exporting data from V8, using "push" model.
+ */
+class V8EXPORT OutputStream {
+public:
+ enum OutputEncoding {
+ kAscii = 0 // 7-bit ASCII.
+ };
+ enum WriteResult {
+ kContinue = 0,
+ kAbort = 1
+ };
+ virtual ~OutputStream() {}
+ /** Notify about the end of stream. */
+ virtual void EndOfStream() = 0;
+ /** Get preferred output chunk size. Called only once. */
+ virtual int GetChunkSize() { return 1024; }
+ /** Get preferred output encoding. Called only once. */
+ virtual OutputEncoding GetOutputEncoding() { return kAscii; }
+ /**
+ * Writes the next chunk of snapshot data into the stream. Writing
+ * can be stopped by returning kAbort as function result. EndOfStream
+ * will not be called in case writing was aborted.
+ */
+ virtual WriteResult WriteAsciiChunk(char* data, int size) = 0;
+};
+
+
// --- I m p l e m e n t a t i o n ---