зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1429803 - Properly populate response header columns; r=rickychien
MozReview-Commit-ID: 3FS6QtUS8yB --HG-- extra : rebase_source : 8ddc9e9ca0719acd17eb2e23b2e23880f4000fdc
This commit is contained in:
Родитель
e55996cc86
Коммит
2a221f4c12
|
@ -7,7 +7,10 @@
|
|||
const { Component } = require("devtools/client/shared/vendor/react");
|
||||
const dom = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
|
||||
const { getResponseHeader } = require("../utils/request-utils");
|
||||
const {
|
||||
getResponseHeader,
|
||||
fetchNetworkUpdatePacket
|
||||
} = require("../utils/request-utils");
|
||||
|
||||
const { div } = dom;
|
||||
|
||||
|
@ -18,11 +21,22 @@ const { div } = dom;
|
|||
class RequestListColumnResponseHeader extends Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
connector: PropTypes.object.isRequired,
|
||||
item: PropTypes.object.isRequired,
|
||||
header: PropTypes.string.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
let { item, connector } = this.props;
|
||||
fetchNetworkUpdatePacket(connector.requestData, item, ["responseHeaders"]);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
let { item, connector } = nextProps;
|
||||
fetchNetworkUpdatePacket(connector.requestData, item, ["responseHeaders"]);
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
const currHeader = getResponseHeader(this.props.item, this.props.header);
|
||||
const nextHeader = getResponseHeader(nextProps.item, nextProps.header);
|
||||
|
|
|
@ -252,7 +252,11 @@ class RequestListItem extends Component {
|
|||
columns.duration && RequestListColumnDuration({ item }),
|
||||
columns.latency && RequestListColumnLatency({ item }),
|
||||
...RESPONSE_HEADERS.filter(header => columns[header]).map(
|
||||
header => RequestListColumnResponseHeader({ item, header }),
|
||||
header => RequestListColumnResponseHeader({
|
||||
connector,
|
||||
item,
|
||||
header
|
||||
}),
|
||||
),
|
||||
columns.waterfall && RequestListColumnWaterfall({
|
||||
connector,
|
||||
|
|
Загрузка…
Ссылка в новой задаче