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

Unified Diff: include/v8-profiler.h

Issue 2631063003: [api,profiler] Introduce GetRetainerInfos callback for profiling (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | 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 74c0613946d5131910a42a46a84a8c83b8f32c96..b0a81f2b0b9c0ce5e7f9f3d63327764ac9ae3ff7 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -5,6 +5,7 @@
#ifndef V8_V8_PROFILER_H_
#define V8_V8_PROFILER_H_
+#include <unordered_set>
#include <vector>
#include "v8.h" // NOLINT(build/include)
@@ -630,6 +631,24 @@ class V8_EXPORT HeapProfiler {
kSamplingForceGC = 1 << 0,
};
+ typedef std::unordered_set<const v8::PersistentBase<v8::Value>*>
+ RetainerChildren;
+ typedef std::vector<std::pair<v8::RetainedObjectInfo*, RetainerChildren>>
+ RetainerGroups;
+ typedef std::vector<std::pair<const v8::PersistentBase<v8::Value>*,
+ const v8::PersistentBase<v8::Value>*>>
+ RetainerEdges;
+
+ struct RetainerInfos {
+ RetainerGroups groups;
+ RetainerEdges edges;
+ };
+
+ /**
+ * Callback function invoked to retrieve all RetainerInfos from the embedder.
+ */
+ typedef RetainerInfos (*GetRetainerInfosCallback)(v8::Isolate* isolate);
+
/**
* Callback function invoked for obtaining RetainedObjectInfo for
* the given JavaScript wrapper object. It is prohibited to enter V8
@@ -782,6 +801,8 @@ class V8_EXPORT HeapProfiler {
uint16_t class_id,
WrapperInfoCallback callback);
+ void SetGetRetainerInfosCallback(GetRetainerInfosCallback callback);
+
/**
* Default value of persistent handle class ID. Must not be used to
* define a class. Can be used to reset a class of a persistent
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698