mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-26 09:18:37 +09:00
Bug 1317297 - nextHopProtocol is an empty string for local fetch
https://hg.mozilla.org/mozilla-central/rev/9e5cd2bf4d66
This commit is contained in:
parent
6885700c5b
commit
4e7b6e6d22
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue