Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js

Issue 2712833002: DevTools: Show decoded body length for network requests on timeline. (Closed)
Patch Set: rebaseline Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 * @unrestricted 1282 * @unrestricted
1283 */ 1283 */
1284 TimelineModel.TimelineModel.NetworkRequest = class { 1284 TimelineModel.TimelineModel.NetworkRequest = class {
1285 /** 1285 /**
1286 * @param {!SDK.TracingModel.Event} event 1286 * @param {!SDK.TracingModel.Event} event
1287 */ 1287 */
1288 constructor(event) { 1288 constructor(event) {
1289 this.startTime = event.name === TimelineModel.TimelineModel.RecordType.Resou rceSendRequest ? event.startTime : 0; 1289 this.startTime = event.name === TimelineModel.TimelineModel.RecordType.Resou rceSendRequest ? event.startTime : 0;
1290 this.endTime = Infinity; 1290 this.endTime = Infinity;
1291 this.encodedDataLength = 0; 1291 this.encodedDataLength = 0;
1292 this.decodedBodyLength = 0;
1292 /** @type {!Array<!SDK.TracingModel.Event>} */ 1293 /** @type {!Array<!SDK.TracingModel.Event>} */
1293 this.children = []; 1294 this.children = [];
1294 /** @type {?Object} */ 1295 /** @type {?Object} */
1295 this.timing; 1296 this.timing;
1296 /** @type {string} */ 1297 /** @type {string} */
1297 this.mimeType; 1298 this.mimeType;
1298 /** @type {string} */ 1299 /** @type {string} */
1299 this.url; 1300 this.url;
1300 /** @type {string} */ 1301 /** @type {string} */
1301 this.requestMethod; 1302 this.requestMethod;
(...skipping 12 matching lines...) Expand all
1314 this.mimeType = eventData['mimeType']; 1315 this.mimeType = eventData['mimeType'];
1315 if ('priority' in eventData) 1316 if ('priority' in eventData)
1316 this.priority = eventData['priority']; 1317 this.priority = eventData['priority'];
1317 if (event.name === recordType.ResourceFinish) 1318 if (event.name === recordType.ResourceFinish)
1318 this.endTime = event.startTime; 1319 this.endTime = event.startTime;
1319 if (eventData['finishTime']) 1320 if (eventData['finishTime'])
1320 this.finishTime = eventData['finishTime'] * 1000; 1321 this.finishTime = eventData['finishTime'] * 1000;
1321 if (!this.responseTime && 1322 if (!this.responseTime &&
1322 (event.name === recordType.ResourceReceiveResponse || event.name === rec ordType.ResourceReceivedData)) 1323 (event.name === recordType.ResourceReceiveResponse || event.name === rec ordType.ResourceReceivedData))
1323 this.responseTime = event.startTime; 1324 this.responseTime = event.startTime;
1324 const encodedDataLength = eventData['encodedDataLength'] || 0; 1325 var encodedDataLength = eventData['encodedDataLength'] || 0;
1325 if (event.name === recordType.ResourceReceiveResponse) { 1326 if (event.name === recordType.ResourceReceiveResponse) {
1326 if (eventData['fromCache']) 1327 if (eventData['fromCache'])
1327 this.fromCache = true; 1328 this.fromCache = true;
1328 if (eventData['fromServiceWorker']) 1329 if (eventData['fromServiceWorker'])
1329 this.fromServiceWorker = true; 1330 this.fromServiceWorker = true;
1330 this.encodedDataLength = encodedDataLength; 1331 this.encodedDataLength = encodedDataLength;
1331 } 1332 }
1332 if (event.name === recordType.ResourceReceivedData) 1333 if (event.name === recordType.ResourceReceivedData)
1333 this.encodedDataLength += encodedDataLength; 1334 this.encodedDataLength += encodedDataLength;
1334 if (event.name === recordType.ResourceFinish && encodedDataLength) 1335 if (event.name === recordType.ResourceFinish && encodedDataLength)
1335 this.encodedDataLength = encodedDataLength; 1336 this.encodedDataLength = encodedDataLength;
1337 var decodedBodyLength = eventData['decodedBodyLength'];
1338 if (event.name === recordType.ResourceFinish && decodedBodyLength)
1339 this.decodedBodyLength = decodedBodyLength;
1336 if (!this.url) 1340 if (!this.url)
1337 this.url = eventData['url']; 1341 this.url = eventData['url'];
1338 if (!this.requestMethod) 1342 if (!this.requestMethod)
1339 this.requestMethod = eventData['requestMethod']; 1343 this.requestMethod = eventData['requestMethod'];
1340 if (!this.timing) 1344 if (!this.timing)
1341 this.timing = eventData['timing']; 1345 this.timing = eventData['timing'];
1342 if (eventData['fromServiceWorker']) 1346 if (eventData['fromServiceWorker'])
1343 this.fromServiceWorker = true; 1347 this.fromServiceWorker = true;
1344 } 1348 }
1345 }; 1349 };
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 var data = event[TimelineModel.TimelineData._symbol]; 1802 var data = event[TimelineModel.TimelineData._symbol];
1799 if (!data) { 1803 if (!data) {
1800 data = new TimelineModel.TimelineData(); 1804 data = new TimelineModel.TimelineData();
1801 event[TimelineModel.TimelineData._symbol] = data; 1805 event[TimelineModel.TimelineData._symbol] = data;
1802 } 1806 }
1803 return data; 1807 return data;
1804 } 1808 }
1805 }; 1809 };
1806 1810
1807 TimelineModel.TimelineData._symbol = Symbol('timelineData'); 1811 TimelineModel.TimelineData._symbol = Symbol('timelineData');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698