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

Unified Diff: tools/telemetry/telemetry/core/heap/model.py

Issue 24076016: Add JS heap snapshotting functionality to Telemetry (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (nduca) Created 7 years, 3 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: tools/telemetry/telemetry/core/heap/model.py
diff --git a/tools/telemetry/telemetry/core/heap/model.py b/tools/telemetry/telemetry/core/heap/model.py
new file mode 100644
index 0000000000000000000000000000000000000000..8ce70f7ab64b2a7258c2d4e8edddc24d4c7bf86c
--- /dev/null
+++ b/tools/telemetry/telemetry/core/heap/model.py
@@ -0,0 +1,21 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.core.heap import chrome_js_heap_snapshot_parser
+
+class Model(object):
+ """ The heap snapshot model is a set of LiveHeapObjects. The LiveHeapObjects
+ contain the RetainingEdge objects describing the relationships between the
+ LiveHeapObjects."""
+
+ def __init__(self, raw_data):
+ if not chrome_js_heap_snapshot_parser.ChromeJsHeapSnapshotParser.CanImport(
+ raw_data):
+ raise ValueError("Cannot import snapshot data")
+ parser = chrome_js_heap_snapshot_parser.ChromeJsHeapSnapshotParser(raw_data)
+ self._all_live_heap_objects = parser.GetAllLiveHeapObjects()
+
+ @property
+ def all_live_heap_objects(self):
+ return self._all_live_heap_objects

Powered by Google App Engine
This is Rietveld 408576698