diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-01 11:52:50 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-01 11:52:50 +0100 |
commit | 644e9db1092df1477b1facc52cd3ee45ebd13040 (patch) | |
tree | b126bae065184d0d39abee3fb9ba83a6c4ab7508 /devtools/shared/webconsole | |
parent | 228d252ab14f65f8433c8d53122a7d1e9429c23e (diff) | |
download | UXP-644e9db1092df1477b1facc52cd3ee45ebd13040.tar UXP-644e9db1092df1477b1facc52cd3ee45ebd13040.tar.gz UXP-644e9db1092df1477b1facc52cd3ee45ebd13040.tar.lz UXP-644e9db1092df1477b1facc52cd3ee45ebd13040.tar.xz UXP-644e9db1092df1477b1facc52cd3ee45ebd13040.zip |
DevTools - network - implement the secureConnectionStart property for the PerformanceTiming
https://github.com/MoonchildProductions/moebius/pull/116
("/testing" and "/toolkit" in in the previous commit)
Diffstat (limited to 'devtools/shared/webconsole')
-rw-r--r-- | devtools/shared/webconsole/network-monitor.js | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index 5416a7760..bda745520 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -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) { |