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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 2560353002: DevTools: move the GC button into the memory panel. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/profiler/module.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 var toolbar = new UI.Toolbar('', toolbarContainerLeft); 424 var toolbar = new UI.Toolbar('', toolbarContainerLeft);
425 425
426 this._toggleRecordAction = 426 this._toggleRecordAction =
427 /** @type {!UI.Action }*/ (UI.actionRegistry.action('profiler.toggle-rec ording')); 427 /** @type {!UI.Action }*/ (UI.actionRegistry.action('profiler.toggle-rec ording'));
428 this._toggleRecordButton = UI.Toolbar.createActionButton(this._toggleRecordA ction); 428 this._toggleRecordButton = UI.Toolbar.createActionButton(this._toggleRecordA ction);
429 toolbar.appendToolbarItem(this._toggleRecordButton); 429 toolbar.appendToolbarItem(this._toggleRecordButton);
430 430
431 this.clearResultsButton = new UI.ToolbarButton(Common.UIString('Clear all pr ofiles'), 'largeicon-clear'); 431 this.clearResultsButton = new UI.ToolbarButton(Common.UIString('Clear all pr ofiles'), 'largeicon-clear');
432 this.clearResultsButton.addEventListener('click', this._reset, this); 432 this.clearResultsButton.addEventListener('click', this._reset, this);
433 toolbar.appendToolbarItem(this.clearResultsButton); 433 toolbar.appendToolbarItem(this.clearResultsButton);
434 toolbar.appendSeparator();
435 toolbar.appendToolbarItem(
436 /** @type {!UI.ToolbarItem} */ (UI.Toolbar.createActionButtonForId('prof iler.collect-garbage')));
434 437
435 this._profileTypeToolbar = new UI.Toolbar('', this._toolbarElement); 438 this._profileTypeToolbar = new UI.Toolbar('', this._toolbarElement);
436 this._profileViewToolbar = new UI.Toolbar('', this._toolbarElement); 439 this._profileViewToolbar = new UI.Toolbar('', this._toolbarElement);
437 440
438 this._profileGroups = {}; 441 this._profileGroups = {};
439 this._launcherView = new Profiler.MultiProfileLauncherView(this); 442 this._launcherView = new Profiler.MultiProfileLauncherView(this);
440 this._launcherView.addEventListener( 443 this._launcherView.addEventListener(
441 Profiler.MultiProfileLauncherView.Events.ProfileTypeSelected, this._onPr ofileTypeSelected, this); 444 Profiler.MultiProfileLauncherView.Events.ProfileTypeSelected, this._onPr ofileTypeSelected, this);
442 445
443 this._profileToView = []; 446 this._profileToView = [];
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 * @param {string} actionId 1256 * @param {string} actionId
1254 * @return {boolean} 1257 * @return {boolean}
1255 */ 1258 */
1256 handleAction(context, actionId) { 1259 handleAction(context, actionId) {
1257 var panel = UI.context.flavor(Profiler.ProfilesPanel); 1260 var panel = UI.context.flavor(Profiler.ProfilesPanel);
1258 console.assert(panel && panel instanceof Profiler.ProfilesPanel); 1261 console.assert(panel && panel instanceof Profiler.ProfilesPanel);
1259 panel.toggleRecord(); 1262 panel.toggleRecord();
1260 return true; 1263 return true;
1261 } 1264 }
1262 }; 1265 };
1266
1267 /**
1268 * @implements {UI.ActionDelegate}
1269 * @unrestricted
1270 */
1271 Profiler.ProfilesPanel.GCActionDelegate = class {
1272 /**
1273 * @override
1274 * @param {!UI.Context} context
1275 * @param {string} actionId
1276 * @return {boolean}
1277 */
1278 handleAction(context, actionId) {
1279 for (var target of SDK.targetManager.targets())
1280 target.heapProfilerAgent().collectGarbage();
1281 return true;
1282 }
1283 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/profiler/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698