Bug 1429803 - Properly populate response header columns; r=rickychien
☠☠ backed out by 677af3c4c901 ☠ ☠
authorJan Odvarko <odvarko@gmail.com>
Thu, 18 Jan 2018 14:55:58 +0100
changeset 454112 a4a6b952ba39cb2ecf9bf3de217f61b1b1b143cd
parent 454111 317b11e452922780d1acd7e5a415c65b3a6a6332
child 454146 d97649d30062fb55af2e8de3631a854afa52ab94
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrickychien
bugs1429803
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1429803 - Properly populate response header columns; r=rickychien MozReview-Commit-ID: 3FS6QtUS8yB
devtools/client/netmonitor/src/components/RequestListColumnResponseHeader.js
devtools/client/netmonitor/src/components/RequestListItem.js
--- a/devtools/client/netmonitor/src/components/RequestListColumnResponseHeader.js
+++ b/devtools/client/netmonitor/src/components/RequestListColumnResponseHeader.js
@@ -2,32 +2,46 @@
  * 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 { 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;
 
 /**
  * Renders a response header column in the requests list.  The actual
  * header to show is passed as a prop.
  */
 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);
     return currHeader !== nextHeader;
   }
 
   render() {
     let header = getResponseHeader(this.props.item, this.props.header);
--- a/devtools/client/netmonitor/src/components/RequestListItem.js
+++ b/devtools/client/netmonitor/src/components/RequestListItem.js
@@ -247,17 +247,21 @@ class RequestListItem extends Component 
           RequestListColumnStartTime({ item, firstRequestStartedMillis }),
         columns.endTime &&
           RequestListColumnEndTime({ item, firstRequestStartedMillis }),
         columns.responseTime &&
           RequestListColumnResponseTime({ item, firstRequestStartedMillis }),
         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,
           firstRequestStartedMillis,
           item,
           onWaterfallMouseDown,
         }),
       )