/* 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/. */
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 // falls back to the body.
window.addEventListener("keydown", this.onKeyDown);
}
Heap({
snapshot: selectedSnapshot,
diffing,
onViewSourceInDebugger: ({ url, line, column }) => {
toolbox.viewSourceInDebugger(url, line, column);
},
onSnapshotClick: () =>
dispatch(takeSnapshotAndCensus(front, heapWorker)),
onLoadMoreSiblings: lazyChildren =>
dispatch(
fetchImmediatelyDominated(
heapWorker,
selectedSnapshot.id,
lazyChildren
)
),
onPopView: () => dispatch(popViewAndRefresh(heapWorker)),
individuals,
onViewIndividuals: node => { const snapshotId = diffing
? diffing.secondSnapshotId
: selectedSnapshot.id;
dispatch(
fetchIndividuals(
heapWorker,
snapshotId,
censusDisplay.breakdown,
node.reportLeafIndex
)
);
},
onFocusIndividual: node => { assert(
view.state === viewState.INDIVIDUALS, "Should be in the individuals view"
);
dispatch(focusIndividual(node));
},
onCensusExpand: (census, node) => { if (diffing) { assert(
diffing.census === census, "Should only expand active census"
);
dispatch(expandDiffingCensusNode(node));
} else { assert(
selectedSnapshot && selectedSnapshot.census === census, "If not diffing, " + "should be expanding on selected snapshot's census"
);
dispatch(expandCensusNode(selectedSnapshot.id, node));
}
},
onCensusCollapse: (census, node) => { if (diffing) { assert(
diffing.census === census, "Should only collapse active census"
);
dispatch(collapseDiffingCensusNode(node));
} else { assert(
selectedSnapshot && selectedSnapshot.census === census, "If not diffing, " + "should be collapsing on selected snapshot's census"
);
dispatch(collapseCensusNode(selectedSnapshot.id, node));
}
},
onCensusFocus: (census, node) => { if (diffing) { assert(
diffing.census === census, "Should only focus nodes in active census"
);
dispatch(focusDiffingCensusNode(node));
} else { assert(
selectedSnapshot && selectedSnapshot.census === 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"
); assert(
selectedSnapshot, "...and we should have a selected snapshot"
); assert(
selectedSnapshot.dominatorTree, "...and that snapshot should have a dominator tree"
);
dispatch(expandDominatorTreeNode(selectedSnapshot.id, node));
},
onDominatorTreeCollapse: node => { assert(
view.state === viewState.DOMINATOR_TREE, "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"
);
dispatch(collapseDominatorTreeNode(selectedSnapshot.id, node));
},
onDominatorTreeFocus: node => { assert(
view.state === viewState.DOMINATOR_TREE, "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"
);
dispatch(focusDominatorTreeNode(selectedSnapshot.id, node));
},
onShortestPathsResize: newSize => {
dispatch(resizeShortestPaths(newSize));
},
sizes,
view,
})
)
);
}
}
/** * Passed into react-redux's `connect` method that is called on store change * and passed to components.
*/ function mapStateToProps(state) { return state;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.