Backed out 2 changesets (bug 1669473) for perma failures on browser_net_block-csp.js. CLOSED TREE

Backed out changeset d798c548257e (bug 1669473)
Backed out changeset d25a3deb4961 (bug 1669473)
This commit is contained in:
Razvan Maries 2020-10-07 17:46:31 +03:00
Родитель d4152a31bf
Коммит e523193665
3 изменённых файлов: 4 добавлений и 55 удалений

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

@ -534,7 +534,7 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
* @param object serverTimings
* Timing details extracted from the Server-Timing header.
*/
addServerTimings(serverTimings) {
addSeverTimings(serverTimings) {
if (serverTimings) {
this._serverTimings = serverTimings;
}

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

@ -567,7 +567,7 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
* @param object serverTimings
* Timing details extracted from the Server-Timing header.
*/
addServerTimings(serverTimings) {
addSeverTimings(serverTimings) {
if (serverTimings) {
this._serverTimings = serverTimings;
}

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

@ -4,14 +4,6 @@
"use strict";
/**
* NetworkObserver is the main class in DevTools to observe network requests
* out of many events fired by the platform code.
*/
// Enable logging all platform events this module listen to
const DEBUG_PLATFORM_EVENTS = false;
const { Cc, Ci, Cr, Cu } = require("chrome");
const Services = require("Services");
const {
@ -58,12 +50,7 @@ loader.lazyGetter(
() => Cu.getGlobalForObject(Cu).WebExtensionPolicy
);
function logPlatformEvent(eventName, channel, message = "") {
if (!DEBUG_PLATFORM_EVENTS) {
return;
}
dump(`[netmonitor] ${channel.channelId} - ${eventName} ${message}\n`);
}
// Network logging
// The maximum uint32 value.
const PR_UINT32_MAX = 4294967295;
@ -305,8 +292,6 @@ NetworkObserver.prototype = {
return;
}
logPlatformEvent(topic, channel);
this.interceptedChannels.add(subject);
// Service workers never fire http-on-examine-cached-response, so fake one.
@ -332,8 +317,6 @@ NetworkObserver.prototype = {
return;
}
logPlatformEvent(topic, channel);
// Ignore preload requests to avoid duplicity request entries in
// the Network panel. If a preload fails (for whatever reason)
// then the platform kicks off another 'real' request.
@ -366,8 +349,6 @@ NetworkObserver.prototype = {
return;
}
logPlatformEvent(topic, channel);
let id;
let reason;
@ -390,7 +371,7 @@ NetworkObserver.prototype = {
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.addServerTimings(serverTimings);
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
@ -436,8 +417,6 @@ NetworkObserver.prototype = {
return;
}
logPlatformEvent(topic, subject, channel.responseStatus);
const response = {
id: gSequenceId(),
channel: channel,
@ -556,8 +535,6 @@ NetworkObserver.prototype = {
if (throttler) {
const channel = subject.QueryInterface(Ci.nsIHttpChannel);
if (matchRequest(channel, this.filters)) {
logPlatformEvent("http-on-modify-request", channel);
// Read any request body here, before it is throttled.
const httpActivity = this.createOrGetActivityObject(channel);
this._onRequestBodySent(httpActivity);
@ -611,27 +588,6 @@ NetworkObserver.prototype = {
}
},
getActivityTypeString(activityType, activitySubtype) {
if (
activityType === Ci.nsIHttpActivityObserver.ACTIVITY_TYPE_SOCKET_TRANSPORT
) {
for (const name in Ci.nsISocketTransport) {
if (Ci.nsISocketTransport[name] === activitySubtype) {
return "SOCKET_TRANSPORT:" + name;
}
}
} else if (
activityType === Ci.nsIHttpActivityObserver.ACTIVITY_TYPE_HTTP_TRANSACTION
) {
for (const name in Ci.nsIHttpActivityObserver) {
if (Ci.nsIHttpActivityObserver[name] === activitySubtype) {
return "HTTP_TRANSACTION:" + name.replace("ACTIVITY_SUBTYPE_", "");
}
}
}
return "unexpected-activity-types:" + activityType + ":" + activitySubtype;
},
/**
* Begin observing HTTP traffic that originates inside the current tab.
*
@ -670,13 +626,6 @@ NetworkObserver.prototype = {
channel = channel.QueryInterface(Ci.nsIHttpChannel);
channel = channel.QueryInterface(Ci.nsIClassifiedChannel);
if (DEBUG_PLATFORM_EVENTS) {
logPlatformEvent(
this.getActivityTypeString(activityType, activitySubtype),
channel
);
}
if (
activitySubtype == gActivityDistributor.ACTIVITY_SUBTYPE_REQUEST_HEADER
) {