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

Unified Diff: src/profiler/heap-profiler.cc

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 | « src/profiler/heap-profiler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/heap-profiler.cc
diff --git a/src/profiler/heap-profiler.cc b/src/profiler/heap-profiler.cc
index 2df28a795888fca30d3cd32703545e53f2528de5..978986899e30369ef1b1ee1eb3181e5cdedc0931 100644
--- a/src/profiler/heap-profiler.cc
+++ b/src/profiler/heap-profiler.cc
@@ -16,9 +16,8 @@ namespace internal {
HeapProfiler::HeapProfiler(Heap* heap)
: ids_(new HeapObjectsMap(heap)),
names_(new StringsStorage(heap)),
- is_tracking_object_moves_(false) {
-}
-
+ is_tracking_object_moves_(false),
+ get_retainer_infos_callback_(nullptr) {}
static void DeleteHeapSnapshot(HeapSnapshot** snapshot_ptr) {
delete *snapshot_ptr;
@@ -61,6 +60,19 @@ v8::RetainedObjectInfo* HeapProfiler::ExecuteWrapperClassCallback(
class_id, Utils::ToLocal(Handle<Object>(wrapper)));
}
+void HeapProfiler::SetGetRetainerInfosCallback(
+ v8::HeapProfiler::GetRetainerInfosCallback callback) {
+ get_retainer_infos_callback_ = callback;
+}
+
+v8::HeapProfiler::RetainerInfos HeapProfiler::GetRetainerInfos(
+ Isolate* isolate) {
+ v8::HeapProfiler::RetainerInfos infos;
+ if (get_retainer_infos_callback_ != nullptr)
+ infos =
+ get_retainer_infos_callback_(reinterpret_cast<v8::Isolate*>(isolate));
+ return infos;
+}
HeapSnapshot* HeapProfiler::TakeSnapshot(
v8::ActivityControl* control,
« no previous file with comments | « src/profiler/heap-profiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698