diff --git a/.eslintignore b/.eslintignore index bfc8d5831846..b66f8eb0fe92 100644 --- a/.eslintignore +++ b/.eslintignore @@ -86,7 +86,6 @@ devtools/client/framework/** !devtools/client/framework/selection.js !devtools/client/framework/toolbox.js devtools/client/jsonview/lib/** -devtools/client/memory/** devtools/client/netmonitor/test/** devtools/client/netmonitor/har/test/** devtools/client/projecteditor/** diff --git a/devtools/client/memory/.eslintrc.js b/devtools/client/memory/.eslintrc.js new file mode 100644 index 000000000000..ac42ec2ff1c9 --- /dev/null +++ b/devtools/client/memory/.eslintrc.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = { + "env": { + "browser": true, + }, + "globals": { + "d3": true, + "dagreD3": true, + } +}; diff --git a/devtools/client/memory/actions/census-display.js b/devtools/client/memory/actions/census-display.js index 348a8951a88c..416f5d1b5a1c 100644 --- a/devtools/client/memory/actions/census-display.js +++ b/devtools/client/memory/actions/census-display.js @@ -25,7 +25,8 @@ const setCensusDisplay = exports.setCensusDisplay = function (display) { && display && display.breakdown && display.breakdown.by, - `Breakdowns must be an object with a \`by\` property, attempted to set: ${uneval(display)}`); + "Breakdowns must be an object with a \`by\` property, attempted to set: " + + uneval(display)); return { type: actions.SET_CENSUS_DISPLAY, diff --git a/devtools/client/memory/actions/diffing.js b/devtools/client/memory/actions/diffing.js index 70af307bbb69..964dfe32989b 100644 --- a/devtools/client/memory/actions/diffing.js +++ b/devtools/client/memory/actions/diffing.js @@ -1,6 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ + "use strict"; const { assert, reportException } = require("devtools/shared/DevToolsUtils"); @@ -12,13 +13,11 @@ const { snapshotIsDiffable, findSelectedSnapshot, } = require("../utils"); -// This is a circular dependency, so do not destructure the needed properties. -const snapshotActions = require("./snapshot"); /** * Toggle diffing mode on or off. */ -const toggleDiffing = exports.toggleDiffing = function () { +exports.toggleDiffing = function () { return function (dispatch, getState) { dispatch({ type: actions.CHANGE_VIEW, @@ -155,7 +154,7 @@ const refreshDiffing = exports.refreshDiffing = function (heapWorker) { * @param {HeapAnalysesClient} heapWorker * @param {snapshotModel} snapshot */ -const selectSnapshotForDiffingAndRefresh = exports.selectSnapshotForDiffingAndRefresh = function (heapWorker, snapshot) { +exports.selectSnapshotForDiffingAndRefresh = function (heapWorker, snapshot) { return function* (dispatch, getState) { assert(getState().diffing, "If we are selecting for diffing, we must be in diffing mode"); @@ -169,7 +168,7 @@ const selectSnapshotForDiffingAndRefresh = exports.selectSnapshotForDiffingAndRe * * @param {CensusTreeNode} node */ -const expandDiffingCensusNode = exports.expandDiffingCensusNode = function (node) { +exports.expandDiffingCensusNode = function (node) { return { type: actions.EXPAND_DIFFING_CENSUS_NODE, node, @@ -181,7 +180,7 @@ const expandDiffingCensusNode = exports.expandDiffingCensusNode = function (node * * @param {CensusTreeNode} node */ -const collapseDiffingCensusNode = exports.collapseDiffingCensusNode = function (node) { +exports.collapseDiffingCensusNode = function (node) { return { type: actions.COLLAPSE_DIFFING_CENSUS_NODE, node, @@ -193,7 +192,7 @@ const collapseDiffingCensusNode = exports.collapseDiffingCensusNode = function ( * * @param {DominatorTreeNode} node */ -const focusDiffingCensusNode = exports.focusDiffingCensusNode = function (node) { +exports.focusDiffingCensusNode = function (node) { return { type: actions.FOCUS_DIFFING_CENSUS_NODE, node, diff --git a/devtools/client/memory/actions/io.js b/devtools/client/memory/actions/io.js index 10b45aee535f..ab578d1436e0 100644 --- a/devtools/client/memory/actions/io.js +++ b/devtools/client/memory/actions/io.js @@ -4,16 +4,14 @@ "use strict"; const { immutableUpdate, reportException, assert } = require("devtools/shared/DevToolsUtils"); -const { snapshotState: states, actions, viewState } = require("../constants"); +const { snapshotState: states, actions} = require("../constants"); const { L10N, openFilePicker, createSnapshot } = require("../utils"); const telemetry = require("../telemetry"); const { OS } = require("resource://gre/modules/osfile.jsm"); const { selectSnapshot, computeSnapshotData, - readSnapshot, - takeCensus, - takeTreeMap + readSnapshot } = require("./snapshot"); const VALID_EXPORT_STATES = [states.SAVED, states.READ]; @@ -54,7 +52,7 @@ const exportSnapshot = exports.exportSnapshot = function (snapshot, dest) { }; }; -const pickFileAndImportSnapshotAndCensus = exports.pickFileAndImportSnapshotAndCensus = function (heapWorker) { +exports.pickFileAndImportSnapshotAndCensus = function (heapWorker) { return function* (dispatch, getState) { let input = yield openFilePicker({ title: L10N.getFormatStr("snapshot.io.import.window"), @@ -70,7 +68,7 @@ const pickFileAndImportSnapshotAndCensus = exports.pickFileAndImportSnapshotAndC }; }; -const importSnapshotAndCensus = exports.importSnapshotAndCensus = function (heapWorker, path) { +const importSnapshotAndCensus = function (heapWorker, path) { return function* (dispatch, getState) { telemetry.countImportSnapshot(); @@ -95,3 +93,4 @@ const importSnapshotAndCensus = exports.importSnapshotAndCensus = function (heap dispatch({ type: actions.IMPORT_SNAPSHOT_END, id }); }; }; +exports.importSnapshotAndCensus = importSnapshotAndCensus; diff --git a/devtools/client/memory/actions/label-display.js b/devtools/client/memory/actions/label-display.js index 6e68293ab8e0..82f7d4f5249d 100644 --- a/devtools/client/memory/actions/label-display.js +++ b/devtools/client/memory/actions/label-display.js @@ -29,7 +29,8 @@ const setLabelDisplay = exports.setLabelDisplay = function (display) { && display && display.breakdown && display.breakdown.by, - `Breakdowns must be an object with a \`by\` property, attempted to set: ${uneval(display)}`); + "Breakdowns must be an object with a \`by\` property, attempted to set: " + + uneval(display)); return { type: actions.SET_LABEL_DISPLAY, diff --git a/devtools/client/memory/actions/snapshot.js b/devtools/client/memory/actions/snapshot.js index adb24977eb67..3d5ca9c757b5 100644 --- a/devtools/client/memory/actions/snapshot.js +++ b/devtools/client/memory/actions/snapshot.js @@ -34,7 +34,7 @@ const TaskCache = require("./task-cache"); * @param {HeapAnalysesClient} * @param {Object} */ -const takeSnapshotAndCensus = exports.takeSnapshotAndCensus = function (front, heapWorker) { +exports.takeSnapshotAndCensus = function (front, heapWorker) { return function* (dispatch, getState) { const id = yield dispatch(takeSnapshot(front)); if (id === null) { @@ -82,7 +82,7 @@ const computeSnapshotData = exports.computeSnapshotData = function (heapWorker, * @param {HeapAnalysesClient} heapWorker * @param {snapshotId} id */ -const selectSnapshotAndRefresh = exports.selectSnapshotAndRefresh = function (heapWorker, id) { +exports.selectSnapshotAndRefresh = function (heapWorker, id) { return function* (dispatch, getState) { if (getState().diffing || getState().individuals) { dispatch(view.changeView(viewState.CENSUS)); @@ -200,7 +200,9 @@ function makeTakeCensusTask({ getDisplay, getFilter, getCensus, beginAction, // Assert that snapshot is in a valid state assert(canTakeCensus(snapshot), - `Attempting to take a census when the snapshot is not in a ready state. snapshot.state = ${snapshot.state}, census.state = ${(getCensus(snapshot) || { state: null }).state}`); + "Attempting to take a census when the snapshot is not in a ready state. " + + `snapshot.state = ${snapshot.state}, ` + + `census.state = ${(getCensus(snapshot) || { state: null }).state}`); let report, parentMap; let display = getDisplay(getState()); @@ -322,7 +324,7 @@ const getCurrentCensusTaker = exports.getCurrentCensusTaker = function (currentV * * @param {DominatorTreeNode} node. */ -const focusIndividual = exports.focusIndividual = function (node) { +exports.focusIndividual = function (node) { return { type: actions.FOCUS_INDIVIDUAL, node, @@ -412,7 +414,7 @@ function (heapWorker, id, censusBreakdown, reportLeafIndex) { * * @param {HeapAnalysesClient} heapWorker */ -const refreshIndividuals = exports.refreshIndividuals = function (heapWorker) { +exports.refreshIndividuals = function (heapWorker) { return function* (dispatch, getState) { assert(getState().view.state === viewState.INDIVIDUALS, "Should be in INDIVIDUALS view."); @@ -453,7 +455,7 @@ const refreshIndividuals = exports.refreshIndividuals = function (heapWorker) { * * @param {HeapAnalysesClient} heapWorker */ -const refreshSelectedCensus = exports.refreshSelectedCensus = function (heapWorker) { +exports.refreshSelectedCensus = function (heapWorker) { return function* (dispatch, getState) { let snapshot = getState().snapshots.find(s => s.selected); if (!snapshot || snapshot.state !== states.READ) { @@ -479,7 +481,7 @@ const refreshSelectedCensus = exports.refreshSelectedCensus = function (heapWork * * @param {HeapAnalysesClient} heapWorker */ -const refreshSelectedTreeMap = exports.refreshSelectedTreeMap = function (heapWorker) { +exports.refreshSelectedTreeMap = function (heapWorker) { return function* (dispatch, getState) { let snapshot = getState().snapshots.find(s => s.selected); if (!snapshot || snapshot.state !== states.READ) { @@ -596,8 +598,7 @@ TaskCache.declareCacheableTask({ * @param {SnapshotId} id * @param {DominatorTreeLazyChildren} lazyChildren */ -const fetchImmediatelyDominated = exports.fetchImmediatelyDominated = -TaskCache.declareCacheableTask({ +exports.fetchImmediatelyDominated = TaskCache.declareCacheableTask({ getCacheKey(_, id, lazyChildren) { return `${id}-${lazyChildren.key()}`; }, @@ -630,7 +631,7 @@ TaskCache.declareCacheableTask({ removeFromCache(); reportException("actions/snapshot/fetchImmediatelyDominated", error); dispatch({ type: actions.DOMINATOR_TREE_ERROR, id, error }); - return null; + return; } } while (display !== getState().labelDisplay); @@ -643,6 +644,7 @@ TaskCache.declareCacheableTask({ nodes: response.nodes, moreChildrenAvailable: response.moreChildrenAvailable, }); + return; } }); @@ -684,7 +686,7 @@ TaskCache.declareCacheableTask({ * * @param {HeapAnalysesClient} heapWorker */ -const refreshSelectedDominatorTree = exports.refreshSelectedDominatorTree = function (heapWorker) { +exports.refreshSelectedDominatorTree = function (heapWorker) { return function* (dispatch, getState) { let snapshot = getState().snapshots.find(s => s.selected); if (!snapshot) { @@ -731,7 +733,7 @@ const selectSnapshot = exports.selectSnapshot = function (id) { * * @param {HeapAnalysesClient} heapWorker */ -const clearSnapshots = exports.clearSnapshots = function (heapWorker) { +exports.clearSnapshots = function (heapWorker) { return function* (dispatch, getState) { let snapshots = getState().snapshots.filter(s => { let snapshotReady = s.state === states.READ || s.state === states.ERROR; @@ -769,7 +771,7 @@ const clearSnapshots = exports.clearSnapshots = function (heapWorker) { * @param {HeapAnalysesClient} heapWorker * @param {snapshotModel} snapshot */ -const deleteSnapshot = exports.deleteSnapshot = function (heapWorker, snapshot) { +exports.deleteSnapshot = function (heapWorker, snapshot) { return function* (dispatch, getState) { dispatch({ type: actions.DELETE_SNAPSHOTS_START, ids: [snapshot.id] }); @@ -789,7 +791,7 @@ const deleteSnapshot = exports.deleteSnapshot = function (heapWorker, snapshot) * * @param {CensusTreeNode} node */ -const expandCensusNode = exports.expandCensusNode = function (id, node) { +exports.expandCensusNode = function (id, node) { return { type: actions.EXPAND_CENSUS_NODE, id, @@ -802,7 +804,7 @@ const expandCensusNode = exports.expandCensusNode = function (id, node) { * * @param {CensusTreeNode} node */ -const collapseCensusNode = exports.collapseCensusNode = function (id, node) { +exports.collapseCensusNode = function (id, node) { return { type: actions.COLLAPSE_CENSUS_NODE, id, @@ -816,7 +818,7 @@ const collapseCensusNode = exports.collapseCensusNode = function (id, node) { * @param {SnapshotId} id * @param {DominatorTreeNode} node */ -const focusCensusNode = exports.focusCensusNode = function (id, node) { +exports.focusCensusNode = function (id, node) { return { type: actions.FOCUS_CENSUS_NODE, id, @@ -829,7 +831,7 @@ const focusCensusNode = exports.focusCensusNode = function (id, node) { * * @param {DominatorTreeTreeNode} node */ -const expandDominatorTreeNode = exports.expandDominatorTreeNode = function (id, node) { +exports.expandDominatorTreeNode = function (id, node) { return { type: actions.EXPAND_DOMINATOR_TREE_NODE, id, @@ -842,7 +844,7 @@ const expandDominatorTreeNode = exports.expandDominatorTreeNode = function (id, * * @param {DominatorTreeTreeNode} node */ -const collapseDominatorTreeNode = exports.collapseDominatorTreeNode = function (id, node) { +exports.collapseDominatorTreeNode = function (id, node) { return { type: actions.COLLAPSE_DOMINATOR_TREE_NODE, id, @@ -856,7 +858,7 @@ const collapseDominatorTreeNode = exports.collapseDominatorTreeNode = function ( * @param {SnapshotId} id * @param {DominatorTreeNode} node */ -const focusDominatorTreeNode = exports.focusDominatorTreeNode = function (id, node) { +exports.focusDominatorTreeNode = function (id, node) { return { type: actions.FOCUS_DOMINATOR_TREE_NODE, id, diff --git a/devtools/client/memory/actions/tree-map-display.js b/devtools/client/memory/actions/tree-map-display.js index e4ab9988c998..69b205603e15 100644 --- a/devtools/client/memory/actions/tree-map-display.js +++ b/devtools/client/memory/actions/tree-map-display.js @@ -28,7 +28,8 @@ const setTreeMap = exports.setTreeMap = function (display) { && display && display.breakdown && display.breakdown.by, - `Breakdowns must be an object with a \`by\` property, attempted to set: ${uneval(display)}`); + "Breakdowns must be an object with a \`by\` property, attempted to set: " + + uneval(display)); return { type: actions.SET_TREE_MAP_DISPLAY, diff --git a/devtools/client/memory/app.js b/devtools/client/memory/app.js index b705e0a99333..66e5b328f3bf 100644 --- a/devtools/client/memory/app.js +++ b/devtools/client/memory/app.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { assert } = require("devtools/shared/DevToolsUtils"); const { appinfo } = require("Services"); const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react"); @@ -54,10 +56,24 @@ const MemoryApp = createClass({ propTypes: appModel, + childContextTypes: { + front: PropTypes.any, + heapWorker: PropTypes.any, + toolbox: PropTypes.any, + }, + getDefaultProps() { return {}; }, + getChildContext() { + return { + front: this.props.front, + heapWorker: this.props.heapWorker, + toolbox: this.props.toolbox, + }; + }, + componentDidMount() { // Attach the keydown listener directly to the window. When an element that // has the focus (such as a tree node) is removed from the DOM, the focus @@ -69,20 +85,6 @@ const MemoryApp = createClass({ window.removeEventListener("keydown", this.onKeyDown); }, - childContextTypes: { - front: PropTypes.any, - heapWorker: PropTypes.any, - toolbox: PropTypes.any, - }, - - getChildContext() { - return { - front: this.props.front, - heapWorker: this.props.heapWorker, - toolbox: this.props.toolbox, - }; - }, - onKeyDown(e) { let { snapshots, dispatch, heapWorker } = this.props; const selectedSnapshot = snapshots.find(s => s.selected); @@ -219,7 +221,8 @@ const MemoryApp = createClass({ Heap({ snapshot: selectedSnapshot, diffing, - onViewSourceInDebugger: frame => toolbox.viewSourceInDebugger(frame.source, frame.line), + onViewSourceInDebugger: frame => + toolbox.viewSourceInDebugger(frame.source, frame.line), onSnapshotClick: () => dispatch(takeSnapshotAndCensus(front, heapWorker)), onLoadMoreSiblings: lazyChildren => @@ -249,7 +252,8 @@ const MemoryApp = createClass({ dispatch(expandDiffingCensusNode(node)); } else { assert(selectedSnapshot && selectedSnapshot.census === census, - "If not diffing, should be expanding on selected snapshot's census"); + "If not diffing, " + + "should be expanding on selected snapshot's census"); dispatch(expandCensusNode(selectedSnapshot.id, node)); } }, @@ -260,7 +264,8 @@ const MemoryApp = createClass({ dispatch(collapseDiffingCensusNode(node)); } else { assert(selectedSnapshot && selectedSnapshot.census === census, - "If not diffing, should be collapsing on selected snapshot's census"); + "If not diffing, " + + "should be collapsing on selected snapshot's census"); dispatch(collapseCensusNode(selectedSnapshot.id, node)); } }, @@ -271,13 +276,15 @@ const MemoryApp = createClass({ dispatch(focusDiffingCensusNode(node)); } else { assert(selectedSnapshot && selectedSnapshot.census === census, - "If not diffing, should be focusing on nodes in selected snapshot's census"); + "If not diffing, " + + "should be focusing on nodes in selected snapshot's census"); dispatch(focusCensusNode(selectedSnapshot.id, node)); } }, onDominatorTreeExpand: node => { assert(view.state === viewState.DOMINATOR_TREE, - "If expanding dominator tree nodes, should be in dominator tree view"); + "If expanding dominator tree nodes, " + + "should be in dominator tree view"); assert(selectedSnapshot, "...and we should have a selected snapshot"); assert(selectedSnapshot.dominatorTree, "...and that snapshot should have a dominator tree"); @@ -285,7 +292,8 @@ const MemoryApp = createClass({ }, onDominatorTreeCollapse: node => { assert(view.state === viewState.DOMINATOR_TREE, - "If collapsing dominator tree nodes, should be in dominator tree view"); + "If collapsing dominator tree nodes, " + + "should be in dominator tree view"); assert(selectedSnapshot, "...and we should have a selected snapshot"); assert(selectedSnapshot.dominatorTree, "...and that snapshot should have a dominator tree"); @@ -293,7 +301,8 @@ const MemoryApp = createClass({ }, onDominatorTreeFocus: node => { assert(view.state === viewState.DOMINATOR_TREE, - "If focusing dominator tree nodes, should be in dominator tree view"); + "If focusing dominator tree nodes, " + + "should be in dominator tree view"); assert(selectedSnapshot, "...and we should have a selected snapshot"); assert(selectedSnapshot.dominatorTree, "...and that snapshot should have a dominator tree"); diff --git a/devtools/client/memory/components/census-header.js b/devtools/client/memory/components/census-header.js index d897ed132fc9..dee1db6215a8 100644 --- a/devtools/client/memory/components/census-header.js +++ b/devtools/client/memory/components/census-header.js @@ -2,11 +2,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { DOM: dom, createClass } = require("devtools/client/shared/vendor/react"); const { L10N } = require("../utils"); const models = require("../models"); -const CensusHeader = module.exports = createClass({ +module.exports = createClass({ displayName: "CensusHeader", propTypes: { diff --git a/devtools/client/memory/components/census-tree-item.js b/devtools/client/memory/components/census-tree-item.js index c5d08cefcebe..8569513ed28a 100644 --- a/devtools/client/memory/components/census-tree-item.js +++ b/devtools/client/memory/components/census-tree-item.js @@ -9,7 +9,7 @@ const { L10N, formatNumber, formatPercent } = require("../utils"); const Frame = createFactory(require("devtools/client/shared/components/frame")); const { TREE_ROW_HEIGHT } = require("../constants"); -const CensusTreeItem = module.exports = createClass({ +module.exports = createClass({ displayName: "CensusTreeItem", shouldComponentUpdate(nextProps, nextState) { @@ -20,6 +20,31 @@ const CensusTreeItem = module.exports = createClass({ || this.props.diffing != nextProps.diffing; }, + toLabel(name, linkToDebugger) { + if (isSavedFrame(name)) { + return Frame({ + frame: name, + onClick: () => linkToDebugger(name), + showFunctionName: true, + showHost: true, + }); + } + + if (name === null) { + return L10N.getStr("tree-item.root"); + } + + if (name === "noStack") { + return L10N.getStr("tree-item.nostack"); + } + + if (name === "noFilename") { + return L10N.getStr("tree-item.nofilename"); + } + + return String(name); + }, + render() { let { item, @@ -106,29 +131,4 @@ const CensusTreeItem = module.exports = createClass({ ) ); }, - - toLabel(name, linkToDebugger) { - if (isSavedFrame(name)) { - return Frame({ - frame: name, - onClick: () => linkToDebugger(name), - showFunctionName: true, - showHost: true, - }); - } - - if (name === null) { - return L10N.getStr("tree-item.root"); - } - - if (name === "noStack") { - return L10N.getStr("tree-item.nostack"); - } - - if (name === "noFilename") { - return L10N.getStr("tree-item.nofilename"); - } - - return String(name); - }, }); diff --git a/devtools/client/memory/components/census.js b/devtools/client/memory/components/census.js index 3274b26bb06f..92e872ff10c1 100644 --- a/devtools/client/memory/components/census.js +++ b/devtools/client/memory/components/census.js @@ -2,14 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const { DOM: dom, createClass, PropTypes, createFactory } = require("devtools/client/shared/vendor/react"); +"use strict"; + +const { createClass, PropTypes, createFactory } = require("devtools/client/shared/vendor/react"); const Tree = createFactory(require("devtools/client/shared/components/tree")); const CensusTreeItem = createFactory(require("./census-tree-item")); -const { createParentMap } = require("../utils"); const { TREE_ROW_HEIGHT } = require("../constants"); const { censusModel, diffingModel } = require("../models"); -const Census = module.exports = createClass({ +module.exports = createClass({ displayName: "Census", propTypes: { diff --git a/devtools/client/memory/components/dominator-tree-header.js b/devtools/client/memory/components/dominator-tree-header.js index ae1c7520eca0..b2e22fed9790 100644 --- a/devtools/client/memory/components/dominator-tree-header.js +++ b/devtools/client/memory/components/dominator-tree-header.js @@ -2,10 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const { DOM: dom, createClass, PropTypes } = require("devtools/client/shared/vendor/react"); +"use strict"; + +const { DOM: dom, createClass } = require("devtools/client/shared/vendor/react"); const { L10N } = require("../utils"); -const DominatorTreeHeader = module.exports = createClass({ +module.exports = createClass({ displayName: "DominatorTreeHeader", propTypes: { }, diff --git a/devtools/client/memory/components/dominator-tree-item.js b/devtools/client/memory/components/dominator-tree-item.js index bf76ee9b44bf..9933bc3d2982 100644 --- a/devtools/client/memory/components/dominator-tree-item.js +++ b/devtools/client/memory/components/dominator-tree-item.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { assert, isSavedFrame } = require("devtools/shared/DevToolsUtils"); const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react"); const { L10N, formatNumber, formatPercent } = require("../utils"); @@ -16,7 +18,7 @@ const Separator = createFactory(createClass({ } })); -const DominatorTreeItem = module.exports = createClass({ +module.exports = createClass({ displayName: "DominatorTreeItem", propTypes: { diff --git a/devtools/client/memory/components/dominator-tree.js b/devtools/client/memory/components/dominator-tree.js index a1105a4fc541..6ec7c6a3bdcf 100644 --- a/devtools/client/memory/components/dominator-tree.js +++ b/devtools/client/memory/components/dominator-tree.js @@ -2,8 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { DOM: dom, createClass, PropTypes, createFactory } = require("devtools/client/shared/vendor/react"); -const { assert, safeErrorString } = require("devtools/shared/DevToolsUtils"); +const { assert } = require("devtools/shared/DevToolsUtils"); const { createParentMap } = require("devtools/shared/heapsnapshot/CensusUtils"); const Tree = createFactory(require("devtools/client/shared/components/tree")); const DominatorTreeItem = createFactory(require("./dominator-tree-item")); @@ -21,16 +23,16 @@ const DOMINATOR_TREE_AUTO_EXPAND_DEPTH = 3; const DominatorTreeSubtreeFetching = createFactory(createClass({ displayName: "DominatorTreeSubtreeFetching", - shouldComponentUpdate(nextProps, nextState) { - return this.props.depth !== nextProps.depth - || this.props.focused !== nextProps.focused; - }, - propTypes: { depth: PropTypes.number.isRequired, focused: PropTypes.bool.isRequired, }, + shouldComponentUpdate(nextProps, nextState) { + return this.props.depth !== nextProps.depth + || this.props.focused !== nextProps.focused; + }, + render() { let { depth, @@ -103,7 +105,7 @@ const DominatorTreeSiblingLink = createFactory(createClass({ /** * The actual dominator tree rendered as an expandable and collapsible tree. */ -const DominatorTree = module.exports = createClass({ +module.exports = createClass({ displayName: "DominatorTree", propTypes: { diff --git a/devtools/client/memory/components/heap.js b/devtools/client/memory/components/heap.js index 786f37ae1960..8735021f3efc 100644 --- a/devtools/client/memory/components/heap.js +++ b/devtools/client/memory/components/heap.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { DOM: dom, createClass, PropTypes, createFactory } = require("devtools/client/shared/vendor/react"); const { assert, safeErrorString } = require("devtools/shared/DevToolsUtils"); const Census = createFactory(require("./census")); @@ -178,7 +180,7 @@ function getError(snapshot, diffing, individuals) { * state of only a button to take a snapshot, loading states, the census view * tree, the dominator tree, etc. */ -const Heap = module.exports = createClass({ +module.exports = createClass({ displayName: "Heap", propTypes: { @@ -202,68 +204,6 @@ const Heap = module.exports = createClass({ sizes: PropTypes.object.isRequired, }, - render() { - let { - snapshot, - diffing, - onSnapshotClick, - onLoadMoreSiblings, - onViewSourceInDebugger, - onViewIndividuals, - individuals, - view, - } = this.props; - - - if (!diffing && !snapshot && !individuals) { - return this._renderInitial(onSnapshotClick); - } - - const state = getState(view, snapshot, diffing, individuals); - const statusText = getStateStatusText(state, diffing); - - if (shouldDisplayStatus(state, view, snapshot)) { - return this._renderStatus(state, statusText, diffing); - } - - const error = getError(snapshot, diffing, individuals); - if (error) { - return this._renderError(state, statusText, error); - } - - if (view.state === viewState.CENSUS || view.state === viewState.DIFFING) { - const census = view.state === viewState.CENSUS - ? snapshot.census - : diffing.census; - if (!census) { - return this._renderStatus(state, statusText, diffing); - } - return this._renderCensus(state, census, diffing, onViewSourceInDebugger, - onViewIndividuals); - } - - if (view.state === viewState.TREE_MAP) { - return this._renderTreeMap(state, snapshot.treeMap); - } - - if (view.state === viewState.INDIVIDUALS) { - assert(individuals.state === individualsState.FETCHED, - "Should have fetched the individuals -- other states are rendered as statuses"); - return this._renderIndividuals(state, individuals, - individuals.dominatorTree, - onViewSourceInDebugger); - } - - assert(view.state === viewState.DOMINATOR_TREE, - "If we aren't in progress, looking at a census, or diffing, then we " + - "must be looking at a dominator tree"); - assert(!diffing, "Should not have diffing"); - assert(snapshot.dominatorTree, "Should have a dominator tree"); - - return this._renderDominatorTree(state, onViewSourceInDebugger, snapshot.dominatorTree, - onLoadMoreSiblings); - }, - /** * Render the heap view's container panel with the given contents inside of * it. @@ -325,9 +265,10 @@ const Heap = module.exports = createClass({ assert(census.report, "Should not render census that does not have a report"); if (!census.report.children) { + const censusFilterMsg = census.filter ? L10N.getStr("heapview.none-match") + : L10N.getStr("heapview.empty"); const msg = diffing ? L10N.getStr("heapview.no-difference") - : census.filter ? L10N.getStr("heapview.none-match") - : L10N.getStr("heapview.empty"); + : censusFilterMsg; return this._renderHeapView(state, dom.div({ className: "empty" }, msg)); } @@ -452,4 +393,67 @@ const Heap = module.exports = createClass({ }) ); }, + + render() { + let { + snapshot, + diffing, + onSnapshotClick, + onLoadMoreSiblings, + onViewSourceInDebugger, + onViewIndividuals, + individuals, + view, + } = this.props; + + if (!diffing && !snapshot && !individuals) { + return this._renderInitial(onSnapshotClick); + } + + const state = getState(view, snapshot, diffing, individuals); + const statusText = getStateStatusText(state, diffing); + + if (shouldDisplayStatus(state, view, snapshot)) { + return this._renderStatus(state, statusText, diffing); + } + + const error = getError(snapshot, diffing, individuals); + if (error) { + return this._renderError(state, statusText, error); + } + + if (view.state === viewState.CENSUS || view.state === viewState.DIFFING) { + const census = view.state === viewState.CENSUS + ? snapshot.census + : diffing.census; + if (!census) { + return this._renderStatus(state, statusText, diffing); + } + return this._renderCensus(state, census, diffing, onViewSourceInDebugger, + onViewIndividuals); + } + + if (view.state === viewState.TREE_MAP) { + return this._renderTreeMap(state, snapshot.treeMap); + } + + if (view.state === viewState.INDIVIDUALS) { + assert(individuals.state === individualsState.FETCHED, + "Should have fetched the individuals -- " + + "other states are rendered as statuses"); + return this._renderIndividuals(state, individuals, + individuals.dominatorTree, + onViewSourceInDebugger); + } + + assert(view.state === viewState.DOMINATOR_TREE, + "If we aren't in progress, looking at a census, or diffing, then we " + + "must be looking at a dominator tree"); + assert(!diffing, "Should not have diffing"); + assert(snapshot.dominatorTree, "Should have a dominator tree"); + + return this._renderDominatorTree(state, onViewSourceInDebugger, + snapshot.dominatorTree, + onLoadMoreSiblings); + }, }); diff --git a/devtools/client/memory/components/individuals-header.js b/devtools/client/memory/components/individuals-header.js index 7cacd163ec29..6da3c09049a0 100644 --- a/devtools/client/memory/components/individuals-header.js +++ b/devtools/client/memory/components/individuals-header.js @@ -2,10 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const { DOM: dom, createClass, PropTypes } = require("devtools/client/shared/vendor/react"); +"use strict"; + +const { DOM: dom, createClass } = require("devtools/client/shared/vendor/react"); const { L10N } = require("../utils"); -const IndividualsHeader = module.exports = createClass({ +module.exports = createClass({ displayName: "IndividualsHeader", propTypes: { }, diff --git a/devtools/client/memory/components/individuals.js b/devtools/client/memory/components/individuals.js index 56c784820471..b629e2421c14 100644 --- a/devtools/client/memory/components/individuals.js +++ b/devtools/client/memory/components/individuals.js @@ -2,19 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const { DOM: dom, createClass, PropTypes, createFactory } = require("devtools/client/shared/vendor/react"); -const { assert } = require("devtools/shared/DevToolsUtils"); -const { createParentMap } = require("devtools/shared/heapsnapshot/CensusUtils"); +"use strict"; + +const { createClass, PropTypes, createFactory } = require("devtools/client/shared/vendor/react"); const Tree = createFactory(require("devtools/client/shared/components/tree")); const DominatorTreeItem = createFactory(require("./dominator-tree-item")); -const { L10N } = require("../utils"); const { TREE_ROW_HEIGHT } = require("../constants"); const models = require("../models"); /** * The list of individuals in a census group. */ -const Individuals = module.exports = createClass({ +module.exports = createClass({ displayName: "Individuals", propTypes: { diff --git a/devtools/client/memory/components/list.js b/devtools/client/memory/components/list.js index 3aa27da69899..6568c7ce59fa 100644 --- a/devtools/client/memory/components/list.js +++ b/devtools/client/memory/components/list.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { DOM: dom, createClass, PropTypes } = require("devtools/client/shared/vendor/react"); /** @@ -9,7 +11,7 @@ const { DOM: dom, createClass, PropTypes } = require("devtools/client/shared/ven * the children nodes as `itemComponent`, and a list of items to render * as that component with a click handler. */ -const List = module.exports = createClass({ +module.exports = createClass({ displayName: "List", propTypes: { diff --git a/devtools/client/memory/components/shortest-paths.js b/devtools/client/memory/components/shortest-paths.js index 23cb8134b5b8..51d2293a73a1 100644 --- a/devtools/client/memory/components/shortest-paths.js +++ b/devtools/client/memory/components/shortest-paths.js @@ -1,6 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ + "use strict"; const { @@ -29,7 +30,8 @@ function stringifyLabel(label, id) { if (isSavedFrame(piece)) { const { short } = getSourceNames(piece.source); - sanitized[i] = `${piece.functionDisplayName} @ ${short}:${piece.line}:${piece.column}`; + sanitized[i] = `${piece.functionDisplayName} @ ` + + `${short}:${piece.line}:${piece.column}`; } else if (piece === NO_STACK) { sanitized[i] = L10N.getStr("tree-item.nostack"); } else if (piece === NO_FILENAME) { @@ -62,16 +64,16 @@ module.exports = createClass({ return { zoom: null }; }, - shouldComponentUpdate(nextProps) { - return this.props.graph != nextProps.graph; - }, - componentDidMount() { if (this.props.graph) { this._renderGraph(this.refs.container, this.props.graph); } }, + shouldComponentUpdate(nextProps) { + return this.props.graph != nextProps.graph; + }, + componentDidUpdate() { if (this.props.graph) { this._renderGraph(this.refs.container, this.props.graph); @@ -84,44 +86,6 @@ module.exports = createClass({ } }, - render() { - let contents; - if (this.props.graph) { - // Let the componentDidMount or componentDidUpdate method draw the graph - // with DagreD3. We just provide the container for the graph here. - contents = dom.div({ - ref: "container", - style: { - flex: 1, - height: "100%", - width: "100%", - } - }); - } else { - contents = dom.div( - { - id: "shortest-paths-select-node-msg" - }, - L10N.getStr("shortest-paths.select-node") - ); - } - - return dom.div( - { - id: "shortest-paths", - className: "vbox", - }, - dom.label( - { - id: "shortest-paths-header", - className: "header", - }, - L10N.getStr("shortest-paths.header") - ), - contents - ); - }, - _renderGraph(container, { nodes, edges }) { if (!container.firstChild) { const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); @@ -181,4 +145,42 @@ module.exports = createClass({ const layout = dagreD3.layout(); renderer.layout(layout).run(graph, target); }, + + render() { + let contents; + if (this.props.graph) { + // Let the componentDidMount or componentDidUpdate method draw the graph + // with DagreD3. We just provide the container for the graph here. + contents = dom.div({ + ref: "container", + style: { + flex: 1, + height: "100%", + width: "100%", + } + }); + } else { + contents = dom.div( + { + id: "shortest-paths-select-node-msg" + }, + L10N.getStr("shortest-paths.select-node") + ); + } + + return dom.div( + { + id: "shortest-paths", + className: "vbox", + }, + dom.label( + { + id: "shortest-paths-header", + className: "header", + }, + L10N.getStr("shortest-paths.header") + ), + contents + ); + }, }); diff --git a/devtools/client/memory/components/snapshot-list-item.js b/devtools/client/memory/components/snapshot-list-item.js index 37db81d13be9..31c490f93912 100644 --- a/devtools/client/memory/components/snapshot-list-item.js +++ b/devtools/client/memory/components/snapshot-list-item.js @@ -2,7 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const { assert } = require("devtools/shared/DevToolsUtils"); +"use strict"; + const { DOM: dom, createClass, PropTypes } = require("devtools/client/shared/vendor/react"); const { L10N, @@ -12,15 +13,10 @@ const { snapshotIsDiffable, getSavedCensus } = require("../utils"); -const { - snapshotState: states, - diffingState, - censusState, - treeMapState -} = require("../constants"); +const { diffingState } = require("../constants"); const { snapshot: snapshotModel } = require("../models"); -const SnapshotListItem = module.exports = createClass({ +module.exports = createClass({ displayName: "SnapshotListItem", propTypes: { @@ -32,7 +28,7 @@ const SnapshotListItem = module.exports = createClass({ }, render() { - let { index, item: snapshot, onClick, onSave, onDelete, diffing } = this.props; + let { item: snapshot, onClick, onSave, onDelete, diffing } = this.props; let className = `snapshot-list-item ${snapshot.selected ? " selected" : ""}`; let statusText = getStatusText(snapshot.state); let wantThrobber = !!statusText; @@ -75,7 +71,8 @@ const SnapshotListItem = module.exports = createClass({ // If there is census data, fill in the total bytes. if (census) { let { bytes } = getSnapshotTotals(census); - let formatBytes = L10N.getFormatStr("aggregate.mb", L10N.numberWithDecimals(bytes / 1000000, 2)); + let formatBytes = L10N.getFormatStr("aggregate.mb", + L10N.numberWithDecimals(bytes / 1000000, 2)); details = dom.span({ className: "snapshot-totals" }, dom.span({ className: "total-bytes" }, formatBytes) @@ -99,7 +96,9 @@ const SnapshotListItem = module.exports = createClass({ return ( dom.li({ className, onClick }, - dom.span({ className: `snapshot-title ${wantThrobber ? " devtools-throbber" : ""}` }, + dom.span({ + className: `snapshot-title ${wantThrobber ? " devtools-throbber" : ""}` + }, checkbox, title, deleteButton diff --git a/devtools/client/memory/components/toolbar.js b/devtools/client/memory/components/toolbar.js index de60b2af9484..7945b7dfe7ad 100644 --- a/devtools/client/memory/components/toolbar.js +++ b/devtools/client/memory/components/toolbar.js @@ -260,7 +260,8 @@ module.exports = createClass({ dom.button( { id: "diff-snapshots", - className: "devtools-button devtools-monospace" + (!!diffing ? " checked" : ""), + className: "devtools-button devtools-monospace" + + (diffing ? " checked" : ""), disabled: snapshots.length < 2, onClick: onToggleDiffing, title: L10N.getStr("diff-snapshots.tooltip"), diff --git a/devtools/client/memory/components/tree-map.js b/devtools/client/memory/components/tree-map.js index b6764605eb2f..9e952b109996 100644 --- a/devtools/client/memory/components/tree-map.js +++ b/devtools/client/memory/components/tree-map.js @@ -9,12 +9,12 @@ const { treeMapModel } = require("../models"); const startVisualization = require("./tree-map/start"); module.exports = createClass({ + displayName: "TreeMap", + propTypes: { treeMap: treeMapModel }, - displayName: "TreeMap", - getInitialState() { return {}; }, diff --git a/devtools/client/memory/components/tree-map/canvas-utils.js b/devtools/client/memory/components/tree-map/canvas-utils.js index c7d67a0bf0c7..50d94f0802c6 100644 --- a/devtools/client/memory/components/tree-map/canvas-utils.js +++ b/devtools/client/memory/components/tree-map/canvas-utils.js @@ -51,7 +51,7 @@ Canvases.prototype = { * * @return {type} description */ - destroy : function () { + destroy: function () { this.removeHandlers(); this.container.removeChild(this.main.canvas); this.container.removeChild(this.zoom.canvas); diff --git a/devtools/client/memory/components/tree-map/drag-zoom.js b/devtools/client/memory/components/tree-map/drag-zoom.js index 3de970725440..c7ddf5109b6b 100644 --- a/devtools/client/memory/components/tree-map/drag-zoom.js +++ b/devtools/client/memory/components/tree-map/drag-zoom.js @@ -238,7 +238,6 @@ function setScrollHandlers(container, dragZoom, emitChanged, update) { let scrollDelta = getScrollDelta(event, window); let prevZoom = dragZoom.zoom; dragZoom.zoom = Math.max(0, dragZoom.zoom - scrollDelta * ZOOM_SPEED); - let deltaZoom = dragZoom.zoom - prevZoom; // Calculate the updated width and height let prevZoomedWidth = container.offsetWidth * (1 + prevZoom); diff --git a/devtools/client/memory/constants.js b/devtools/client/memory/constants.js index b8e382c73b34..e10f4f13bb3e 100644 --- a/devtools/client/memory/constants.js +++ b/devtools/client/memory/constants.js @@ -122,7 +122,10 @@ actions.RESIZE_SHORTEST_PATHS = "resize-shortest-paths"; const COUNT = Object.freeze({ by: "count", count: true, bytes: true }); const INTERNAL_TYPE = Object.freeze({ by: "internalType", then: COUNT }); -const ALLOCATION_STACK = Object.freeze({ by: "allocationStack", then: COUNT, noStack: COUNT }); +const ALLOCATION_STACK = Object.freeze({ + by: "allocationStack", then: COUNT, + noStack: COUNT +}); const OBJECT_CLASS = Object.freeze({ by: "objectClass", then: COUNT, other: COUNT }); const COARSE_TYPE = Object.freeze({ by: "coarseType", diff --git a/devtools/client/memory/dominator-tree-lazy-children.js b/devtools/client/memory/dominator-tree-lazy-children.js index 85ae29a56697..f61efbc39161 100644 --- a/devtools/client/memory/dominator-tree-lazy-children.js +++ b/devtools/client/memory/dominator-tree-lazy-children.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + /** * The `DominatorTreeLazyChildren` is a placeholder that represents a future * subtree in an existing `DominatorTreeNode` tree that is currently being diff --git a/devtools/client/memory/initializer.js b/devtools/client/memory/initializer.js index adb6e40c19f4..7f8271c30907 100644 --- a/devtools/client/memory/initializer.js +++ b/devtools/client/memory/initializer.js @@ -2,9 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* exported initialize, destroy */ + "use strict"; -const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; +const { utils: Cu } = Components; const BrowserLoaderModule = {}; Cu.import("resource://devtools/client/shared/browser-loader.js", BrowserLoaderModule); const { require } = BrowserLoaderModule.BrowserLoader({ @@ -20,19 +22,21 @@ const Store = require("devtools/client/memory/store"); const { assert } = require("devtools/shared/DevToolsUtils"); /** - * The current target, toolbox, MemoryFront, and HeapAnalysesClient, set by this tool's host. + * The current target, toolbox, MemoryFront, and HeapAnalysesClient, + * set by this tool's host. */ -var gToolbox, gTarget, gFront, gHeapAnalysesClient; +var gToolbox, gFront, gHeapAnalysesClient; /** * Variables set by `initialize()` */ -var gStore, gRoot, gApp, gProvider, unsubscribe, isHighlighted, telemetry; +var gStore, gRoot, gApp, gProvider, unsubscribe, isHighlighted; var initialize = Task.async(function* () { gRoot = document.querySelector("#app"); gStore = Store(); - gApp = createElement(App, { toolbox: gToolbox, front: gFront, heapWorker: gHeapAnalysesClient }); + gApp = createElement(App, + { toolbox: gToolbox, front: gFront, heapWorker: gHeapAnalysesClient }); gProvider = createElement(Provider, { store: gStore }, gApp); ReactDOM.render(gProvider, gRoot); unsubscribe = gStore.subscribe(onStateChange); @@ -44,7 +48,7 @@ var destroy = Task.async(function* () { unsubscribe(); - gStore, gRoot, gApp, gProvider, unsubscribe, isHighlighted; + gStore = gRoot = gApp = gProvider = unsubscribe = isHighlighted = null; }); /** diff --git a/devtools/client/memory/models.js b/devtools/client/memory/models.js index 7624f7accc52..248c5085fb41 100644 --- a/devtools/client/memory/models.js +++ b/devtools/client/memory/models.js @@ -2,6 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* global treeMapState, censusState */ +/* eslint no-shadow: ["error", { "allow": ["app"] }] */ + +"use strict"; + const { assert } = require("devtools/shared/DevToolsUtils"); const { MemoryFront } = require("devtools/shared/fronts/memory"); const HeapAnalysesClient = require("devtools/shared/heapsnapshot/HeapAnalysesClient"); @@ -39,7 +44,9 @@ function catchAndIgnore(fn) { return function (...args) { try { fn(...args); - } catch (err) { } + } catch (err) { + // continue regardless of error + } return null; }; @@ -103,6 +110,7 @@ const treeMapModel = exports.treeMapModel = PropTypes.shape({ assert(!treeMap.report, "Should not have a report"); assert(!treeMap.error, "Should not have an error"); break; + case treeMapState.SAVED: assert(treeMap.report, "Should have a report"); assert(!treeMap.error, "Should not have an error"); @@ -443,7 +451,7 @@ const individualsModel = exports.individuals = PropTypes.shape({ }), }); -let appModel = exports.app = { +exports.app = { // {MemoryFront} Used to communicate with platform front: PropTypes.instanceOf(MemoryFront), @@ -494,7 +502,7 @@ let appModel = exports.app = { break; default: - assert(false, `Unexpected type of view: ${view.state}`); + assert(false, `Unexpected type of view: ${app.view.state}`); } })(app); @@ -512,7 +520,7 @@ let appModel = exports.app = { break; default: - assert(false, `Unexpected type of view: ${view.state}`); + assert(false, `Unexpected type of view: ${app.view.state}`); } })(app); }, diff --git a/devtools/client/memory/panel.js b/devtools/client/memory/panel.js index cf867faff0b9..092f1cb8a7fb 100644 --- a/devtools/client/memory/panel.js +++ b/devtools/client/memory/panel.js @@ -4,12 +4,10 @@ "use strict"; -const { Cc, Ci, Cu, Cr } = require("chrome"); const { Task } = require("devtools/shared/task"); const EventEmitter = require("devtools/shared/event-emitter"); const { MemoryFront } = require("devtools/shared/fronts/memory"); const HeapAnalysesClient = require("devtools/shared/heapsnapshot/HeapAnalysesClient"); -const promise = require("promise"); function MemoryPanel(iframeWindow, toolbox) { this.panelWin = iframeWindow; diff --git a/devtools/client/memory/reducers/allocations.js b/devtools/client/memory/reducers/allocations.js index ccb92f825914..fc2130a8bf46 100644 --- a/devtools/client/memory/reducers/allocations.js +++ b/devtools/client/memory/reducers/allocations.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { assert } = require("devtools/shared/DevToolsUtils"); const { actions } = require("../constants"); diff --git a/devtools/client/memory/reducers/errors.js b/devtools/client/memory/reducers/errors.js index 5fc282df2891..adb042cd4fe6 100644 --- a/devtools/client/memory/reducers/errors.js +++ b/devtools/client/memory/reducers/errors.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { ERROR_TYPE: TASK_ERROR_TYPE } = require("devtools/client/shared/redux/middleware/task"); /** diff --git a/devtools/client/memory/reducers/filter.js b/devtools/client/memory/reducers/filter.js index 99188142c39a..a0f5f57efe02 100644 --- a/devtools/client/memory/reducers/filter.js +++ b/devtools/client/memory/reducers/filter.js @@ -8,7 +8,7 @@ const { actions } = require("../constants"); module.exports = function (filterString = null, action) { if (action.type === actions.SET_FILTER_STRING) { return action.filter || null; - } else { - return filterString; } + + return filterString; }; diff --git a/devtools/client/memory/reducers/snapshots.js b/devtools/client/memory/reducers/snapshots.js index 6293bdded078..5bb7c06e6dfd 100644 --- a/devtools/client/memory/reducers/snapshots.js +++ b/devtools/client/memory/reducers/snapshots.js @@ -240,23 +240,24 @@ handlers[actions.COMPUTE_DOMINATOR_TREE_START] = function (snapshots, { id }) { }); }; -handlers[actions.COMPUTE_DOMINATOR_TREE_END] = function (snapshots, { id, dominatorTreeId }) { - return snapshots.map(snapshot => { - if (snapshot.id !== id) { - return snapshot; - } +handlers[actions.COMPUTE_DOMINATOR_TREE_END] = + function (snapshots, { id, dominatorTreeId }) { + return snapshots.map(snapshot => { + if (snapshot.id !== id) { + return snapshot; + } - assert(snapshot.dominatorTree, "Should have a dominator tree model"); - assert(snapshot.dominatorTree.state == dominatorTreeState.COMPUTING, - "Should be in the COMPUTING state"); + assert(snapshot.dominatorTree, "Should have a dominator tree model"); + assert(snapshot.dominatorTree.state == dominatorTreeState.COMPUTING, + "Should be in the COMPUTING state"); - const dominatorTree = immutableUpdate(snapshot.dominatorTree, { - state: dominatorTreeState.COMPUTED, - dominatorTreeId, + const dominatorTree = immutableUpdate(snapshot.dominatorTree, { + state: dominatorTreeState.COMPUTED, + dominatorTreeId, + }); + return immutableUpdate(snapshot, { dominatorTree }); }); - return immutableUpdate(snapshot, { dominatorTree }); - }); -}; + }; handlers[actions.FETCH_DOMINATOR_TREE_START] = function (snapshots, { id, display }) { return snapshots.map(snapshot => { @@ -267,7 +268,8 @@ handlers[actions.FETCH_DOMINATOR_TREE_START] = function (snapshots, { id, displa assert(snapshot.dominatorTree, "Should have a dominator tree model"); assert(snapshot.dominatorTree.state !== dominatorTreeState.COMPUTING && snapshot.dominatorTree.state !== dominatorTreeState.ERROR, - `Should have already computed the dominator tree, found state = ${snapshot.dominatorTree.state}`); + "Should have already computed the dominator tree, found state = " + + snapshot.dominatorTree.state); const dominatorTree = immutableUpdate(snapshot.dominatorTree, { state: dominatorTreeState.FETCHING, diff --git a/devtools/client/memory/store.js b/devtools/client/memory/store.js index 3fd2e8a6812e..c245ccc6e565 100644 --- a/devtools/client/memory/store.js +++ b/devtools/client/memory/store.js @@ -2,10 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + const { combineReducers } = require("../shared/vendor/redux"); const createStore = require("../shared/redux/create-store"); const reducers = require("./reducers"); -const { viewState } = require("./constants"); const flags = require("devtools/shared/flags"); module.exports = function () { diff --git a/devtools/client/memory/telemetry.js b/devtools/client/memory/telemetry.js index 1e55805d31a7..4724af1ba983 100644 --- a/devtools/client/memory/telemetry.js +++ b/devtools/client/memory/telemetry.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + // This module exports methods to record telemetry data for memory tool usage. // // NB: Ensure that *every* exported function is wrapped in `makeInfallible` so @@ -10,7 +12,7 @@ const { telemetry } = require("Services"); const { makeInfallible, immutableUpdate } = require("devtools/shared/DevToolsUtils"); -const { labelDisplays, treeMapDisplays, censusDisplays } = require("./constants"); +const { labelDisplays, censusDisplays } = require("./constants"); exports.countTakeSnapshot = makeInfallible(function () { const histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_TAKE_SNAPSHOT_COUNT"); @@ -80,7 +82,8 @@ exports.countDominatorTree = makeInfallible(function ({ display }) { let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_DOMINATOR_TREE_COUNT"); histogram.add(1); - histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_DOMINATOR_TREE_COUNT"); + histogram = + telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_DOMINATOR_TREE_COUNT"); if (display === labelDisplays.coarseType) { histogram.add(COARSE_TYPE); } else if (display === labelDisplays.allocationStack) { diff --git a/devtools/client/memory/test/browser/.eslintrc.js b/devtools/client/memory/test/browser/.eslintrc.js index 698ae9181a0a..b3e235559723 100644 --- a/devtools/client/memory/test/browser/.eslintrc.js +++ b/devtools/client/memory/test/browser/.eslintrc.js @@ -2,5 +2,16 @@ module.exports = { // Extend from the shared list of defined globals for mochitests. - "extends": "../../../../.eslintrc.mochitests.js" + "extends": "../../../../.eslintrc.mochitests.js", + "globals": { + "addTab": true, + "censusState": true, + "refreshTab": true, + "removeTab": true, + "waitForTime": true, + "waitUntilState": true + }, + "rules": { + "no-unused-vars": ["error", { "vars": "local", "args": "none" }], + } }; diff --git a/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js b/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js index ca577bcd2541..7a5686566e98 100644 --- a/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js +++ b/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js @@ -1,36 +1,38 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + /** * Tests taking and then clearing snapshots. */ - const { treeMapState } = require("devtools/client/memory/constants"); - const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; +const { treeMapState } = require("devtools/client/memory/constants"); +const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; - this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { - const { gStore, document } = panel.panelWin; - const { getState, dispatch } = gStore; +this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { + const { gStore, document } = panel.panelWin; + const { getState } = gStore; - let snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); - is(getState().snapshots.length, 0, "Starts with no snapshots in store"); - is(snapshotEls.length, 0, "No snapshots visible"); + let snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); + is(getState().snapshots.length, 0, "Starts with no snapshots in store"); + is(snapshotEls.length, 0, "No snapshots visible"); - info("Take two snapshots"); - takeSnapshot(panel.panelWin); - takeSnapshot(panel.panelWin); - yield waitUntilState(gStore, state => - state.snapshots.length === 2 && - state.snapshots[0].treeMap && state.snapshots[1].treeMap && - state.snapshots[0].treeMap.state === treeMapState.SAVED && - state.snapshots[1].treeMap.state === treeMapState.SAVED); + info("Take two snapshots"); + takeSnapshot(panel.panelWin); + takeSnapshot(panel.panelWin); + yield waitUntilState(gStore, state => + state.snapshots.length === 2 && + state.snapshots[0].treeMap && state.snapshots[1].treeMap && + state.snapshots[0].treeMap.state === treeMapState.SAVED && + state.snapshots[1].treeMap.state === treeMapState.SAVED); - snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); - is(snapshotEls.length, 2, "Two snapshots visible"); + snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); + is(snapshotEls.length, 2, "Two snapshots visible"); - info("Click on Clear Snapshots"); - yield clearSnapshots(panel.panelWin); - is(getState().snapshots.length, 0, "No snapshots in store"); - snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); - is(snapshotEls.length, 0, "No snapshot visible"); - }); + info("Click on Clear Snapshots"); + yield clearSnapshots(panel.panelWin); + is(getState().snapshots.length, 0, "No snapshots in store"); + snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); + is(snapshotEls.length, 0, "No snapshot visible"); +}); diff --git a/devtools/client/memory/test/browser/browser_memory_diff_01.js b/devtools/client/memory/test/browser/browser_memory_diff_01.js index 0deb2a078701..70ea9e4ab888 100644 --- a/devtools/client/memory/test/browser/browser_memory_diff_01.js +++ b/devtools/client/memory/test/browser/browser_memory_diff_01.js @@ -6,7 +6,6 @@ "use strict"; const { - snapshotState, diffingState, treeMapState } = require("devtools/client/memory/constants"); @@ -14,10 +13,8 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { - const heapWorker = panel.panelWin.gHeapAnalysesClient; - const front = panel.panelWin.gFront; const store = panel.panelWin.gStore; - const { getState, dispatch } = store; + const { getState } = store; const doc = panel.panelWin.document; ok(!getState().diffing, "Not diffing by default."); diff --git a/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js b/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js index 3380d6e211de..90bc633f3a96 100644 --- a/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js +++ b/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js @@ -111,7 +111,9 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { // Find the most up-to-date version of the node whose children we just // incrementally fetched. - const newDeepest = (function findNewDeepest(node = getState().snapshots[0].dominatorTree.root) { + const newDeepest = (function findNewDeepest(node = getState().snapshots[0] + .dominatorTree + .root) { if (node.nodeId === deepest.nodeId) { return node; } diff --git a/devtools/client/memory/test/browser/browser_memory_filter_01.js b/devtools/client/memory/test/browser/browser_memory_filter_01.js index 448e2aaa914b..7950d987b943 100644 --- a/devtools/client/memory/test/browser/browser_memory_filter_01.js +++ b/devtools/client/memory/test/browser/browser_memory_filter_01.js @@ -7,7 +7,6 @@ const { dominatorTreeState, - snapshotState, viewState, censusState, } = require("devtools/client/memory/constants"); @@ -17,9 +16,8 @@ const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; - const front = panel.panelWin.gFront; const store = panel.panelWin.gStore; - const { getState, dispatch } = store; + const { dispatch } = store; const doc = panel.panelWin.document; dispatch(changeView(viewState.CENSUS)); @@ -49,7 +47,8 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { let nameElem = doc.querySelector(".heap-tree-item-field.heap-tree-item-name"); ok(nameElem, "Should get a tree item row with a name"); - is(nameElem.textContent.trim(), "js::Shape", "the tree item should be the one we filtered for"); + is(nameElem.textContent.trim(), "js::Shape", + "the tree item should be the one we filtered for"); is(filterInput.value, "js::Shape", "and filter input contains the user value"); diff --git a/devtools/client/memory/test/browser/browser_memory_individuals_01.js b/devtools/client/memory/test/browser/browser_memory_individuals_01.js index eae8248c3602..b902a569ba6c 100644 --- a/devtools/client/memory/test/browser/browser_memory_individuals_01.js +++ b/devtools/client/memory/test/browser/browser_memory_individuals_01.js @@ -11,15 +11,13 @@ const { viewState, censusState, } = require("devtools/client/memory/constants"); -const { changeViewAndRefresh, changeView } = require("devtools/client/memory/actions/view"); +const { changeView } = require("devtools/client/memory/actions/view"); const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { - const heapWorker = panel.panelWin.gHeapAnalysesClient; - const front = panel.panelWin.gFront; const store = panel.panelWin.gStore; - const { getState, dispatch } = store; + const { dispatch } = store; const doc = panel.panelWin.document; dispatch(changeView(viewState.CENSUS)); diff --git a/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js b/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js index eb7cb8acaff1..3271c3330b0a 100644 --- a/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js +++ b/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js @@ -6,7 +6,6 @@ "use strict"; const { - snapshotState, viewState, censusState } = require("devtools/client/memory/constants"); diff --git a/devtools/client/memory/test/browser/browser_memory_keyboard.js b/devtools/client/memory/test/browser/browser_memory_keyboard.js index 243570f83269..f04e054b6731 100644 --- a/devtools/client/memory/test/browser/browser_memory_keyboard.js +++ b/devtools/client/memory/test/browser/browser_memory_keyboard.js @@ -7,7 +7,6 @@ "use strict"; const { - snapshotState, censusState, viewState } = require("devtools/client/memory/constants"); diff --git a/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js b/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js index cd87702856eb..0f309d6245d5 100644 --- a/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js +++ b/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js @@ -35,5 +35,6 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { "Should still not be recording allocagtions"); ok(doc.querySelector(".no-allocation-stacks"), - "Because we did not record allocations, the no-allocation-stack warning should be visible"); + "Because we did not record allocations, " + + "the no-allocation-stack warning should be visible"); }); diff --git a/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js b/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js index ffd481c744d5..d0c80153b2a5 100644 --- a/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js +++ b/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js @@ -27,7 +27,9 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { EventUtils.synthesizeMouseAtCenter(recordingCheckbox, {}, panel.panelWin); is(getState().allocations.recording, true); - const nameElems = [...doc.querySelectorAll(".heap-tree-item-field.heap-tree-item-name")]; + const nameElems = [ + ...doc.querySelectorAll(".heap-tree-item-field.heap-tree-item-name") + ]; for (let el of nameElems) { dumpn(`Found ${el.textContent.trim()}`); diff --git a/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js b/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js index 7ab768b01ceb..2f5ce8547f04 100644 --- a/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js +++ b/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js @@ -1,6 +1,8 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +/* global ChromeUtils */ + // Test that refreshing the page with devtools open does not leak the old // windows from previous navigations. // @@ -9,7 +11,6 @@ "use strict"; -const HeapSnapshotFileUtils = require("devtools/shared/heapsnapshot/HeapSnapshotFileUtils"); const { getLabelAndShallowSize } = require("devtools/shared/heapsnapshot/DominatorTreeNode"); const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_empty.html"; @@ -50,14 +51,11 @@ const DESCRIPTION = { }; this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { - const heapWorker = panel.panelWin.gHeapAnalysesClient; const front = panel.panelWin.gFront; - const store = panel.panelWin.gStore; - const { getState, dispatch } = store; - const doc = panel.panelWin.document; const startWindows = yield getWindowsInSnapshot(front); - dumpn("Initial windows found = " + startWindows.map(w => "0x" + w.toString(16)).join(", ")); + dumpn("Initial windows found = " + startWindows.map(w => "0x" + + w.toString(16)).join(", ")); is(startWindows.length, 1); yield refreshTab(tab); @@ -84,7 +82,8 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { const paths = snapshot.computeShortestPaths(dominatorTree.root, startWindows, 50); for (let i = 0; i < startWindows.length; i++) { - dumpn("Shortest retaining paths for leaking Window 0x" + startWindows[i].toString(16) + " ========================="); + dumpn("Shortest retaining paths for leaking Window 0x" + + startWindows[i].toString(16) + " ========================="); let j = 0; for (let retainingPath of paths.get(startWindows[i])) { if (retainingPath.find(part => part.predecessor === startWindows[i])) { @@ -92,7 +91,8 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { continue; } - dumpn(" Path #" + (++j) + ": --------------------------------------------------------------------"); + dumpn(" Path #" + (++j) + + ": --------------------------------------------------------------------"); for (let part of retainingPath) { const { label } = getLabelAndShallowSize(part.predecessor, snapshot, DESCRIPTION); dumpn(" 0x" + part.predecessor.toString(16) + diff --git a/devtools/client/memory/test/browser/browser_memory_simple_01.js b/devtools/client/memory/test/browser/browser_memory_simple_01.js index 9eaea2ad22b8..c4b78150a32e 100644 --- a/devtools/client/memory/test/browser/browser_memory_simple_01.js +++ b/devtools/client/memory/test/browser/browser_memory_simple_01.js @@ -1,6 +1,8 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + /** * Tests taking snapshots and default states. */ @@ -23,17 +25,20 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); is(getState().snapshots.length, 1, "One snapshot was created in store"); is(snapshotEls.length, 1, "One snapshot was rendered"); - ok(snapshotEls[0].classList.contains("selected"), "Only snapshot has `selected` class"); + ok(snapshotEls[0].classList.contains("selected"), + "Only snapshot has `selected` class"); yield takeSnapshot(panel.panelWin); snapshotEls = document.querySelectorAll("#memory-tool-container .list li"); is(getState().snapshots.length, 2, "Two snapshots created in store"); is(snapshotEls.length, 2, "Two snapshots rendered"); - ok(!snapshotEls[0].classList.contains("selected"), "First snapshot no longer has `selected` class"); - ok(snapshotEls[1].classList.contains("selected"), "Second snapshot has `selected` class"); + ok(!snapshotEls[0].classList.contains("selected"), + "First snapshot no longer has `selected` class"); + ok(snapshotEls[1].classList.contains("selected"), + "Second snapshot has `selected` class"); - yield waitUntilCensusState(gStore, s => s.census, [censusState.SAVED, - censusState.SAVED]); + yield waitUntilCensusState(gStore, s => s.census, + [censusState.SAVED, censusState.SAVED]); ok(document.querySelector(".heap-tree-item-name"), "Should have rendered some tree items"); diff --git a/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js b/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js index 8ebb7622afc3..5d5a2cabec44 100644 --- a/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js +++ b/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js @@ -1,6 +1,8 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +/* global ChromeUtils, HeapSnapshot */ + // Test that we can save a heap snapshot and transfer it over the RDP in e10s // where the child process is sandboxed and so we have to use // HeapSnapshotFileActor to get the heap snapshot file. diff --git a/devtools/client/memory/test/browser/browser_memory_tree_map-02.js b/devtools/client/memory/test/browser/browser_memory_tree_map-02.js index 15f8b0457176..db549c8ca3f8 100644 --- a/devtools/client/memory/test/browser/browser_memory_tree_map-02.js +++ b/devtools/client/memory/test/browser/browser_memory_tree_map-02.js @@ -23,8 +23,8 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { width: "100px", height: "200px", position: "absolute", - left:0, - top:0 + left: 0, + top: 0 }); let rafMock = createRAFMock(); @@ -78,8 +78,6 @@ this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) { info("Dragging correctly translates the div"); { - let initialX = dragZoom.translateX; - let initialY = dragZoom.translateY; div.dispatchEvent(new MouseEvent("mousemove", { clientX: 10, clientY: 10, diff --git a/devtools/client/memory/test/browser/doc_big_tree.html b/devtools/client/memory/test/browser/doc_big_tree.html index 4ad60402a682..57dfdbe5335d 100644 --- a/devtools/client/memory/test/browser/doc_big_tree.html +++ b/devtools/client/memory/test/browser/doc_big_tree.html @@ -1,15 +1,17 @@ -
- - + + + diff --git a/devtools/client/memory/test/browser/doc_steady_allocation.html b/devtools/client/memory/test/browser/doc_steady_allocation.html index 65703c878f87..aa34c4dcc96b 100644 --- a/devtools/client/memory/test/browser/doc_steady_allocation.html +++ b/devtools/client/memory/test/browser/doc_steady_allocation.html @@ -1,16 +1,18 @@ - - - + allocate(); + +