Revision: 19955
Author:   [email protected]
Date:     Mon Mar 17 07:02:39 2014 UTC
Log:      Move profiler callback interfaces from v8.h to v8-profiler.h

OutputStream and ActivityControl are used only by heap profiler so I moved their definition in v8-profiler.h to not clutter v8.h

Drive-by: removed OutputStream::GetOutputEncoding which is unused.

BUG=None
LOG=Y
[email protected], [email protected]

Review URL: https://codereview.chromium.org/196383015
http://code.google.com/p/v8/source/detail?r=19955

Modified:
 /branches/bleeding_edge/include/v8-profiler.h
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/include/v8-profiler.h Fri Mar 14 09:26:31 2014 UTC +++ /branches/bleeding_edge/include/v8-profiler.h Mon Mar 17 07:02:39 2014 UTC
@@ -35,6 +35,9 @@
  */
 namespace v8 {

+class HeapGraphNode;
+class HeapStatsUpdate;
+
 typedef uint32_t SnapshotObjectId;

 /**
@@ -185,9 +188,6 @@
 };


-class HeapGraphNode;
-
-
 /**
  * HeapSnapshotEdge represents a directed connection between heap
  * graph nodes: from retainers to retained nodes.
@@ -277,6 +277,37 @@
 };


+/**
+ * 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.
  */
@@ -343,8 +374,25 @@
   void Serialize(OutputStream* stream, SerializationFormat format) const;
 };

+
+/**
+ * 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;
+};

-class RetainedObjectInfo;

 /**
  * Interface for controlling heap profiling. Instance of the
=======================================
--- /branches/bleeding_edge/include/v8.h        Fri Mar 14 14:57:04 2014 UTC
+++ /branches/bleeding_edge/include/v8.h        Mon Mar 17 07:02:39 2014 UTC
@@ -5361,67 +5361,6 @@
 };


-/**
- * A struct for exporting HeapStats data from V8, using "push" model.
- */
-struct HeapStatsUpdate;
-
-
-/**
- * An interface for exporting data from V8, using "push" model.
- */
-class V8_EXPORT OutputStream {  // NOLINT
- 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;
-  /**
-   * 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;
-  };
-};
-
-
-/**
- * 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;
-};
-
-
 // --- Implementation ---


=======================================
--- /branches/bleeding_edge/src/api.cc  Fri Mar 14 10:20:33 2014 UTC
+++ /branches/bleeding_edge/src/api.cc  Mon Mar 17 07:02:39 2014 UTC
@@ -7182,9 +7182,6 @@
   Utils::ApiCheck(format == kJSON,
                   "v8::HeapSnapshot::Serialize",
                   "Unknown serialization format");
-  Utils::ApiCheck(stream->GetOutputEncoding() == OutputStream::kAscii,
-                  "v8::HeapSnapshot::Serialize",
-                  "Unsupported output encoding");
   Utils::ApiCheck(stream->GetChunkSize() > 0,
                   "v8::HeapSnapshot::Serialize",
                   "Invalid stream chunk size");

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to