summaryrefslogtreecommitdiffstats
path: root/dom/performance
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 11:59:22 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 11:59:22 +0200
commitde9560af3e0e0d0dc93c5401c9b6ca2f0a173e36 (patch)
tree42fd41070c51eef1215a61bf44ed9f453366e2bb /dom/performance
parente040ed925030f899f845d458c226f7e439f4ec8b (diff)
downloadUXP-de9560af3e0e0d0dc93c5401c9b6ca2f0a173e36.tar
UXP-de9560af3e0e0d0dc93c5401c9b6ca2f0a173e36.tar.gz
UXP-de9560af3e0e0d0dc93c5401c9b6ca2f0a173e36.tar.lz
UXP-de9560af3e0e0d0dc93c5401c9b6ca2f0a173e36.tar.xz
UXP-de9560af3e0e0d0dc93c5401c9b6ca2f0a173e36.zip
Bug 1317297 - nextHopProtocol is an empty string for local fetch
https://hg.mozilla.org/mozilla-central/rev/9e5cd2bf4d66
Diffstat (limited to 'dom/performance')
-rw-r--r--dom/performance/PerformanceMainThread.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp
index 86d42c5f8..fa03408c6 100644
--- a/dom/performance/PerformanceMainThread.cpp
+++ b/dom/performance/PerformanceMainThread.cpp
@@ -6,6 +6,7 @@
#include "PerformanceMainThread.h"
#include "PerformanceNavigation.h"
+#include "nsICacheInfoChannel.h"
namespace mozilla {
namespace dom {
@@ -165,6 +166,17 @@ PerformanceMainThread::AddEntry(nsIHttpChannel* channel,
nsAutoCString protocol;
channel->GetProtocolVersion(protocol);
+
+ // If this is a local fetch, nextHopProtocol should be set to empty string.
+ nsCOMPtr<nsICacheInfoChannel> cachedChannel = do_QueryInterface(channel);
+ if (cachedChannel) {
+ bool isFromCache;
+ if (NS_SUCCEEDED(cachedChannel->IsFromCache(&isFromCache))
+ && isFromCache) {
+ protocol.Truncate();
+ }
+ }
+
performanceEntry->SetNextHopProtocol(NS_ConvertUTF8toUTF16(protocol));
uint64_t encodedBodySize = 0;