Commit 78d61158 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

DevTools: no link when snapshot loaded from file

Code failed when snapshot was not taken from the running application but
loaded from file. heapProfilerModel() returns null if snapshot was loaded
from file.

Bug: chromium:854097
Change-Id: I3c269a78f7f8ec59a15f510dda6ab55a72f53616
Reviewed-on: https://chromium-review.googlesource.com/1146921
Commit-Queue: Dominik Inführ <dinfuehr@google.com>
Reviewed-by: default avatarAlexei Filippov <alph@chromium.org>
Reviewed-by: default avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577515}
parent 6cd75c79
...@@ -209,6 +209,9 @@ Profiler.HeapSnapshotView = class extends UI.SimpleView { ...@@ -209,6 +209,9 @@ Profiler.HeapSnapshotView = class extends UI.SimpleView {
*/ */
async linkifyObject(snapshotObjectId) { async linkifyObject(snapshotObjectId) {
const heapProfilerModel = this._profile.heapProfilerModel(); const heapProfilerModel = this._profile.heapProfilerModel();
// heapProfilerModel is null if snapshot was loaded from file
if (!heapProfilerModel)
return null;
const remoteObject = await heapProfilerModel.objectForSnapshotObjectId(String(snapshotObjectId), 'link'); const remoteObject = await heapProfilerModel.objectForSnapshotObjectId(String(snapshotObjectId), 'link');
if (!remoteObject || remoteObject.type !== 'function') if (!remoteObject || remoteObject.type !== 'function')
return null; return null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment