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

Unified Diff: include/v8-profiler.h

Issue 13458003: Isolatify HeapProfiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 41fe8a19992a3a63a1fe829805e5a5d4e223ce46..7dd874ffc7439a3add98b812c634c0b493526736 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -385,7 +385,8 @@ class V8EXPORT HeapSnapshot {
class RetainedObjectInfo;
/**
- * Interface for controlling heap profiling.
+ * Interface for controlling heap profiling. Instance of the
+ * profiler can be retrieved using v8::Isolate::GetHeapProfiler.
*/
class V8EXPORT HeapProfiler {
public:
@@ -398,20 +399,28 @@ class V8EXPORT HeapProfiler {
typedef RetainedObjectInfo* (*WrapperInfoCallback)
(uint16_t class_id, Handle<Value> wrapper);
- /** Returns the number of snapshots taken. */
+ /** Deprecated. Use GetSnapshotCount instead. */
static int GetSnapshotsCount();
+ /** Returns the number of snapshots taken. */
+ int GetSnapshotCount();
- /** Returns a snapshot by index. */
+ /** Deprecated. Use GetHeapSnapshot instead. */
static const HeapSnapshot* GetSnapshot(int index);
+ /** Returns a snapshot by index. */
+ const HeapSnapshot* GetHeapSnapshot(int index);
- /** Returns a profile by uid. */
+ /** Deprecated. Use FindHeapSnapshot instead. */
static const HeapSnapshot* FindSnapshot(unsigned uid);
+ /** Returns a profile by uid. */
+ const HeapSnapshot* FindHeapSnapshot(unsigned uid);
+ /** Deprecated. Use GetObjectId instead. */
+ static SnapshotObjectId GetSnapshotObjectId(Handle<Value> value);
/**
* Returns SnapshotObjectId for a heap object referenced by |value| if
* it has been seen by the heap profiler, kUnknownObjectId otherwise.
*/
- static SnapshotObjectId GetSnapshotObjectId(Handle<Value> value);
+ SnapshotObjectId GetObjectId(Handle<Value> value);
/**
* A constant for invalid SnapshotObjectId. GetSnapshotObjectId will return
@@ -424,33 +433,43 @@ class V8EXPORT HeapProfiler {
* Callback interface for retrieving user friendly names of global objects.
*/
class ObjectNameResolver {
- public:
+ public:
/**
* Returns name to be used in the heap snapshot for given node. Returned
* string must stay alive until snapshot collection is completed.
*/
virtual const char* GetName(Handle<Object> object) = 0;
- protected:
+ protected:
virtual ~ObjectNameResolver() {}
};
+ /** Deprecated. Use TakeHeapSnapshot instead. */
+ static const HeapSnapshot* TakeSnapshot(
+ Handle<String> title,
+ HeapSnapshot::Type type = HeapSnapshot::kFull,
+ ActivityControl* control = NULL,
+ ObjectNameResolver* global_object_name_resolver = NULL);
/**
* Takes a heap snapshot and returns it. Title may be an empty string.
* See HeapSnapshot::Type for types description.
*/
- static const HeapSnapshot* TakeSnapshot(
+ const HeapSnapshot* TakeHeapSnapshot(
Handle<String> title,
- HeapSnapshot::Type type = HeapSnapshot::kFull,
ActivityControl* control = NULL,
ObjectNameResolver* global_object_name_resolver = NULL);
+
+ /** Deprecated. Use StartTrackingHeapObjects instead. */
+ static void StartHeapObjectsTracking();
/**
* Starts tracking of heap objects population statistics. After calling
* this method, all heap objects relocations done by the garbage collector
* are being registered.
*/
- static void StartHeapObjectsTracking();
+ void StartTrackingHeapObjects();
+ /** Deprecated. Use GetHeapStats instead. */
+ static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
/**
* Adds a new time interval entry to the aggregated statistics array. The
* time interval entry contains information on the current heap objects
@@ -460,28 +479,36 @@ class V8EXPORT HeapProfiler {
* HeapStatsUpdate structure instances.
* The return value of the function is the last seen heap object Id.
*
- * StartHeapObjectsTracking must be called before the first call to this
+ * StartTrackingHeapObjects must be called before the first call to this
* method.
*/
- static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
+ SnapshotObjectId GetHeapStats(OutputStream* stream);
+ /** Deprecated. Use StopTrackingHeapObjects instead. */
+ static void StopHeapObjectsTracking();
/**
* Stops tracking of heap objects population statistics, cleans up all
* collected data. StartHeapObjectsTracking must be called again prior to
* calling PushHeapObjectsStats next time.
*/
- static void StopHeapObjectsTracking();
+ void StopTrackingHeapObjects();
+ /** Deprecated. Use DeleteAllHeapSnapshots instead. */
+ static void DeleteAllSnapshots();
/**
* Deletes all snapshots taken. All previously returned pointers to
* snapshots and their contents become invalid after this call.
*/
- static void DeleteAllSnapshots();
+ void DeleteAllHeapSnapshots();
- /** Binds a callback to embedder's class ID. */
+ /** Deprecated. Use SetWrapperClassInfoProvider instead. */
static void DefineWrapperClass(
uint16_t class_id,
WrapperInfoCallback callback);
+ /** Binds a callback to embedder's class ID. */
+ void SetWrapperClassInfoProvider(
+ uint16_t class_id,
+ WrapperInfoCallback callback);
/**
* Default value of persistent handle class ID. Must not be used to
@@ -490,11 +517,21 @@ class V8EXPORT HeapProfiler {
*/
static const uint16_t kPersistentHandleNoClassId = 0;
- /** Returns the number of currently existing persistent handles. */
+ /**
+ * Deprecated. Returns the number of currently existing persistent handles.
+ */
static int GetPersistentHandleCount();
- /** Returns memory used for profiler internal data and snapshots. */
+ /** Deprecated. Use GetHeapProfilerMemorySize instead. */
static size_t GetMemorySizeUsedByProfiler();
+ /** Returns memory used for profiler internal data and snapshots. */
+ size_t GetProfilerMemorySize();
+
+ private:
+ HeapProfiler();
+ ~HeapProfiler();
+ HeapProfiler(const HeapProfiler&);
+ HeapProfiler& operator=(const HeapProfiler&);
};
@@ -574,7 +611,7 @@ class V8EXPORT RetainedObjectInfo { // NOLINT
/**
* A struct for exporting HeapStats data from V8, using "push" model.
- * See HeapProfiler::PushHeapObjectsStats.
+ * See HeapProfiler::GetHeapStats.
*/
struct HeapStatsUpdate {
HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size)
« 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