Created
October 1, 2014 23:27
-
-
Save burg/96da6776ecd974360e0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function processRecord(recordPayload, parentRecordPayload) | |
| { | |
| var startTime = recordPayload.startTime; | |
| var endTime = recordPayload.endTime; | |
| // COMPATIBILITY (iOS8): old versions use milliseconds since the epoch, rather | |
| // than seconds elapsed since timeline capturing started. We approximate the latter by | |
| // subtracting the start timestamp, as old versions did not use monotonic times. | |
| if (isNaN(this._legacyFirstRecordTimestamp)) | |
| this._legacyFirstRecordTimestamp = recordPayload.startTime; | |
| // If the record's start time sems unreasonably large, treat it as a legacy timestamp. | |
| if (startTime > WebInspector.StartTimeThresholdForLegacyRecordConversion) { | |
| startTime = (startTime - this._legacyFirstRecordTimestamp) / 1000; | |
| endTime = isNaN(endTime) ? NaN : (startTime - this._legacyFirstRecordTimestamp) / 1000; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment