summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-12-16 15:36:19 +0000
committerMoonchild <moonchild@palemoon.org>2020-12-16 15:36:19 +0000
commit8500ebf53216c6a637b98f5398208a70f1d15a8b (patch)
treec9df92a94c623914718960df98f6f5e58a30503c
parent408477a87aefbe3a972dfd66fcf907a09c4e7ac6 (diff)
parent0187d3e4e78fd565c6021f6397e53585b78000c4 (diff)
downloaduxp-8500ebf53216c6a637b98f5398208a70f1d15a8b.tar.gz
Merge pull request 'Reinstate the performance timing code removed in error' (#1698) from adesh/UXP:fix-performace-api into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1698
-rw-r--r--netwerk/base/nsLoadGroup.cpp13
-rw-r--r--netwerk/base/nsLoadGroup.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp
index c30f7ade8c..5f81cb091f 100644
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -107,6 +107,9 @@ nsLoadGroup::nsLoadGroup(nsISupports* outer)
, mStatus(NS_OK)
, mPriority(PRIORITY_NORMAL)
, mIsCanceling(false)
+ , mDefaultLoadIsTimed(false)
+ , mTimedRequests(0)
+ , mCachedRequests(0)
, mTimedNonCachedRequestsUntilOnEndPageLoad(0)
{
NS_INIT_AGGREGATED(outer);
@@ -427,6 +430,12 @@ nsLoadGroup::SetDefaultLoadRequest(nsIRequest *aRequest)
// in particular, nsIChannel::LOAD_DOCUMENT_URI...
//
mLoadFlags &= nsIRequest::LOAD_REQUESTMASK;
+
+ nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(aRequest);
+ mDefaultLoadIsTimed = timedChannel != nullptr;
+ if (mDefaultLoadIsTimed) {
+ timedChannel->SetTimingEnabled(true);
+ }
}
// Else, do not change the group's load flags (see bug 95981)
return NS_OK;
@@ -481,6 +490,10 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt)
if (mPriority != 0)
RescheduleRequest(request, mPriority);
+ nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(request);
+ if (timedChannel)
+ timedChannel->SetTimingEnabled(true);
+
if (!(flags & nsIRequest::LOAD_BACKGROUND)) {
// Update the count of foreground URIs..
mForegroundCount += 1;
diff --git a/netwerk/base/nsLoadGroup.h b/netwerk/base/nsLoadGroup.h
index 9b5e70868c..1af84977db 100644
--- a/netwerk/base/nsLoadGroup.h
+++ b/netwerk/base/nsLoadGroup.h
@@ -82,6 +82,10 @@ protected:
int32_t mPriority;
bool mIsCanceling;
+ bool mDefaultLoadIsTimed;
+ uint32_t mTimedRequests;
+ uint32_t mCachedRequests;
+
/* For nsPILoadGroupInternal */
uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad;
};