Backed out changeset c209cb1c0341 (bug 1658146) for browser_resources_network_events.js failures CLOSED TREE

This commit is contained in:
Bogdan Tara 2020-08-20 03:17:05 +03:00
Родитель 6d322bffe4
Коммит 789e572738
2 изменённых файлов: 11 добавлений и 18 удалений

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

@ -192,7 +192,7 @@ class HeadersPanel extends Component {
urlDetails.url.split(
requestHeaders.headers.find(ele => ele.name === "Host").value
)[1]
} ${httpVersion || ""}`;
} ${httpVersion}`;
result = `${title} (${getFormattedSize(
writeHeaderText(requestHeaders.headers, preHeaderText).length,
3
@ -357,7 +357,7 @@ class HeadersPanel extends Component {
urlDetails.url.split(
requestHeaders.headers.find(ele => ele.name === "Host").value
)[1]
} ${httpVersion || ""}`;
} ${httpVersion}`;
value = writeHeaderText(requestHeaders.headers, preHeaderText).trim();
break;
case "RESPONSE":

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

@ -368,25 +368,18 @@ NetworkObserver.prototype = {
const httpActivity = this.createOrGetActivityObject(channel);
const serverTimings = this._extractServerTimings(channel);
if (!httpActivity.owner) {
// If the owner isn't set we need to create the network event and send
// it to the client. This happens in case where the request has been
// blocked (e.g. CORS) and "http-on-stop-request" is the first notification.
// Also we need make sure there is a valid reason to block. These reason
// - Either the id is set to a valid string in case of extension blocking
// - Or the reason is set to anything other than 0 (BLOCKING_REASON_NONE) which is default for
// any request (blocked or unblocked). See https://searchfox.org/mozilla-central/rev/23dd7c485a6525bb3a974abeaafaf34bfb43d76b/netwerk/base/nsILoadInfo.idl#1256-1310 for details.
if (reason || id) {
this._createNetworkEvent(subject, {
blockedReason: reason,
blockingExtension: id,
});
}
} else {
if (httpActivity.owner) {
// Try extracting server timings. Note that they will be sent to the client
// in the `_onTransactionClose` method together with network event timings.
httpActivity.owner.addSeverTimings(serverTimings);
} else {
// If the owner isn't set we need to create the network event and send
// it to the client. This happens in case where the request has been
// blocked (e.g. CORS) and "http-on-stop-request" is the first notification.
this._createNetworkEvent(subject, {
blockedReason: reason,
blockingExtension: id,
});
}
},