| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 return this._snapshotDataGridList; | 320 return this._snapshotDataGridList; |
| 321 }, | 321 }, |
| 322 | 322 |
| 323 _getProfiles: function() | 323 _getProfiles: function() |
| 324 { | 324 { |
| 325 return WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapsho
tProfileType.TypeId); | 325 return WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapsho
tProfileType.TypeId); |
| 326 }, | 326 }, |
| 327 | 327 |
| 328 _loadProfile: function(profile, callback) | 328 _loadProfile: function(profile, callback) |
| 329 { | 329 { |
| 330 if (profile._loaded) { | 330 WebInspector.panels.profiles.loadHeapSnapshot(profile.uid, callback); |
| 331 callback(profile); | 331 }, |
| 332 return; | |
| 333 } | |
| 334 | 332 |
| 335 InspectorBackend.getProfile(profile.typeId, profile.uid, loadedCallback.
bind(this)); | 333 processLoadedSnapshot: function(profile, loadedSnapshot) |
| 336 | 334 { |
| 337 function loadedCallback(loadedSnapshot) { | 335 var snapshot = WebInspector.HeapSnapshotView.prototype._convertSnapshot(
loadedSnapshot); |
| 338 profile.children = loadedSnapshot.head.children; | 336 profile.children = snapshot.children; |
| 339 profile.entries = loadedSnapshot.head.entries; | 337 profile.entries = snapshot.entries; |
| 340 profile.lowlevels = loadedSnapshot.head.lowlevels; | 338 profile.lowlevels = snapshot.lowlevels; |
| 341 this._prepareProfile(profile); | 339 WebInspector.HeapSnapshotView.prototype._prepareProfile(profile); |
| 342 profile._loaded = true; | |
| 343 this.parent.updateProfile(profile); | |
| 344 callback(profile); | |
| 345 } | |
| 346 }, | 340 }, |
| 347 | 341 |
| 348 _mouseDownInDataGrid: function(event) | 342 _mouseDownInDataGrid: function(event) |
| 349 { | 343 { |
| 350 if (event.detail < 2) | 344 if (event.detail < 2) |
| 351 return; | 345 return; |
| 352 | 346 |
| 353 var cell = event.target.enclosingNodeOrSelfWithNodeName("td"); | 347 var cell = event.target.enclosingNodeOrSelfWithNodeName("td"); |
| 354 if (!cell || (!cell.hasStyleClass("count-column") && !cell.hasStyleClass
("size-column") && !cell.hasStyleClass("countDelta-column") && !cell.hasStyleCla
ss("sizeDelta-column"))) | 348 if (!cell || (!cell.hasStyleClass("count-column") && !cell.hasStyleClass
("size-column") && !cell.hasStyleClass("countDelta-column") && !cell.hasStyleCla
ss("sizeDelta-column"))) |
| 355 return; | 349 return; |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.
UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item"); | 993 return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.
UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item"); |
| 1000 }, | 994 }, |
| 1001 | 995 |
| 1002 createView: function(profile) | 996 createView: function(profile) |
| 1003 { | 997 { |
| 1004 return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, p
rofile); | 998 return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, p
rofile); |
| 1005 } | 999 } |
| 1006 } | 1000 } |
| 1007 | 1001 |
| 1008 WebInspector.HeapSnapshotProfileType.prototype.__proto__ = WebInspector.ProfileT
ype.prototype; | 1002 WebInspector.HeapSnapshotProfileType.prototype.__proto__ = WebInspector.ProfileT
ype.prototype; |
| OLD | NEW |