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

Unified Diff: include/v8-profiler.h

Issue 11415203: Introduce callback for resolving global object name while taking heap snapshot (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years 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
===================================================================
--- include/v8-profiler.h (revision 13098)
+++ include/v8-profiler.h (working copy)
@@ -407,13 +407,28 @@
static const SnapshotObjectId kUnknownObjectId = 0;
/**
+ * Callback interface for retrieving user friendly names of global objects.
+ */
+ class ObjectNameResolver {
+ 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:
+ virtual ~ObjectNameResolver() {}
+ };
+
+ /**
* Takes a heap snapshot and returns it. Title may be an empty string.
* See HeapSnapshot::Type for types description.
*/
static const HeapSnapshot* TakeSnapshot(
Handle<String> title,
HeapSnapshot::Type type = HeapSnapshot::kFull,
- ActivityControl* control = NULL);
+ ActivityControl* control = NULL,
+ ObjectNameResolver* global_object_name_resolver = NULL);
/**
* Starts tracking of heap objects population statistics. After calling
« 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