| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 /** | 213 /** |
| 214 * @param {?Profiler.ProfileHeader} profile | 214 * @param {?Profiler.ProfileHeader} profile |
| 215 */ | 215 */ |
| 216 setProfileBeingRecorded(profile) { | 216 setProfileBeingRecorded(profile) { |
| 217 this._profileBeingRecorded = profile; | 217 this._profileBeingRecorded = profile; |
| 218 } | 218 } |
| 219 | 219 |
| 220 profileBeingRecordedRemoved() { | 220 profileBeingRecordedRemoved() { |
| 221 } | 221 } |
| 222 | 222 |
| 223 _reset() { | 223 reset() { |
| 224 var profiles = this._profiles.slice(0); | 224 this._profiles.slice(0).forEach(this._disposeProfile.bind(this)); |
| 225 for (var i = 0; i < profiles.length; ++i) | |
| 226 this._disposeProfile(profiles[i]); | |
| 227 this._profiles = []; | 225 this._profiles = []; |
| 228 | |
| 229 this._nextProfileUid = 1; | 226 this._nextProfileUid = 1; |
| 230 } | 227 } |
| 231 | 228 |
| 232 /** | 229 /** |
| 233 * @param {!Profiler.ProfileHeader} profile | 230 * @param {!Profiler.ProfileHeader} profile |
| 234 */ | 231 */ |
| 235 _disposeProfile(profile) { | 232 _disposeProfile(profile) { |
| 236 this.dispatchEventToListeners(Profiler.ProfileType.Events.RemoveProfileHeade
r, profile); | 233 this.dispatchEventToListeners(Profiler.ProfileType.Events.RemoveProfileHeade
r, profile); |
| 237 profile.dispose(); | 234 profile.dispose(); |
| 238 if (this._profileBeingRecorded === profile) { | 235 if (this._profileBeingRecorded === profile) { |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 | 588 |
| 592 _updateProfileTypeSpecificUI() { | 589 _updateProfileTypeSpecificUI() { |
| 593 this._updateToggleRecordAction(this._toggleRecordAction.toggled()); | 590 this._updateToggleRecordAction(this._toggleRecordAction.toggled()); |
| 594 this._profileTypeToolbar.removeToolbarItems(); | 591 this._profileTypeToolbar.removeToolbarItems(); |
| 595 var toolbarItems = this._selectedProfileType.toolbarItems(); | 592 var toolbarItems = this._selectedProfileType.toolbarItems(); |
| 596 for (var i = 0; i < toolbarItems.length; ++i) | 593 for (var i = 0; i < toolbarItems.length; ++i) |
| 597 this._profileTypeToolbar.appendToolbarItem(toolbarItems[i]); | 594 this._profileTypeToolbar.appendToolbarItem(toolbarItems[i]); |
| 598 } | 595 } |
| 599 | 596 |
| 600 _reset() { | 597 _reset() { |
| 601 var types = Profiler.ProfileTypeRegistry.instance.profileTypes(); | 598 Profiler.ProfileTypeRegistry.instance.profileTypes().forEach(type => type.re
set()); |
| 602 for (var i = 0; i < types.length; i++) | |
| 603 types[i]._reset(); | |
| 604 | 599 |
| 605 delete this.visibleView; | 600 delete this.visibleView; |
| 606 | 601 |
| 607 this._profileGroups = {}; | 602 this._profileGroups = {}; |
| 608 this._updateToggleRecordAction(false); | 603 this._updateToggleRecordAction(false); |
| 609 this._launcherView.profileFinished(); | 604 this._launcherView.profileFinished(); |
| 610 | 605 |
| 611 this._sidebarTree.element.classList.remove('some-expandable'); | 606 this._sidebarTree.element.classList.remove('some-expandable'); |
| 612 | 607 |
| 613 this._launcherView.detach(); | 608 this._launcherView.detach(); |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 * @param {!UI.Context} context | 1269 * @param {!UI.Context} context |
| 1275 * @param {string} actionId | 1270 * @param {string} actionId |
| 1276 * @return {boolean} | 1271 * @return {boolean} |
| 1277 */ | 1272 */ |
| 1278 handleAction(context, actionId) { | 1273 handleAction(context, actionId) { |
| 1279 for (var target of SDK.targetManager.targets()) | 1274 for (var target of SDK.targetManager.targets()) |
| 1280 target.heapProfilerAgent().collectGarbage(); | 1275 target.heapProfilerAgent().collectGarbage(); |
| 1281 return true; | 1276 return true; |
| 1282 } | 1277 } |
| 1283 }; | 1278 }; |
| OLD | NEW |