summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradesh <adeshk@hotmail.com>2020-12-16 06:31:28 -0500
committerMoonchild <moonchild@palemoon.org>2020-12-22 10:51:55 +0000
commit5a4a75c41857167ec8b8dc5a9ddd632f7f781024 (patch)
tree2b42b141eaaf5c8fc7f053ca80bb5d638ef92210
parent203be74ffe19ea3010e389cee32077ec6c7a173a (diff)
downloaduxp-5a4a75c41857167ec8b8dc5a9ddd632f7f781024.tar.gz
Issue #1697 - Reinstate the performance timing code removed in error.
This was a fallout from pull request #929.
-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 48d9a6621e..36ad4986b6 100644
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -108,6 +108,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);
@@ -428,6 +431,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;
@@ -482,6 +491,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;
};