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

Unified Diff: src/heap-profiler.cc

Issue 6626043: Add an interface for an embedder to provide information about native (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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
Index: src/heap-profiler.cc
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
index 07b631fa7332d8de6bc1b50f6987aae4d74e58cd..3e2756a29065618871c39d970e8783f7826e381b 100644
--- a/src/heap-profiler.cc
+++ b/src/heap-profiler.cc
@@ -364,6 +364,26 @@ HeapSnapshot* HeapProfiler::TakeSnapshot(String* name,
}
+void HeapProfiler::DefineWrapperClass(
+ uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback) {
+ ASSERT(singleton_ != NULL);
+ if (singleton_->wrapper_callbacks_.length() <= class_id) {
+ singleton_->wrapper_callbacks_.AddBlock(
+ NULL, class_id - singleton_->wrapper_callbacks_.length() + 1);
+ }
+ singleton_->wrapper_callbacks_[class_id] = callback;
+}
+
+
+v8::RetainedObjectInfo* HeapProfiler::ExecuteWrapperClassCallback(
+ uint16_t class_id, Object** wrapper) {
+ ASSERT(singleton_ != NULL);
+ if (singleton_->wrapper_callbacks_.length() <= class_id) return NULL;
+ return singleton_->wrapper_callbacks_[class_id](
+ class_id, Utils::ToLocal(Handle<Object>(wrapper)));
+}
+
+
HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name,
int type,
v8::ActivityControl* control) {

Powered by Google App Engine
This is Rietveld 408576698