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

Unified Diff: include/v8-profiler.h

Issue 196383015: Move profiler callback interfaces from v8.h to v8-profiler.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « include/v8.h ('k') | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-profiler.h
diff --git a/include/v8-profiler.h b/include/v8-profiler.h
index 59c2d5dacdb13eb390cd6e266957398336a5d553..83a4ed993744b8f79817b7f7d410d910661759c6 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -35,6 +35,9 @@
*/
namespace v8 {
+class HeapGraphNode;
+class HeapStatsUpdate;
+
typedef uint32_t SnapshotObjectId;
/**
@@ -179,9 +182,6 @@ class V8_EXPORT CpuProfiler {
};
-class HeapGraphNode;
-
-
/**
* HeapSnapshotEdge represents a directed connection between heap
* graph nodes: from retainers to retained nodes.
@@ -272,6 +272,37 @@ class V8_EXPORT HeapGraphNode {
/**
+ * An interface for exporting data from V8, using "push" model.
+ */
+class V8_EXPORT OutputStream { // NOLINT
+ public:
+ 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; }
+ /**
+ * 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;
+ /**
+ * Writes the next chunk of heap stats 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 WriteHeapStatsChunk(HeapStatsUpdate* data, int count) {
+ return kAbort;
+ };
+};
+
+
+/**
* HeapSnapshots record the state of the JS heap at some moment.
*/
class V8_EXPORT HeapSnapshot {
@@ -338,7 +369,24 @@ class V8_EXPORT HeapSnapshot {
};
-class RetainedObjectInfo;
+/**
+ * An interface for reporting progress and controlling long-running
+ * activities.
+ */
+class V8_EXPORT ActivityControl { // NOLINT
+ public:
+ enum ControlOption {
+ kContinue = 0,
+ kAbort = 1
+ };
+ virtual ~ActivityControl() {}
+ /**
+ * Notify about current progress. The activity can be stopped by
+ * returning kAbort as the callback result.
+ */
+ virtual ControlOption ReportProgressValue(int done, int total) = 0;
+};
+
/**
* Interface for controlling heap profiling. Instance of the
« no previous file with comments | « include/v8.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698