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

Unified Diff: src/heap-profiler.cc

Issue 6685084: Add support for CPU and heap profiles deletion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implemente per-profile deletion Created 9 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
Index: src/heap-profiler.cc
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
index c78f474472a5fde56f7bf3206a7d68caba079eba..4815f8264fd0ca985c819d7cfee8b1b9423a2e08 100644
--- a/src/heap-profiler.cc
+++ b/src/heap-profiler.cc
@@ -326,6 +326,13 @@ HeapProfiler::~HeapProfiler() {
delete snapshots_;
}
+
+void HeapProfiler::ResetSnapshots() {
+ delete snapshots_;
+ snapshots_ = new HeapSnapshotsCollection();
+}
+
+
#endif // ENABLE_LOGGING_AND_PROFILING
void HeapProfiler::Setup() {
@@ -450,6 +457,13 @@ HeapSnapshot* HeapProfiler::FindSnapshot(unsigned uid) {
}
+void HeapProfiler::DeleteAllSnapshots() {
+ HeapProfiler* profiler = Isolate::Current()->heap_profiler();
+ ASSERT(profiler != NULL);
+ profiler->ResetSnapshots();
+}
+
+
void HeapProfiler::ObjectMoveEvent(Address from, Address to) {
snapshots_->ObjectMoveEvent(from, to);
}

Powered by Google App Engine
This is Rietveld 408576698