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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js
index 739d9bdbd6af34bfc4154ae4d5c10dcdce485123..d30c0f9054a8fa68232cf5100f2ec63c15272683 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js
@@ -431,6 +431,9 @@ Profiler.ProfilesPanel = class extends UI.PanelWithSidebar {
this.clearResultsButton = new UI.ToolbarButton(Common.UIString('Clear all profiles'), 'largeicon-clear');
this.clearResultsButton.addEventListener('click', this._reset, this);
toolbar.appendToolbarItem(this.clearResultsButton);
+ toolbar.appendSeparator();
+ toolbar.appendToolbarItem(
+ /** @type {!UI.ToolbarItem} */ (UI.Toolbar.createActionButtonForId('profiler.collect-garbage')));
this._profileTypeToolbar = new UI.Toolbar('', this._toolbarElement);
this._profileViewToolbar = new UI.Toolbar('', this._toolbarElement);
@@ -1260,3 +1263,21 @@ Profiler.ProfilesPanel.RecordActionDelegate = class {
return true;
}
};
+
+/**
+ * @implements {UI.ActionDelegate}
+ * @unrestricted
+ */
+Profiler.ProfilesPanel.GCActionDelegate = class {
+ /**
+ * @override
+ * @param {!UI.Context} context
+ * @param {string} actionId
+ * @return {boolean}
+ */
+ handleAction(context, actionId) {
+ for (var target of SDK.targetManager.targets())
+ target.heapProfilerAgent().collectGarbage();
+ return true;
+ }
+};
« 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