Bug 1429803 - Properly populate response header columns; r=rickychien

MozReview-Commit-ID: 3FS6QtUS8yB

--HG--
extra : rebase_source : 8ddc9e9ca0719acd17eb2e23b2e23880f4000fdc
This commit is contained in:
Jan Odvarko 2018-01-18 14:55:58 +01:00
Родитель e55996cc86
Коммит 2a221f4c12
2 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -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,