DevTools - network - implement the secureConnectionStart property for the PerformanceTiming

https://github.com/MoonchildProductions/moebius/pull/116
("/testing" and "/toolkit" in in the previous commit)
This commit is contained in:
janekptacijarabaci 2018-03-01 11:52:50 +01:00 committed by Roy Tam
commit 54f2e6eafd
32 changed files with 263 additions and 13 deletions

View file

@ -732,7 +732,9 @@ NetworkMonitor.prototype = {
0x804b0004: "STATUS_CONNECTED_TO",
0x804b0005: "STATUS_SENDING_TO",
0x804b000a: "STATUS_WAITING_FOR",
0x804b0006: "STATUS_RECEIVING_FROM"
0x804b0006: "STATUS_RECEIVING_FROM",
0x804b000c: "STATUS_TLS_STARTING",
0x804b000d: "STATUS_TLS_ENDING"
},
httpDownloadActivities: [
@ -1406,6 +1408,7 @@ NetworkMonitor.prototype = {
timings: {
blocked: 0,
dns: 0,
ssl: 0,
connect: 0,
send: 0,
wait: 0,
@ -1440,6 +1443,36 @@ NetworkMonitor.prototype = {
harTimings.connect = -1;
}
if (timings.STATUS_TLS_STARTING && timings.STATUS_TLS_ENDING) {
harTimings.ssl = timings.STATUS_TLS_ENDING.last -
timings.STATUS_TLS_STARTING.first;
} else {
harTimings.ssl = -1;
}
// sometimes the connection information events are attached to a speculative
// channel instead of this one, but necko might glue them back together in the
// nsITimedChannel interface used by Resource and Navigation Timing
let timedChannel = httpActivity.channel.QueryInterface(Ci.nsITimedChannel);
if ((harTimings.connect <= 0) && timedChannel) {
if (timedChannel.secureConnectionStartTime > timedChannel.connectStartTime) {
harTimings.connect =
timedChannel.secureConnectionStartTime - timedChannel.connectStartTime;
harTimings.ssl =
timedChannel.connectEndTime - timedChannel.secureConnectionStartTime;
} else {
harTimings.connect =
timedChannel.connectEndTime - timedChannel.connectStartTime;
harTimings.ssl = -1;
}
}
if ((harTimings.dns <= 0) && timedChannel) {
harTimings.dns =
timedChannel.domainLookupEndTime - timedChannel.domainLookupStartTime;
}
if (timings.STATUS_SENDING_TO) {
harTimings.send = timings.STATUS_SENDING_TO.last - timings.STATUS_SENDING_TO.first;
} else if (timings.REQUEST_HEADER && timings.REQUEST_BODY_SENT) {