Bug 1675256 - [devtools] Remove discardRequestBody and discardResponseBody attributes of NETWORK_EVENT resource. r=bomsy,devtools-backward-compat-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D95846
This commit is contained in:
Alexandre Poirot 2020-11-04 17:14:03 +00:00
Родитель 2de72821eb
Коммит 613fcbb932
8 изменённых файлов: 0 добавлений и 34 удалений

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

@ -173,8 +173,6 @@ function getOrderedResource(resource) {
timeStamp: resource.timeStamp,
node: resource.node,
actor: resource.actor,
discardRequestBody: resource.discardRequestBody,
discardResponseBody: resource.discardResponseBody,
startedDateTime: resource.startedDateTime,
request: resource.request,
isXHR: resource.isXHR,

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

@ -22,8 +22,6 @@ rawPackets.set(`GET request`, {
"resourceType": "network-event",
"timeStamp": 1572867483805,
"actor": "server0.conn0.netEvent4",
"discardRequestBody": true,
"discardResponseBody": false,
"startedDateTime": "2019-11-04T11:06:34.542Z",
"request": {
"url": "http://example.com/inexistent.html",
@ -80,8 +78,6 @@ rawPackets.set(`GET request update`, {
"resourceType": "network-event",
"timeStamp": 1572867483805,
"actor": "server0.conn0.netEvent5",
"discardRequestBody": true,
"discardResponseBody": false,
"startedDateTime": "2020-07-07T14:41:14.572Z",
"request": {
"url": "http://example.com/inexistent.html",
@ -138,8 +134,6 @@ rawPackets.set(`XHR GET request`, {
"resourceType": "network-event",
"timeStamp": 1572867483805,
"actor": "server0.conn0.netEvent21",
"discardRequestBody": true,
"discardResponseBody": false,
"startedDateTime": "2020-07-07T14:41:14.612Z",
"request": {
"url": "http://example.com/inexistent.html",
@ -196,8 +190,6 @@ rawPackets.set(`XHR GET request update`, {
"resourceType": "network-event",
"timeStamp": 1572867483805,
"actor": "server0.conn0.netEvent20",
"discardRequestBody": true,
"discardResponseBody": false,
"request": {
"url": "http://example.com/inexistent.html",
"method": "GET",
@ -253,8 +245,6 @@ rawPackets.set(`XHR POST request`, {
"resourceType": "network-event",
"timeStamp": 1572867483805,
"actor": "server0.conn0.netEvent36",
"discardRequestBody": true,
"discardResponseBody": false,
"startedDateTime": "2019-11-04T11:06:35.007Z",
"request": {
"url": "http://example.com/inexistent.html",
@ -311,8 +301,6 @@ rawPackets.set(`XHR POST request update`, {
"resourceType": "network-event",
"timeStamp": 1572867483805,
"actor": "server0.conn0.netEvent36",
"discardRequestBody": true,
"discardResponseBody": false,
"request": {
"url": "http://example.com/inexistent.html",
"method": "POST",

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

@ -102,8 +102,6 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
.browsingContext.id,
resourceId: this._channelId,
actor: this.actorID,
discardRequestBody: true,
discardResponseBody: true,
startedDateTime: this._startedDateTime,
timeStamp: Date.parse(this._startedDateTime),
request: {
@ -340,7 +338,6 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
this._onEventUpdate("requestPostData", {
dataSize,
discardRequestBody: this._discardRequestBody,
});
},
@ -467,7 +464,6 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
contentSize: content.size,
encoding: content.encoding,
transferredSize: content.transferredSize,
discardResponseBody,
blockedReason,
blockingExtension,
});

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

@ -41,8 +41,6 @@ module.exports = async function({
resourceType: ResourceWatcher.TYPES.NETWORK_EVENT,
timeStamp: actor.timeStamp,
actor: actor.actor,
discardRequestBody: true,
discardResponseBody: true,
startedDateTime: actor.startedDateTime,
request: {
url: actor.url,
@ -94,7 +92,6 @@ module.exports = async function({
});
break;
case "requestPostData":
resourceUpdates.discardRequestBody = packet.discardRequestBody;
resourceUpdates.request = Object.assign({}, resource.request, {
bodySize: packet.dataSize,
});
@ -112,11 +109,8 @@ module.exports = async function({
},
waitingTime: packet.response.waitingTime,
});
resourceUpdates.discardResponseBody =
packet.response.discardResponseBody;
break;
case "responseContent":
resourceUpdates.discardResponseBody = packet.discardResponseBody;
resourceUpdates.response = Object.assign({}, resource.response, {
bodySize: packet.contentSize,
transferredSize: packet.transferredSize,

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

@ -122,7 +122,6 @@ const networkEventSpec = generateActorSpec({
updateType: Arg(0, "string"),
dataSize: Option(1, "number"),
discardRequestBody: Option(1, "boolean"),
},
"network-event-update:response-start": {
@ -148,7 +147,6 @@ const networkEventSpec = generateActorSpec({
contentSize: Option(1, "number"),
encoding: Option(1, "string"),
transferredSize: Option(1, "number"),
discardResponseBody: Option(1, "boolean"),
blockedReason: Option(1, "number"),
blockingExtension: Option(1, "string"),
},

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

@ -116,7 +116,6 @@ function assertNetworkEventUpdate(netActor, packet) {
break;
case "requestPostData":
ok(packet.dataSize > 0, "dataSize > 0");
ok(!packet.discardRequestBody, "discardRequestBody");
break;
case "responseStart":
expectedPacket = {
@ -125,7 +124,6 @@ function assertNetworkEventUpdate(netActor, packet) {
status: "200",
statusText: "OK",
headersSize: /^\d+$/,
discardResponseBody: false,
},
};
break;
@ -143,7 +141,6 @@ function assertNetworkEventUpdate(netActor, packet) {
expectedPacket = {
mimeType: "application/json",
contentSize: /^\d+$/,
discardResponseBody: false,
};
break;
case "eventTimings":

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

@ -88,7 +88,6 @@ function onNetworkEventUpdate(aState, aPacket)
status: "200",
statusText: "OK",
headersSize: /^\d+$/,
discardResponseBody: false,
},
};
break;
@ -106,7 +105,6 @@ function onNetworkEventUpdate(aState, aPacket)
expectedPacket = {
mimeType: "application/json",
contentSize: 1070,
discardResponseBody: false,
};
break;
case "eventTimings":

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

@ -81,7 +81,6 @@ function onNetworkEventUpdate(aState, aPacket)
break;
case "requestPostData":
ok(aPacket.dataSize > 0, "dataSize > 0");
ok(!aPacket.discardRequestBody, "discardRequestBody");
break;
case "responseStart":
expectedPacket = {
@ -90,7 +89,6 @@ function onNetworkEventUpdate(aState, aPacket)
status: "200",
statusText: "OK",
headersSize: /^\d+$/,
discardResponseBody: false,
},
};
break;
@ -108,7 +106,6 @@ function onNetworkEventUpdate(aState, aPacket)
expectedPacket = {
mimeType: "application/json",
contentSize: /^\d+$/,
discardResponseBody: false,
};
break;
case "eventTimings":