| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 this._name = name; | 36 this._name = name; |
| 37 /** @type {!Array.<!WebInspector.ProfileHeader>} */ | 37 /** @type {!Array.<!WebInspector.ProfileHeader>} */ |
| 38 this._profiles = []; | 38 this._profiles = []; |
| 39 /** @type {?WebInspector.ProfileHeader} */ | 39 /** @type {?WebInspector.ProfileHeader} */ |
| 40 this._profileBeingRecorded = null; | 40 this._profileBeingRecorded = null; |
| 41 this._nextProfileUid = 1; | 41 this._nextProfileUid = 1; |
| 42 | 42 |
| 43 window.addEventListener("unload", this._clearTempStorage.bind(this), false); | 43 window.addEventListener("unload", this._clearTempStorage.bind(this), false); |
| 44 } | 44 } |
| 45 | 45 |
| 46 /** |
| 47 * @enum {string} |
| 48 */ |
| 46 WebInspector.ProfileType.Events = { | 49 WebInspector.ProfileType.Events = { |
| 47 AddProfileHeader: "add-profile-header", | 50 AddProfileHeader: "add-profile-header", |
| 51 ProfileComplete: "profile-complete", |
| 48 RemoveProfileHeader: "remove-profile-header", | 52 RemoveProfileHeader: "remove-profile-header", |
| 49 ViewUpdated: "view-updated" | 53 ViewUpdated: "view-updated" |
| 50 } | 54 } |
| 51 | 55 |
| 52 WebInspector.ProfileType.prototype = { | 56 WebInspector.ProfileType.prototype = { |
| 53 /** | 57 /** |
| 54 * @return {boolean} | 58 * @return {boolean} |
| 55 */ | 59 */ |
| 56 hasTemporaryView: function() | 60 hasTemporaryView: function() |
| 57 { | 61 { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (this._profileBeingRecorded === profile) { | 260 if (this._profileBeingRecorded === profile) { |
| 257 this.profileBeingRecordedRemoved(); | 261 this.profileBeingRecordedRemoved(); |
| 258 this.setProfileBeingRecorded(null); | 262 this.setProfileBeingRecorded(null); |
| 259 } | 263 } |
| 260 }, | 264 }, |
| 261 | 265 |
| 262 __proto__: WebInspector.Object.prototype | 266 __proto__: WebInspector.Object.prototype |
| 263 } | 267 } |
| 264 | 268 |
| 265 /** | 269 /** |
| 270 * @interface |
| 271 */ |
| 272 WebInspector.ProfileType.DataDisplayDelegate = function() |
| 273 { |
| 274 } |
| 275 |
| 276 WebInspector.ProfileType.DataDisplayDelegate.prototype = { |
| 277 /** |
| 278 * @param {?WebInspector.ProfileHeader} profile |
| 279 * @return {?WebInspector.View} |
| 280 */ |
| 281 showProfile: function(profile) { }, |
| 282 |
| 283 /** |
| 284 * @param {!HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId |
| 285 * @param {string} perspectiveName |
| 286 */ |
| 287 showObject: function(snapshotObjectId, perspectiveName) { } |
| 288 } |
| 289 |
| 290 /** |
| 266 * @constructor | 291 * @constructor |
| 267 * @extends {WebInspector.TargetAwareObject} | 292 * @extends {WebInspector.TargetAwareObject} |
| 268 * @param {!WebInspector.ProfileType} profileType | 293 * @param {!WebInspector.ProfileType} profileType |
| 269 * @param {string} title | 294 * @param {string} title |
| 270 */ | 295 */ |
| 271 WebInspector.ProfileHeader = function(target, profileType, title) | 296 WebInspector.ProfileHeader = function(target, profileType, title) |
| 272 { | 297 { |
| 273 WebInspector.TargetAwareObject.call(this, target); | 298 WebInspector.TargetAwareObject.call(this, target); |
| 274 this._profileType = profileType; | 299 this._profileType = profileType; |
| 275 this.title = title; | 300 this.title = title; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 * @param {?string} subtitle | 333 * @param {?string} subtitle |
| 309 * @param {boolean=} wait | 334 * @param {boolean=} wait |
| 310 */ | 335 */ |
| 311 updateStatus: function(subtitle, wait) | 336 updateStatus: function(subtitle, wait) |
| 312 { | 337 { |
| 313 this.dispatchEventToListeners(WebInspector.ProfileHeader.Events.UpdateSt
atus, new WebInspector.ProfileHeader.StatusUpdate(subtitle, wait)); | 338 this.dispatchEventToListeners(WebInspector.ProfileHeader.Events.UpdateSt
atus, new WebInspector.ProfileHeader.StatusUpdate(subtitle, wait)); |
| 314 }, | 339 }, |
| 315 | 340 |
| 316 /** | 341 /** |
| 317 * Must be implemented by subclasses. | 342 * Must be implemented by subclasses. |
| 343 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
| 318 * @return {!WebInspector.ProfileSidebarTreeElement} | 344 * @return {!WebInspector.ProfileSidebarTreeElement} |
| 319 */ | 345 */ |
| 320 createSidebarTreeElement: function() | 346 createSidebarTreeElement: function(dataDisplayDelegate) |
| 321 { | 347 { |
| 322 throw new Error("Needs implemented."); | 348 throw new Error("Needs implemented."); |
| 323 }, | 349 }, |
| 324 | 350 |
| 325 /** | 351 /** |
| 352 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
| 326 * @return {!WebInspector.View} | 353 * @return {!WebInspector.View} |
| 327 */ | 354 */ |
| 328 createView: function() | 355 createView: function(dataDisplayDelegate) |
| 329 { | 356 { |
| 330 throw new Error("Not implemented."); | 357 throw new Error("Not implemented."); |
| 331 }, | 358 }, |
| 332 | 359 |
| 333 removeTempFile: function() | 360 removeTempFile: function() |
| 334 { | 361 { |
| 335 if (this._tempFile) | 362 if (this._tempFile) |
| 336 this._tempFile.remove(); | 363 this._tempFile.remove(); |
| 337 }, | 364 }, |
| 338 | 365 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 { | 407 { |
| 381 this._fromFile = true; | 408 this._fromFile = true; |
| 382 }, | 409 }, |
| 383 | 410 |
| 384 __proto__: WebInspector.TargetAwareObject.prototype | 411 __proto__: WebInspector.TargetAwareObject.prototype |
| 385 } | 412 } |
| 386 | 413 |
| 387 /** | 414 /** |
| 388 * @constructor | 415 * @constructor |
| 389 * @implements {WebInspector.Searchable} | 416 * @implements {WebInspector.Searchable} |
| 417 * @implements {WebInspector.ProfileType.DataDisplayDelegate} |
| 390 * @extends {WebInspector.PanelWithSidebarTree} | 418 * @extends {WebInspector.PanelWithSidebarTree} |
| 391 */ | 419 */ |
| 392 WebInspector.ProfilesPanel = function() | 420 WebInspector.ProfilesPanel = function() |
| 393 { | 421 { |
| 394 WebInspector.PanelWithSidebarTree.call(this, "profiles"); | 422 WebInspector.PanelWithSidebarTree.call(this, "profiles"); |
| 395 this.registerRequiredCSS("panelEnablerView.css"); | 423 this.registerRequiredCSS("panelEnablerView.css"); |
| 396 this.registerRequiredCSS("heapProfiler.css"); | 424 this.registerRequiredCSS("heapProfiler.css"); |
| 397 this.registerRequiredCSS("profilesPanel.css"); | 425 this.registerRequiredCSS("profilesPanel.css"); |
| 398 | 426 |
| 399 this._target = /** @type {!WebInspector.Target} */ (WebInspector.targetManag
er.activeTarget()); | 427 this._target = /** @type {!WebInspector.Target} */ (WebInspector.targetManag
er.activeTarget()); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 { | 709 { |
| 682 HeapProfilerAgent.collectGarbage(); | 710 HeapProfilerAgent.collectGarbage(); |
| 683 }, | 711 }, |
| 684 | 712 |
| 685 /** | 713 /** |
| 686 * @param {!WebInspector.ProfileType} profileType | 714 * @param {!WebInspector.ProfileType} profileType |
| 687 */ | 715 */ |
| 688 _registerProfileType: function(profileType) | 716 _registerProfileType: function(profileType) |
| 689 { | 717 { |
| 690 this._launcherView.addProfileType(profileType); | 718 this._launcherView.addProfileType(profileType); |
| 691 var profileTypeSection = new WebInspector.ProfileTypeSidebarSection(prof
ileType); | 719 var profileTypeSection = new WebInspector.ProfileTypeSidebarSection(this
, profileType); |
| 692 this._typeIdToSidebarSection[profileType.id] = profileTypeSection | 720 this._typeIdToSidebarSection[profileType.id] = profileTypeSection |
| 693 this.sidebarTree.appendChild(profileTypeSection); | 721 this.sidebarTree.appendChild(profileTypeSection); |
| 694 profileTypeSection.childrenListElement.addEventListener("contextmenu", t
his._handleContextMenuEvent.bind(this), true); | 722 profileTypeSection.childrenListElement.addEventListener("contextmenu", t
his._handleContextMenuEvent.bind(this), true); |
| 695 | 723 |
| 696 /** | 724 /** |
| 725 * @param {!WebInspector.Event} event |
| 697 * @this {WebInspector.ProfilesPanel} | 726 * @this {WebInspector.ProfilesPanel} |
| 698 */ | 727 */ |
| 699 function onAddProfileHeader(event) | 728 function onAddProfileHeader(event) |
| 700 { | 729 { |
| 701 this._addProfileHeader(event.data); | 730 this._addProfileHeader(/** @type {!WebInspector.ProfileHeader} */ (e
vent.data)); |
| 702 } | 731 } |
| 703 | 732 |
| 704 /** | 733 /** |
| 734 * @param {!WebInspector.Event} event |
| 705 * @this {WebInspector.ProfilesPanel} | 735 * @this {WebInspector.ProfilesPanel} |
| 706 */ | 736 */ |
| 707 function onRemoveProfileHeader(event) | 737 function onRemoveProfileHeader(event) |
| 708 { | 738 { |
| 709 this._removeProfileHeader(event.data); | 739 this._removeProfileHeader(/** @type {!WebInspector.ProfileHeader} */
(event.data)); |
| 740 } |
| 741 |
| 742 /** |
| 743 * @param {!WebInspector.Event} event |
| 744 * @this {WebInspector.ProfilesPanel} |
| 745 */ |
| 746 function profileComplete(event) |
| 747 { |
| 748 this.showProfile(/** @type {!WebInspector.ProfileHeader} */ (event.d
ata)); |
| 710 } | 749 } |
| 711 | 750 |
| 712 profileType.addEventListener(WebInspector.ProfileType.Events.ViewUpdated
, this._updateProfileTypeSpecificUI, this); | 751 profileType.addEventListener(WebInspector.ProfileType.Events.ViewUpdated
, this._updateProfileTypeSpecificUI, this); |
| 713 profileType.addEventListener(WebInspector.ProfileType.Events.AddProfileH
eader, onAddProfileHeader, this); | 752 profileType.addEventListener(WebInspector.ProfileType.Events.AddProfileH
eader, onAddProfileHeader, this); |
| 714 profileType.addEventListener(WebInspector.ProfileType.Events.RemoveProfi
leHeader, onRemoveProfileHeader, this); | 753 profileType.addEventListener(WebInspector.ProfileType.Events.RemoveProfi
leHeader, onRemoveProfileHeader, this); |
| 754 profileType.addEventListener(WebInspector.ProfileType.Events.ProfileComp
lete, profileComplete, this); |
| 715 | 755 |
| 716 var profiles = profileType.getProfiles(); | 756 var profiles = profileType.getProfiles(); |
| 717 for (var i = 0; i < profiles.length; i++) | 757 for (var i = 0; i < profiles.length; i++) |
| 718 this._addProfileHeader(profiles[i]); | 758 this._addProfileHeader(profiles[i]); |
| 719 }, | 759 }, |
| 720 | 760 |
| 721 /** | 761 /** |
| 722 * @param {?Event} event | 762 * @param {?Event} event |
| 723 */ | 763 */ |
| 724 _handleContextMenuEvent: function(event) | 764 _handleContextMenuEvent: function(event) |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 878 |
| 839 /** | 879 /** |
| 840 * @param {!WebInspector.ProfileHeader} profile | 880 * @param {!WebInspector.ProfileHeader} profile |
| 841 * @return {!WebInspector.View} | 881 * @return {!WebInspector.View} |
| 842 */ | 882 */ |
| 843 _viewForProfile: function(profile) | 883 _viewForProfile: function(profile) |
| 844 { | 884 { |
| 845 var index = this._indexOfViewForProfile(profile); | 885 var index = this._indexOfViewForProfile(profile); |
| 846 if (index !== -1) | 886 if (index !== -1) |
| 847 return this._profileToView[index].view; | 887 return this._profileToView[index].view; |
| 848 var view = profile.createView(); | 888 var view = profile.createView(this); |
| 849 view.element.classList.add("profile-view"); | 889 view.element.classList.add("profile-view"); |
| 850 this._profileToView.push({ profile: profile, view: view}); | 890 this._profileToView.push({ profile: profile, view: view}); |
| 851 return view; | 891 return view; |
| 852 }, | 892 }, |
| 853 | 893 |
| 854 /** | 894 /** |
| 855 * @param {!WebInspector.ProfileHeader} profile | 895 * @param {!WebInspector.ProfileHeader} profile |
| 856 * @return {number} | 896 * @return {number} |
| 857 */ | 897 */ |
| 858 _indexOfViewForProfile: function(profile) | 898 _indexOfViewForProfile: function(profile) |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe
nuTitles() ? "Reveal in Summary view" : "Reveal in Summary View"), revealInView.
bind(this, "Summary")); | 1022 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe
nuTitles() ? "Reveal in Summary view" : "Reveal in Summary View"), revealInView.
bind(this, "Summary")); |
| 983 }, | 1023 }, |
| 984 | 1024 |
| 985 __proto__: WebInspector.PanelWithSidebarTree.prototype | 1025 __proto__: WebInspector.PanelWithSidebarTree.prototype |
| 986 } | 1026 } |
| 987 | 1027 |
| 988 | 1028 |
| 989 /** | 1029 /** |
| 990 * @constructor | 1030 * @constructor |
| 991 * @extends {WebInspector.SidebarSectionTreeElement} | 1031 * @extends {WebInspector.SidebarSectionTreeElement} |
| 1032 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
| 992 * @param {!WebInspector.ProfileType} profileType | 1033 * @param {!WebInspector.ProfileType} profileType |
| 993 */ | 1034 */ |
| 994 WebInspector.ProfileTypeSidebarSection = function(profileType) | 1035 WebInspector.ProfileTypeSidebarSection = function(dataDisplayDelegate, profileTy
pe) |
| 995 { | 1036 { |
| 996 WebInspector.SidebarSectionTreeElement.call(this, profileType.treeItemTitle,
null, true); | 1037 WebInspector.SidebarSectionTreeElement.call(this, profileType.treeItemTitle,
null, true); |
| 1038 this._dataDisplayDelegate = dataDisplayDelegate; |
| 997 this._profileTreeElements = []; | 1039 this._profileTreeElements = []; |
| 998 this._profileGroups = {}; | 1040 this._profileGroups = {}; |
| 999 this.hidden = true; | 1041 this.hidden = true; |
| 1000 } | 1042 } |
| 1001 | 1043 |
| 1002 /** | 1044 /** |
| 1003 * @constructor | 1045 * @constructor |
| 1004 */ | 1046 */ |
| 1005 WebInspector.ProfileTypeSidebarSection.ProfileGroup = function() | 1047 WebInspector.ProfileTypeSidebarSection.ProfileGroup = function() |
| 1006 { | 1048 { |
| 1007 this.profileSidebarTreeElements = []; | 1049 this.profileSidebarTreeElements = []; |
| 1008 this.sidebarTreeElement = null; | 1050 this.sidebarTreeElement = null; |
| 1009 } | 1051 } |
| 1010 | 1052 |
| 1011 WebInspector.ProfileTypeSidebarSection.prototype = { | 1053 WebInspector.ProfileTypeSidebarSection.prototype = { |
| 1012 /** | 1054 /** |
| 1013 * @param {!WebInspector.ProfileHeader} profile | 1055 * @param {!WebInspector.ProfileHeader} profile |
| 1014 */ | 1056 */ |
| 1015 addProfileHeader: function(profile) | 1057 addProfileHeader: function(profile) |
| 1016 { | 1058 { |
| 1017 this.hidden = false; | 1059 this.hidden = false; |
| 1018 var profileType = profile.profileType(); | 1060 var profileType = profile.profileType(); |
| 1019 var sidebarParent = this; | 1061 var sidebarParent = this; |
| 1020 var profileTreeElement = profile.createSidebarTreeElement(); | 1062 var profileTreeElement = profile.createSidebarTreeElement(this._dataDisp
layDelegate); |
| 1021 this._profileTreeElements.push(profileTreeElement); | 1063 this._profileTreeElements.push(profileTreeElement); |
| 1022 | 1064 |
| 1023 if (!profile.fromFile() && profileType.profileBeingRecorded() !== profil
e) { | 1065 if (!profile.fromFile() && profileType.profileBeingRecorded() !== profil
e) { |
| 1024 var profileTitle = profile.title; | 1066 var profileTitle = profile.title; |
| 1025 var group = this._profileGroups[profileTitle]; | 1067 var group = this._profileGroups[profileTitle]; |
| 1026 if (!group) { | 1068 if (!group) { |
| 1027 group = new WebInspector.ProfileTypeSidebarSection.ProfileGroup(
); | 1069 group = new WebInspector.ProfileTypeSidebarSection.ProfileGroup(
); |
| 1028 this._profileGroups[profileTitle] = group; | 1070 this._profileGroups[profileTitle] = group; |
| 1029 } | 1071 } |
| 1030 group.profileSidebarTreeElements.push(profileTreeElement); | 1072 group.profileSidebarTreeElements.push(profileTreeElement); |
| 1031 | 1073 |
| 1032 var groupSize = group.profileSidebarTreeElements.length; | 1074 var groupSize = group.profileSidebarTreeElements.length; |
| 1033 if (groupSize === 2) { | 1075 if (groupSize === 2) { |
| 1034 // Make a group TreeElement now that there are 2 profiles. | 1076 // Make a group TreeElement now that there are 2 profiles. |
| 1035 group.sidebarTreeElement = new WebInspector.ProfileGroupSidebarT
reeElement(profile.title); | 1077 group.sidebarTreeElement = new WebInspector.ProfileGroupSidebarT
reeElement(this._dataDisplayDelegate, profile.title); |
| 1036 | 1078 |
| 1037 var firstProfileTreeElement = group.profileSidebarTreeElements[0
]; | 1079 var firstProfileTreeElement = group.profileSidebarTreeElements[0
]; |
| 1038 // Insert at the same index for the first profile of the group. | 1080 // Insert at the same index for the first profile of the group. |
| 1039 var index = this.children.indexOf(firstProfileTreeElement); | 1081 var index = this.children.indexOf(firstProfileTreeElement); |
| 1040 this.insertChild(group.sidebarTreeElement, index); | 1082 this.insertChild(group.sidebarTreeElement, index); |
| 1041 | 1083 |
| 1042 // Move the first profile to the group. | 1084 // Move the first profile to the group. |
| 1043 var selected = firstProfileTreeElement.selected; | 1085 var selected = firstProfileTreeElement.selected; |
| 1044 this.removeChild(firstProfileTreeElement); | 1086 this.removeChild(firstProfileTreeElement); |
| 1045 group.sidebarTreeElement.appendChild(firstProfileTreeElement); | 1087 group.sidebarTreeElement.appendChild(firstProfileTreeElement); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 */ | 1184 */ |
| 1143 appendApplicableItems: function(event, contextMenu, target) | 1185 appendApplicableItems: function(event, contextMenu, target) |
| 1144 { | 1186 { |
| 1145 WebInspector.inspectorView.panel("profiles").appendApplicableItems(event
, contextMenu, target); | 1187 WebInspector.inspectorView.panel("profiles").appendApplicableItems(event
, contextMenu, target); |
| 1146 } | 1188 } |
| 1147 } | 1189 } |
| 1148 | 1190 |
| 1149 /** | 1191 /** |
| 1150 * @constructor | 1192 * @constructor |
| 1151 * @extends {WebInspector.SidebarTreeElement} | 1193 * @extends {WebInspector.SidebarTreeElement} |
| 1194 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
| 1152 * @param {!WebInspector.ProfileHeader} profile | 1195 * @param {!WebInspector.ProfileHeader} profile |
| 1153 * @param {string} className | 1196 * @param {string} className |
| 1154 */ | 1197 */ |
| 1155 WebInspector.ProfileSidebarTreeElement = function(profile, className) | 1198 WebInspector.ProfileSidebarTreeElement = function(dataDisplayDelegate, profile,
className) |
| 1156 { | 1199 { |
| 1200 this._dataDisplayDelegate = dataDisplayDelegate; |
| 1157 this.profile = profile; | 1201 this.profile = profile; |
| 1158 WebInspector.SidebarTreeElement.call(this, className, profile.title, "", pro
file, false); | 1202 WebInspector.SidebarTreeElement.call(this, className, profile.title, "", pro
file, false); |
| 1159 this.refreshTitles(); | 1203 this.refreshTitles(); |
| 1160 profile.addEventListener(WebInspector.ProfileHeader.Events.UpdateStatus, thi
s._updateStatus, this); | 1204 profile.addEventListener(WebInspector.ProfileHeader.Events.UpdateStatus, thi
s._updateStatus, this); |
| 1161 if (profile.canSaveToFile()) | 1205 if (profile.canSaveToFile()) |
| 1162 this._createSaveLink(); | 1206 this._createSaveLink(); |
| 1163 else | 1207 else |
| 1164 profile.addEventListener(WebInspector.ProfileHeader.Events.ProfileReceiv
ed, this._onProfileReceived, this); | 1208 profile.addEventListener(WebInspector.ProfileHeader.Events.ProfileReceiv
ed, this._onProfileReceived, this); |
| 1165 } | 1209 } |
| 1166 | 1210 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1191 }, | 1235 }, |
| 1192 | 1236 |
| 1193 dispose: function() | 1237 dispose: function() |
| 1194 { | 1238 { |
| 1195 this.profile.removeEventListener(WebInspector.ProfileHeader.Events.Updat
eStatus, this._updateStatus, this); | 1239 this.profile.removeEventListener(WebInspector.ProfileHeader.Events.Updat
eStatus, this._updateStatus, this); |
| 1196 this.profile.removeEventListener(WebInspector.ProfileHeader.Events.Profi
leReceived, this._onProfileReceived, this); | 1240 this.profile.removeEventListener(WebInspector.ProfileHeader.Events.Profi
leReceived, this._onProfileReceived, this); |
| 1197 }, | 1241 }, |
| 1198 | 1242 |
| 1199 onselect: function() | 1243 onselect: function() |
| 1200 { | 1244 { |
| 1201 WebInspector.panels.profiles.showProfile(this.profile); | 1245 this._dataDisplayDelegate.showProfile(this.profile); |
| 1202 }, | 1246 }, |
| 1203 | 1247 |
| 1204 /** | 1248 /** |
| 1205 * @return {boolean} | 1249 * @return {boolean} |
| 1206 */ | 1250 */ |
| 1207 ondelete: function() | 1251 ondelete: function() |
| 1208 { | 1252 { |
| 1209 this.profile.profileType().removeProfile(this.profile); | 1253 this.profile.profileType().removeProfile(this.profile); |
| 1210 return true; | 1254 return true; |
| 1211 }, | 1255 }, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1230 { | 1274 { |
| 1231 this.profile.saveToFile(); | 1275 this.profile.saveToFile(); |
| 1232 }, | 1276 }, |
| 1233 | 1277 |
| 1234 __proto__: WebInspector.SidebarTreeElement.prototype | 1278 __proto__: WebInspector.SidebarTreeElement.prototype |
| 1235 } | 1279 } |
| 1236 | 1280 |
| 1237 /** | 1281 /** |
| 1238 * @constructor | 1282 * @constructor |
| 1239 * @extends {WebInspector.SidebarTreeElement} | 1283 * @extends {WebInspector.SidebarTreeElement} |
| 1284 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate |
| 1240 * @param {string} title | 1285 * @param {string} title |
| 1241 * @param {string=} subtitle | 1286 * @param {string=} subtitle |
| 1242 */ | 1287 */ |
| 1243 WebInspector.ProfileGroupSidebarTreeElement = function(title, subtitle) | 1288 WebInspector.ProfileGroupSidebarTreeElement = function(dataDisplayDelegate, titl
e, subtitle) |
| 1244 { | 1289 { |
| 1245 WebInspector.SidebarTreeElement.call(this, "profile-group-sidebar-tree-item"
, title, subtitle, null, true); | 1290 WebInspector.SidebarTreeElement.call(this, "profile-group-sidebar-tree-item"
, title, subtitle, null, true); |
| 1291 this._dataDisplayDelegate = dataDisplayDelegate; |
| 1246 } | 1292 } |
| 1247 | 1293 |
| 1248 WebInspector.ProfileGroupSidebarTreeElement.prototype = { | 1294 WebInspector.ProfileGroupSidebarTreeElement.prototype = { |
| 1249 onselect: function() | 1295 onselect: function() |
| 1250 { | 1296 { |
| 1251 if (this.children.length > 0) | 1297 if (this.children.length > 0) |
| 1252 WebInspector.panels.profiles.showProfile(this.children[this.children
.length - 1].profile); | 1298 this._dataDisplayDelegate.showProfile(this.children[this.children.le
ngth - 1].profile); |
| 1253 }, | 1299 }, |
| 1254 | 1300 |
| 1255 __proto__: WebInspector.SidebarTreeElement.prototype | 1301 __proto__: WebInspector.SidebarTreeElement.prototype |
| 1256 } | 1302 } |
| 1257 | 1303 |
| 1258 /** | 1304 /** |
| 1259 * @constructor | 1305 * @constructor |
| 1260 * @extends {WebInspector.SidebarTreeElement} | 1306 * @extends {WebInspector.SidebarTreeElement} |
| 1261 * @param {!WebInspector.ProfilesPanel} panel | 1307 * @param {!WebInspector.ProfilesPanel} panel |
| 1262 */ | 1308 */ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1292 importScript("HeapSnapshotCommon.js"); | 1338 importScript("HeapSnapshotCommon.js"); |
| 1293 importScript("HeapSnapshotProxy.js"); | 1339 importScript("HeapSnapshotProxy.js"); |
| 1294 importScript("HeapSnapshotDataGrids.js"); | 1340 importScript("HeapSnapshotDataGrids.js"); |
| 1295 importScript("HeapSnapshotGridNodes.js"); | 1341 importScript("HeapSnapshotGridNodes.js"); |
| 1296 importScript("HeapSnapshotView.js"); | 1342 importScript("HeapSnapshotView.js"); |
| 1297 importScript("ProfileLauncherView.js"); | 1343 importScript("ProfileLauncherView.js"); |
| 1298 importScript("CanvasProfileView.js"); | 1344 importScript("CanvasProfileView.js"); |
| 1299 importScript("CanvasReplayStateView.js"); | 1345 importScript("CanvasReplayStateView.js"); |
| 1300 | 1346 |
| 1301 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry
(); | 1347 WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry
(); |
| OLD | NEW |