| OLD | NEW |
| 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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 */ | 1384 */ |
| 1385 WebInspector.TimelineModel.NetworkRequest = class { | 1385 WebInspector.TimelineModel.NetworkRequest = class { |
| 1386 /** | 1386 /** |
| 1387 * @param {!WebInspector.TracingModel.Event} event | 1387 * @param {!WebInspector.TracingModel.Event} event |
| 1388 */ | 1388 */ |
| 1389 constructor(event) { | 1389 constructor(event) { |
| 1390 this.startTime = event.name === WebInspector.TimelineModel.RecordType.Resour
ceSendRequest ? event.startTime : 0; | 1390 this.startTime = event.name === WebInspector.TimelineModel.RecordType.Resour
ceSendRequest ? event.startTime : 0; |
| 1391 this.endTime = Infinity; | 1391 this.endTime = Infinity; |
| 1392 /** @type {!Array<!WebInspector.TracingModel.Event>} */ | 1392 /** @type {!Array<!WebInspector.TracingModel.Event>} */ |
| 1393 this.children = []; | 1393 this.children = []; |
| 1394 /** @type {?Object} */ |
| 1395 this.timing; |
| 1396 /** @type {string} */ |
| 1397 this.mimeType; |
| 1398 /** @type {string} */ |
| 1399 this.url; |
| 1400 /** @type {string} */ |
| 1401 this.requestMethod; |
| 1394 this.addEvent(event); | 1402 this.addEvent(event); |
| 1395 } | 1403 } |
| 1396 | 1404 |
| 1397 /** | 1405 /** |
| 1398 * @param {!WebInspector.TracingModel.Event} event | 1406 * @param {!WebInspector.TracingModel.Event} event |
| 1399 */ | 1407 */ |
| 1400 addEvent(event) { | 1408 addEvent(event) { |
| 1401 this.children.push(event); | 1409 this.children.push(event); |
| 1402 var recordType = WebInspector.TimelineModel.RecordType; | 1410 var recordType = WebInspector.TimelineModel.RecordType; |
| 1403 this.startTime = Math.min(this.startTime, event.startTime); | 1411 this.startTime = Math.min(this.startTime, event.startTime); |
| 1404 var eventData = event.args['data']; | 1412 var eventData = event.args['data']; |
| 1405 if (eventData['mimeType']) | 1413 if (eventData['mimeType']) |
| 1406 this.mimeType = eventData['mimeType']; | 1414 this.mimeType = eventData['mimeType']; |
| 1407 if ('priority' in eventData) | 1415 if ('priority' in eventData) |
| 1408 this.priority = eventData['priority']; | 1416 this.priority = eventData['priority']; |
| 1409 if (event.name === recordType.ResourceFinish) | 1417 if (event.name === recordType.ResourceFinish) |
| 1410 this.endTime = event.startTime; | 1418 this.endTime = event.startTime; |
| 1419 if (eventData['finishTime']) |
| 1420 this.finishTime = eventData['finishTime'] * 1000; |
| 1411 if (!this.responseTime && | 1421 if (!this.responseTime && |
| 1412 (event.name === recordType.ResourceReceiveResponse || event.name === rec
ordType.ResourceReceivedData)) | 1422 (event.name === recordType.ResourceReceiveResponse || event.name === rec
ordType.ResourceReceivedData)) |
| 1413 this.responseTime = event.startTime; | 1423 this.responseTime = event.startTime; |
| 1414 if (!this.url) | 1424 if (!this.url) |
| 1415 this.url = eventData['url']; | 1425 this.url = eventData['url']; |
| 1416 if (!this.requestMethod) | 1426 if (!this.requestMethod) |
| 1417 this.requestMethod = eventData['requestMethod']; | 1427 this.requestMethod = eventData['requestMethod']; |
| 1428 if (!this.timing) |
| 1429 this.timing = eventData['timing']; |
| 1418 } | 1430 } |
| 1419 }; | 1431 }; |
| 1420 | 1432 |
| 1421 WebInspector.TimelineModel.Filter = class { | 1433 WebInspector.TimelineModel.Filter = class { |
| 1422 /** | 1434 /** |
| 1423 * @param {!WebInspector.TracingModel.Event} event | 1435 * @param {!WebInspector.TracingModel.Event} event |
| 1424 * @return {boolean} | 1436 * @return {boolean} |
| 1425 */ | 1437 */ |
| 1426 accept(event) { | 1438 accept(event) { |
| 1427 return true; | 1439 return true; |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 if (!id) | 1859 if (!id) |
| 1848 return; | 1860 return; |
| 1849 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ | 1861 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ |
| 1850 var initiatorMap = this._initiatorByType.get(initiatorType); | 1862 var initiatorMap = this._initiatorByType.get(initiatorType); |
| 1851 if (isInitiator) | 1863 if (isInitiator) |
| 1852 initiatorMap.set(id, event); | 1864 initiatorMap.set(id, event); |
| 1853 else | 1865 else |
| 1854 event.initiator = initiatorMap.get(id) || null; | 1866 event.initiator = initiatorMap.get(id) || null; |
| 1855 } | 1867 } |
| 1856 }; | 1868 }; |
| OLD | NEW |