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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py

Issue 141553008: Update InspectorBackend.TakeJSHeapSnapshot to make it work with the new HeapProfiler behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
index 1e64311f10008f1763d2c1f4d84c939bfaa0055b..d68c60a2c13b41826c49d8e4c9f6e3deec05171a 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py
@@ -322,15 +322,10 @@ class InspectorBackend(object):
self._page.CollectGarbage()
def TakeJSHeapSnapshot(self, timeout=120):
- # This is a hack to make the nested function be able to modify the
- # variables.
- snapshot_uid = [0]
snapshot = []
def OnNotification(res):
- if res['method'] == 'HeapProfiler.addProfileHeader':
- snapshot_uid[0] = res['params']['header']['uid']
- elif res['method'] == 'HeapProfiler.addHeapSnapshotChunk':
+ if res['method'] == 'HeapProfiler.addHeapSnapshotChunk':
snapshot.append(res['params']['chunk'])
def OnClose():
@@ -340,10 +335,7 @@ class InspectorBackend(object):
self.SyncRequest({'method': 'Page.getResourceTree'}, timeout)
self.SyncRequest({'method': 'Debugger.enable'}, timeout)
- self.SyncRequest({'method': 'HeapProfiler.clearProfiles'}, timeout)
self.SyncRequest({'method': 'HeapProfiler.takeHeapSnapshot'}, timeout)
- self.SyncRequest({'method': 'HeapProfiler.getHeapSnapshot',
- 'params': {'uid': snapshot_uid[0]}}, timeout)
snapshot = ''.join(snapshot)
self.UnregisterDomain('HeapProfiler')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698