diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:31:59 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-10-06 14:06:50 +0100 |
commit | 0d5e116f6aee03185f237311a943491bb079a768 (patch) | |
tree | e0a80472bc3151e606a32e8d68079579c8143495 /include | |
parent | 59151504615d929945dc59db37bf1166937748c6 (diff) | |
download | android_external_v8-0d5e116f6aee03185f237311a943491bb079a768.tar.gz android_external_v8-0d5e116f6aee03185f237311a943491bb079a768.tar.bz2 android_external_v8-0d5e116f6aee03185f237311a943491bb079a768.zip |
update V8 to r5532 as required by WebKit r68651
Change-Id: I5f75eeffbf64b30dd5080348528d277f293490ad
Diffstat (limited to 'include')
-rw-r--r-- | include/v8-profiler.h | 29 | ||||
-rw-r--r-- | include/v8.h | 28 |
2 files changed, 56 insertions, 1 deletions
diff --git a/include/v8-profiler.h b/include/v8-profiler.h index dd1b8caf..27da4182 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -323,7 +323,10 @@ class V8EXPORT HeapSnapshot { enum Type { kFull = 0, // Heap snapshot with all instances and references. kAggregated = 1 // Snapshot doesn't contain individual heap entries, - //instead they are grouped by constructor name. + // instead they are grouped by constructor name. + }; + enum SerializationFormat { + kJSON = 0 // See format description near 'Serialize' method. }; /** Returns heap snapshot type. */ @@ -343,6 +346,30 @@ class V8EXPORT HeapSnapshot { * of the same type can be compared. */ const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const; + + /** + * Prepare a serialized representation of the snapshot. The result + * is written into the stream provided in chunks of specified size. + * The total length of the serialized snapshot is unknown in + * advance, it is can be roughly equal to JS heap size (that means, + * it can be really big - tens of megabytes). + * + * For the JSON format, heap contents are represented as an object + * with the following structure: + * + * { + * snapshot: {title: "...", uid: nnn}, + * nodes: [ + * meta-info (JSON string), + * nodes themselves + * ], + * strings: [strings] + * } + * + * Outgoing node links are stored after each node. Nodes reference strings + * and other nodes by their indexes in corresponding arrays. + */ + void Serialize(OutputStream* stream, SerializationFormat format) const; }; diff --git a/include/v8.h b/include/v8.h index b89c244c..0613d586 100644 --- a/include/v8.h +++ b/include/v8.h @@ -3196,6 +3196,34 @@ class V8EXPORT Locker { }; +/** + * 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 --- |