Migrate profiler/ to import cross-module
Bug: 1006759
Change-Id: Ie62c0fd5af48e5bf4ee8dfc1aead8d2f9af49783
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035936
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/front_end/profiler/LiveHeapProfileView.js b/front_end/profiler/LiveHeapProfileView.js
index 1d96445..207341d 100644
--- a/front_end/profiler/LiveHeapProfileView.js
+++ b/front_end/profiler/LiveHeapProfileView.js
@@ -2,12 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import * as Common from '../common/common.js';
+import * as DataGrid from '../data_grid/data_grid.js';
+import * as SDK from '../sdk/sdk.js';
+import * as UI from '../ui/ui.js';
+
import {SamplingHeapProfileNode} from './HeapProfileView.js'; // eslint-disable-line no-unused-vars
/**
- * @extends {UI.VBox}
+ * @extends {UI.Widget.VBox}
*/
-export class LiveHeapProfileView extends UI.VBox {
+export class LiveHeapProfileView extends UI.Widget.VBox {
constructor() {
super(true);
/** @type {!Map<string, !GridNode>} */
@@ -15,19 +20,19 @@
this.registerRequiredCSS('profiler/liveHeapProfile.css');
this._setting = self.Common.settings.moduleSetting('memoryLiveHeapProfile');
- const toolbar = new UI.Toolbar('live-heap-profile-toolbar', this.contentElement);
+ const toolbar = new UI.Toolbar.Toolbar('live-heap-profile-toolbar', this.contentElement);
this._toggleRecordAction =
- /** @type {!UI.Action }*/ (self.UI.actionRegistry.action('live-heap-profile.toggle-recording'));
- this._toggleRecordButton = UI.Toolbar.createActionButton(this._toggleRecordAction);
+ /** @type {!UI.Action.Action }*/ (self.UI.actionRegistry.action('live-heap-profile.toggle-recording'));
+ this._toggleRecordButton = UI.Toolbar.Toolbar.createActionButton(this._toggleRecordAction);
this._toggleRecordButton.setToggled(this._setting.get());
toolbar.appendToolbarItem(this._toggleRecordButton);
const mainTarget = self.SDK.targetManager.mainTarget();
- if (mainTarget && mainTarget.model(SDK.ResourceTreeModel)) {
+ if (mainTarget && mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel)) {
const startWithReloadAction =
- /** @type {!UI.Action }*/ (self.UI.actionRegistry.action('live-heap-profile.start-with-reload'));
- this._startWithReloadButton = UI.Toolbar.createActionButton(startWithReloadAction);
+ /** @type {!UI.Action.Action }*/ (self.UI.actionRegistry.action('live-heap-profile.start-with-reload'));
+ this._startWithReloadButton = UI.Toolbar.Toolbar.createActionButton(startWithReloadAction);
toolbar.appendToolbarItem(this._startWithReloadButton);
}
@@ -38,7 +43,7 @@
}
/**
- * @return {!DataGrid.SortableDataGrid}
+ * @return {!DataGrid.SortableDataGrid.SortableDataGrid}
*/
_createDataGrid() {
const columns = [
@@ -62,7 +67,7 @@
},
{id: 'url', title: ls`Script URL`, fixedWidth: false, sortable: true, tooltip: ls`URL of the script source`}
];
- const dataGrid = new DataGrid.SortableDataGrid({displayName: ls`Heap Profile`, columns});
+ const dataGrid = new DataGrid.SortableDataGrid.SortableDataGrid({displayName: ls`Heap Profile`, columns});
dataGrid.setResizeMethod(DataGrid.DataGrid.ResizeMethod.Last);
dataGrid.element.classList.add('flex-auto');
dataGrid.element.addEventListener('keydown', this._onKeyDown.bind(this), false);
@@ -191,7 +196,9 @@
* @return {string}
*/
function anonymousScriptName(node) {
- return Number(node.callFrame.scriptId) ? Common.UIString('(Anonymous Script %s)', node.callFrame.scriptId) : '';
+ return Number(node.callFrame.scriptId) ?
+ Common.UIString.UIString('(Anonymous Script %s)', node.callFrame.scriptId) :
+ '';
}
}
@@ -249,7 +256,8 @@
if (!mainTarget) {
return;
}
- const resourceTreeModel = /** @type {?SDK.ResourceTreeModel} */ (mainTarget.model(SDK.ResourceTreeModel));
+ const resourceTreeModel = /** @type {?SDK.ResourceTreeModel.ResourceTreeModel} */ (
+ mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel));
if (resourceTreeModel) {
resourceTreeModel.reloadPage();
}
@@ -260,7 +268,7 @@
}
}
-export class GridNode extends DataGrid.SortableDataGridNode {
+export class GridNode extends DataGrid.SortableDataGrid.SortableDataGridNode {
/**
* @param {string} url
* @param {number} size
@@ -310,12 +318,12 @@
}
/**
- * @implements {UI.ActionDelegate}
+ * @implements {UI.ActionDelegate.ActionDelegate}
*/
export class ActionDelegate {
/**
* @override
- * @param {!UI.Context} context
+ * @param {!UI.Context.Context} context
* @param {string} actionId
* @return {boolean}
*/