From 6480b95ba30e77d0582c4d91f296413273764a91 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 24 Jan 2018 17:17:31 +0100 Subject: [PATCH] Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug --- docshell/base/nsDocShell.cpp | 1 + docshell/base/nsPingListener.cpp | 1 + dom/base/EventSource.cpp | 2 ++ dom/base/Navigator.cpp | 1 + dom/base/nsDocument.cpp | 1 + dom/base/nsObjectLoadingContent.cpp | 1 + dom/base/nsSyncLoadService.cpp | 1 + dom/fetch/Fetch.cpp | 8 +++-- dom/fetch/FetchDriver.cpp | 12 +++++-- dom/fetch/FetchDriver.h | 6 ++++ dom/html/HTMLMediaElement.cpp | 1 + dom/html/HTMLTrackElement.cpp | 1 + dom/html/nsHTMLDocument.cpp | 1 + dom/media/ChannelMediaResource.cpp | 1 + dom/performance/PerformanceStorage.h | 34 +++++++++++++++++++ dom/performance/moz.build | 1 + dom/plugins/base/nsPluginHost.cpp | 1 + dom/script/ScriptLoader.cpp | 1 + dom/security/nsCSPContext.cpp | 2 ++ dom/webbrowserpersist/nsWebBrowserPersist.cpp | 1 + dom/workers/ScriptLoader.cpp | 17 ++++++++-- dom/workers/ServiceWorkerScriptCache.cpp | 5 ++- dom/workers/WorkerPrivate.cpp | 8 +++++ dom/workers/WorkerPrivate.h | 4 +++ dom/xbl/nsXBLService.cpp | 2 ++ dom/xhr/XMLHttpRequestMainThread.cpp | 3 ++ dom/xhr/XMLHttpRequestMainThread.h | 7 +++- dom/xhr/XMLHttpRequestWorker.cpp | 3 +- dom/xml/XMLDocument.cpp | 1 + dom/xslt/base/txURIUtils.cpp | 1 + dom/xslt/xslt/txMozillaStylesheetCompiler.cpp | 1 + dom/xul/XULDocument.cpp | 1 + .../pref/autoconfig/src/nsAutoConfig.cpp | 1 + image/imgLoader.cpp | 2 ++ js/xpconnect/loader/mozJSComponentLoader.cpp | 1 + js/xpconnect/loader/mozJSSubScriptLoader.cpp | 2 ++ layout/style/FontFaceSet.cpp | 1 + layout/style/Loader.cpp | 2 ++ modules/libjar/nsJARChannel.cpp | 1 + netwerk/base/LoadInfo.cpp | 14 ++++++++ netwerk/base/LoadInfo.h | 2 ++ netwerk/base/Predictor.cpp | 1 + netwerk/base/nsILoadInfo.idl | 16 +++++++++ netwerk/base/nsIncrementalDownload.cpp | 1 + netwerk/base/nsNetUtil.cpp | 32 +++++++++++++++++ netwerk/base/nsNetUtil.h | 9 +++++ netwerk/base/nsPACMan.cpp | 1 + netwerk/protocol/ftp/FTPChannelParent.cpp | 2 +- netwerk/protocol/http/HttpChannelChild.cpp | 1 + netwerk/protocol/http/HttpChannelParent.cpp | 2 +- .../protocol/http/InterceptedHttpChannel.cpp | 2 ++ netwerk/protocol/http/nsCORSListenerProxy.cpp | 1 + netwerk/protocol/http/nsHttpChannel.cpp | 3 ++ .../protocol/wyciwyg/WyciwygChannelParent.cpp | 1 + rdf/base/nsRDFXMLDataSource.cpp | 1 + .../nsUrlClassifierDBService.cpp | 1 + .../nsUrlClassifierStreamUpdater.cpp | 1 + uriloader/prefetch/nsOfflineCacheUpdate.cpp | 2 ++ uriloader/prefetch/nsPrefetchService.cpp | 1 + .../directory/nsDirectoryViewer.cpp | 1 + 60 files changed, 224 insertions(+), 12 deletions(-) create mode 100644 dom/performance/PerformanceStorage.h diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 46d3baac34b8..749466567ac4 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -10680,6 +10680,7 @@ nsDocShell::DoURILoad(nsIURI* aURI, rv = NS_NewChannelInternal(getter_AddRefs(channel), aURI, loadInfo, + nullptr, // PerformanceStorage nullptr, // loadGroup static_cast(this), loadFlags); diff --git a/docshell/base/nsPingListener.cpp b/docshell/base/nsPingListener.cpp index 904a9cb590cc..69d712eb5545 100644 --- a/docshell/base/nsPingListener.cpp +++ b/docshell/base/nsPingListener.cpp @@ -109,6 +109,7 @@ SendPing(void* aClosure, nsIContent* aContent, nsIURI* aURI, ? nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED : nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_PING, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, // aLoadFlags, diff --git a/dom/base/EventSource.cpp b/dom/base/EventSource.cpp index 220436a9c6e6..99cd847074e4 100644 --- a/dom/base/EventSource.cpp +++ b/dom/base/EventSource.cpp @@ -1036,6 +1036,7 @@ EventSourceImpl::InitChannelAndRequestEventSource() doc, securityFlags, nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks loadFlags); // aLoadFlags @@ -1046,6 +1047,7 @@ EventSourceImpl::InitChannelAndRequestEventSource() mPrincipal, securityFlags, nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE, + nullptr, // aPerformanceStorage nullptr, // loadGroup nullptr, // aCallbacks loadFlags); // aLoadFlags diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 84d8b930d598..d81ea94fe333 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -1156,6 +1156,7 @@ Navigator::SendBeaconInternal(const nsAString& aUrl, doc, securityFlags, nsIContentPolicy::TYPE_BEACON, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks loadFlags); diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 10c1f7a2a713..bb3ac40e15a9 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1191,6 +1191,7 @@ nsExternalResourceMap::PendingLoad::StartLoad(nsIURI* aURI, aRequestingNode, nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage loadGroup); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index d745bafbc61a..9b45da764fe6 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -2509,6 +2509,7 @@ nsObjectLoadingContent::OpenChannel() thisContent, securityFlags, contentPolicyType, + nullptr, // aPerformanceStorage group, // aLoadGroup shim, // aCallbacks nsIChannel::LOAD_CALL_CONTENT_SNIFFERS | diff --git a/dom/base/nsSyncLoadService.cpp b/dom/base/nsSyncLoadService.cpp index 11b057197d9f..3eefd9634d04 100644 --- a/dom/base/nsSyncLoadService.cpp +++ b/dom/base/nsSyncLoadService.cpp @@ -321,6 +321,7 @@ nsSyncLoadService::LoadDocument(nsIURI *aURI, aLoaderPrincipal, aSecurityFlags, aContentPolicyType, + nullptr, // PerformanceStorage aLoadGroup); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp index a7ce142773aa..267821d75243 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -426,7 +426,9 @@ public: // We don't track if a worker is spawned from a tracking script for now, // so pass false as the last argument to FetchDriver(). fetch = new FetchDriver(mRequest, principal, loadGroup, - workerPrivate->MainThreadEventTarget(), false); + workerPrivate->MainThreadEventTarget(), + workerPrivate->GetPerformanceStorage(), + false); nsAutoCString spec; if (proxy->GetWorkerPrivate()->GetBaseURI()) { proxy->GetWorkerPrivate()->GetBaseURI()->GetAsciiSpec(spec); @@ -530,7 +532,9 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput, new MainThreadFetchResolver(p, observer, signal, request->MozErrors()); RefPtr fetch = new FetchDriver(r, principal, loadGroup, - aGlobal->EventTargetFor(TaskCategory::Other), isTrackingFetch); + aGlobal->EventTargetFor(TaskCategory::Other), + nullptr, // PerformanceStorage + isTrackingFetch); fetch->SetDocument(doc); resolver->SetLoadGroup(loadGroup); aRv = fetch->Fetch(signal, resolver); diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 2ec94abe1f6f..6e7c01122724 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -31,6 +31,7 @@ #include "nsHttpChannel.h" #include "mozilla/dom/File.h" +#include "mozilla/dom/PerformanceStorage.h" #include "mozilla/dom/workers/Workers.h" #include "mozilla/EventStateManager.h" #include "mozilla/ipc/PBackgroundSharedTypes.h" @@ -325,13 +326,17 @@ NS_IMPL_ISUPPORTS(FetchDriver, nsIStreamListener, nsIChannelEventSink, nsIInterfaceRequestor, nsIThreadRetargetableStreamListener) -FetchDriver::FetchDriver(InternalRequest* aRequest, nsIPrincipal* aPrincipal, - nsILoadGroup* aLoadGroup, nsIEventTarget* aMainThreadEventTarget, +FetchDriver::FetchDriver(InternalRequest* aRequest, + nsIPrincipal* aPrincipal, + nsILoadGroup* aLoadGroup, + nsIEventTarget* aMainThreadEventTarget, + PerformanceStorage* aPerformanceStorage, bool aIsTrackingFetch) : mPrincipal(aPrincipal) , mLoadGroup(aLoadGroup) , mRequest(aRequest) , mMainThreadEventTarget(aMainThreadEventTarget) + , mPerformanceStorage(aPerformanceStorage) , mNeedToObserveOnDataAvailable(false) , mIsTrackingFetch(aIsTrackingFetch) #ifdef DEBUG @@ -516,6 +521,7 @@ FetchDriver::HttpFetch(const nsACString& aPreferredAlternativeDataType) mDocument, secFlags, mRequest->ContentPolicyType(), + nullptr, /* aPerformanceStorage */ mLoadGroup, nullptr, /* aCallbacks */ loadFlags, @@ -528,6 +534,7 @@ FetchDriver::HttpFetch(const nsACString& aPreferredAlternativeDataType) mController, secFlags, mRequest->ContentPolicyType(), + mPerformanceStorage, mLoadGroup, nullptr, /* aCallbacks */ loadFlags, @@ -538,6 +545,7 @@ FetchDriver::HttpFetch(const nsACString& aPreferredAlternativeDataType) mPrincipal, secFlags, mRequest->ContentPolicyType(), + mPerformanceStorage, mLoadGroup, nullptr, /* aCallbacks */ loadFlags, diff --git a/dom/fetch/FetchDriver.h b/dom/fetch/FetchDriver.h index da52887817e6..64d01093e03a 100644 --- a/dom/fetch/FetchDriver.h +++ b/dom/fetch/FetchDriver.h @@ -32,6 +32,7 @@ namespace dom { class InternalRequest; class InternalResponse; +class PerformanceStorage; /** * Provides callbacks to be called when response is available or on error. @@ -109,6 +110,7 @@ public: nsIPrincipal* aPrincipal, nsILoadGroup* aLoadGroup, nsIEventTarget* aMainThreadEventTarget, + PerformanceStorage* aPerformanceStorage, bool aIsTrackingFetch); nsresult Fetch(AbortSignal* aSignal, @@ -147,6 +149,10 @@ private: nsCOMPtr mChannel; nsAutoPtr mSRIDataVerifier; nsCOMPtr mMainThreadEventTarget; + + // This is set only when Fetch is used in workers. + RefPtr mPerformanceStorage; + SRIMetadata mSRIMetadata; nsCString mWorkerScript; diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 173a865e19ca..e319fbcac73c 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -1218,6 +1218,7 @@ public: triggeringPrincipal, securityFlags, contentPolicyType, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE_IF_BUSY | diff --git a/dom/html/HTMLTrackElement.cpp b/dom/html/HTMLTrackElement.cpp index 08a6c0f334d3..aa57ecce16ad 100644 --- a/dom/html/HTMLTrackElement.cpp +++ b/dom/html/HTMLTrackElement.cpp @@ -327,6 +327,7 @@ HTMLTrackElement::LoadResource() static_cast(this), secFlags, nsIContentPolicy::TYPE_INTERNAL_TRACK, + nullptr, // PerformanceStorage loadGroup, nullptr, // aCallbacks nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI); diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 5451b414996b..a80b3d214018 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -1630,6 +1630,7 @@ nsHTMLDocument::Open(JSContext* cx, callerDoc, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage group); if (aError.Failed()) { diff --git a/dom/media/ChannelMediaResource.cpp b/dom/media/ChannelMediaResource.cpp index f0e2dd94c249..8d2dea753e0c 100644 --- a/dom/media/ChannelMediaResource.cpp +++ b/dom/media/ChannelMediaResource.cpp @@ -726,6 +726,7 @@ ChannelMediaResource::RecreateChannel() triggeringPrincipal, securityFlags, contentPolicyType, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks loadFlags); diff --git a/dom/performance/PerformanceStorage.h b/dom/performance/PerformanceStorage.h new file mode 100644 index 000000000000..7ef1913a0d25 --- /dev/null +++ b/dom/performance/PerformanceStorage.h @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_PerformanceStorage_h +#define mozilla_dom_PerformanceStorage_h + +#include "nsISupportsImpl.h" + +class nsIHttpChannel; +class nsITimedChannel; + +namespace mozilla { +namespace dom { + +class PerformanceStorage +{ +public: + NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING + + virtual void AddEntry(nsIHttpChannel* aChannel, + nsITimedChannel* aTimedChannel) = 0; + + +protected: + virtual ~PerformanceStorage() {} +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_PerformanceStorage_h diff --git a/dom/performance/moz.build b/dom/performance/moz.build index 53053f3b1f01..a273e50f8fb4 100644 --- a/dom/performance/moz.build +++ b/dom/performance/moz.build @@ -18,6 +18,7 @@ EXPORTS.mozilla.dom += [ 'PerformanceObserverEntryList.h', 'PerformanceResourceTiming.h', 'PerformanceService.h', + 'PerformanceStorage.h', 'PerformanceTiming.h', ] diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index b64b6206a51e..17ac79f6e382 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -3173,6 +3173,7 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL, nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS | nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OBJECT_SUBREQUEST, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup listenerPeer, nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI | diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 75f6f8eb68e5..15e7912d779c 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -1065,6 +1065,7 @@ ScriptLoader::StartLoad(ScriptLoadRequest* aRequest) aRequest->mTriggeringPrincipal, securityFlags, contentPolicyType, + nullptr, // aPerformanceStorage loadGroup, prompter, nsIRequest::LOAD_NORMAL | diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index ce95cbd6812d..e6d847d33e45 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -1073,6 +1073,7 @@ nsCSPContext::SendReports( doc, nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_CSP_REPORT, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks loadFlags); @@ -1083,6 +1084,7 @@ nsCSPContext::SendReports( mLoadingPrincipal, nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_CSP_REPORT, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks loadFlags); diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.cpp b/dom/webbrowserpersist/nsWebBrowserPersist.cpp index a67187397811..b13634a60d1b 100644 --- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp +++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp @@ -1364,6 +1364,7 @@ nsresult nsWebBrowserPersist::SaveURIInternal( nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup static_cast(this), loadFlags); diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index fe3a2c566d3c..c36c4d9b051b 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -57,6 +57,7 @@ #include "mozilla/dom/InternalResponse.h" #include "mozilla/dom/nsCSPService.h" #include "mozilla/dom/nsCSPUtils.h" +#include "mozilla/dom/PerformanceStorage.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/PromiseNativeHandler.h" #include "mozilla/dom/Response.h" @@ -110,6 +111,7 @@ nsresult ChannelFromScriptURL(nsIPrincipal* principal, nsIURI* baseURI, nsIDocument* parentDoc, + WorkerPrivate* aWorkerPrivate, nsILoadGroup* loadGroup, nsIIOService* ios, nsIScriptSecurityManager* secMan, @@ -190,6 +192,7 @@ ChannelFromScriptURL(nsIPrincipal* principal, parentDoc, secFlags, contentPolicyType, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks aLoadFlags, @@ -200,6 +203,11 @@ ChannelFromScriptURL(nsIPrincipal* principal, MOZ_ASSERT(loadGroup); MOZ_ASSERT(NS_LoadGroupMatchesPrincipal(loadGroup, principal)); + RefPtr performanceStorage; + if (aWorkerPrivate && !aIsMainScript) { + performanceStorage = aWorkerPrivate->GetPerformanceStorage(); + } + if (aClientInfo.isSome()) { rv = NS_NewChannel(getter_AddRefs(channel), uri, @@ -208,6 +216,7 @@ ChannelFromScriptURL(nsIPrincipal* principal, aController, secFlags, contentPolicyType, + performanceStorage, loadGroup, nullptr, // aCallbacks aLoadFlags, @@ -218,6 +227,7 @@ ChannelFromScriptURL(nsIPrincipal* principal, principal, secFlags, contentPolicyType, + performanceStorage, loadGroup, nullptr, // aCallbacks aLoadFlags, @@ -991,7 +1001,8 @@ private: // Only top level workers' main script use the document charset for the // script uri encoding. Otherwise, default encoding (UTF-8) is applied. bool useDefaultEncoding = !(!parentWorker && IsMainWorkerScript()); - rv = ChannelFromScriptURL(principal, baseURI, parentDoc, loadGroup, ios, + rv = ChannelFromScriptURL(principal, baseURI, parentDoc, mWorkerPrivate, + loadGroup, ios, secMan, loadInfo.mURL, mClientInfo, mController, IsMainWorkerScript(), @@ -2266,8 +2277,8 @@ ChannelFromScriptURLMainThread(nsIPrincipal* aPrincipal, nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager(); NS_ASSERTION(secMan, "This should never be null!"); - return ChannelFromScriptURL(aPrincipal, aBaseURI, aParentDoc, aLoadGroup, - ios, secMan, aScriptURL, aClientInfo, + return ChannelFromScriptURL(aPrincipal, aBaseURI, aParentDoc, nullptr, + aLoadGroup, ios, secMan, aScriptURL, aClientInfo, Maybe(), true, WorkerScript, aMainScriptContentPolicyType, nsIRequest::LOAD_NORMAL, aDefaultURIEncoding, diff --git a/dom/workers/ServiceWorkerScriptCache.cpp b/dom/workers/ServiceWorkerScriptCache.cpp index f5829d029410..fa161b890117 100644 --- a/dom/workers/ServiceWorkerScriptCache.cpp +++ b/dom/workers/ServiceWorkerScriptCache.cpp @@ -730,7 +730,10 @@ CompareNetwork::Initialize(nsIPrincipal* aPrincipal, // use the TYPE_INTERNAL_SCRIPT content policy types when loading a service // worker. rv = NS_NewChannel(getter_AddRefs(mChannel), uri, aPrincipal, secFlags, - contentPolicyType, loadGroup, nullptr /* aCallbacks */, + contentPolicyType, + nullptr, /* aPerformanceStorage */ + loadGroup, + nullptr /* aCallbacks */, mLoadFlags); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 7d63f0b1cc8a..4e378d2f4200 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -7199,6 +7199,14 @@ WorkerPrivate::DumpCrashInformation(nsACString& aString) } } +PerformanceStorage* +WorkerPrivate::GetPerformanceStorage() +{ + AssertIsOnMainThread(); + // TODO + return nullptr; +} + NS_IMPL_ISUPPORTS_INHERITED0(ExternalRunnableWrapper, WorkerRunnable) template diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index 45feafb4c11d..72915eb39e1e 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -68,6 +68,7 @@ class ClientSource; class Function; class MessagePort; class MessagePortIdentifier; +class PerformanceStorage; class PromiseNativeHandler; class StructuredCloneHolder; class WorkerDebuggerGlobalScope; @@ -1512,6 +1513,9 @@ public: void ExecutionReady(); + PerformanceStorage* + GetPerformanceStorage(); + private: WorkerPrivate(WorkerPrivate* aParent, const nsAString& aScriptURL, bool aIsChromeWorker, diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp index e93c78113a5a..6c8e8dd47b94 100644 --- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -1112,6 +1112,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS | nsILoadInfo::SEC_ALLOW_CHROME, nsIContentPolicy::TYPE_XBL, + nullptr, // aPerformanceStorage loadGroup); } else { @@ -1120,6 +1121,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS, nsIContentPolicy::TYPE_XBL, + nullptr, // PerformanceStorage loadGroup); } NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp index b437d9f65d5d..e59df916b38c 100644 --- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -2508,6 +2508,7 @@ XMLHttpRequestMainThread::CreateChannel() responsibleDocument, secFlags, nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks loadFlags); @@ -2519,6 +2520,7 @@ XMLHttpRequestMainThread::CreateChannel() mController, secFlags, nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST, + mPerformanceStorage, // aPerformanceStorage loadGroup, nullptr, // aCallbacks loadFlags); @@ -2529,6 +2531,7 @@ XMLHttpRequestMainThread::CreateChannel() mPrincipal, secFlags, nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST, + mPerformanceStorage, // aPerformanceStorage loadGroup, nullptr, // aCallbacks loadFlags); diff --git a/dom/xhr/XMLHttpRequestMainThread.h b/dom/xhr/XMLHttpRequestMainThread.h index ade4291c2241..8cd2495a8b20 100644 --- a/dom/xhr/XMLHttpRequestMainThread.h +++ b/dom/xhr/XMLHttpRequestMainThread.h @@ -41,6 +41,7 @@ #include "mozilla/dom/TypedArray.h" #include "mozilla/dom/File.h" #include "mozilla/dom/FormData.h" +#include "mozilla/dom/PerformanceStorage.h" #include "mozilla/dom/ServiceWorkerDescriptor.h" #include "mozilla/dom/URLSearchParams.h" #include "mozilla/dom/XMLHttpRequest.h" @@ -201,7 +202,8 @@ public: void Construct(nsIPrincipal* aPrincipal, nsIGlobalObject* aGlobalObject, nsIURI* aBaseURI = nullptr, - nsILoadGroup* aLoadGroup = nullptr) + nsILoadGroup* aLoadGroup = nullptr, + PerformanceStorage* aPerformanceStorage = nullptr) { MOZ_ASSERT(aPrincipal); nsCOMPtr win = do_QueryInterface(aGlobalObject); @@ -214,6 +216,7 @@ public: BindToOwner(aGlobalObject); mBaseURI = aBaseURI; mLoadGroup = aLoadGroup; + mPerformanceStorage = aPerformanceStorage; } void InitParameters(bool aAnon, bool aSystem); @@ -588,6 +591,8 @@ protected: nsCOMPtr mXMLParserStreamListener; + RefPtr mPerformanceStorage; + // used to implement getAllResponseHeaders() class nsHeaderVisitor : public nsIHttpHeaderVisitor { diff --git a/dom/xhr/XMLHttpRequestWorker.cpp b/dom/xhr/XMLHttpRequestWorker.cpp index 6ce37c4cac9b..9f134b1c4d4f 100644 --- a/dom/xhr/XMLHttpRequestWorker.cpp +++ b/dom/xhr/XMLHttpRequestWorker.cpp @@ -873,7 +873,8 @@ Proxy::Init() mXHR = new XMLHttpRequestMainThread(); mXHR->Construct(mWorkerPrivate->GetPrincipal(), global, mWorkerPrivate->GetBaseURI(), - mWorkerPrivate->GetLoadGroup()); + mWorkerPrivate->GetLoadGroup(), + mWorkerPrivate->GetPerformanceStorage()); mXHR->SetParameters(mMozAnon, mMozSystem); mXHR->SetClientInfoAndController(mClientInfo, mController); diff --git a/dom/xml/XMLDocument.cpp b/dom/xml/XMLDocument.cpp index ad3b82536554..0a80748ea1b7 100644 --- a/dom/xml/XMLDocument.cpp +++ b/dom/xml/XMLDocument.cpp @@ -433,6 +433,7 @@ XMLDocument::Load(const nsAString& aUrl, CallerType aCallerType, static_cast(this), nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED, nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST, + nullptr, // aPerformanceStorage loadGroup, req, nsIRequest::LOAD_BACKGROUND); diff --git a/dom/xslt/base/txURIUtils.cpp b/dom/xslt/base/txURIUtils.cpp index 3f3556f80110..d86c83a8bab6 100644 --- a/dom/xslt/base/txURIUtils.cpp +++ b/dom/xslt/base/txURIUtils.cpp @@ -58,6 +58,7 @@ URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsINode *aSourceNode) sourceDoc, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks nsIChannel::LOAD_BYPASS_SERVICE_WORKER); diff --git a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp index 6c98330db99b..c983c67168a5 100644 --- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp +++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp @@ -455,6 +455,7 @@ txCompileObserver::startLoad(nsIURI* aUri, txStylesheetCompiler* aCompiler, aReferrerPrincipal, // triggeringPrincipal nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS, nsIContentPolicy::TYPE_XSLT, + nullptr, // aPerformanceStorage loadGroup); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp index d776baac8621..f982c91265df 100644 --- a/dom/xul/XULDocument.cpp +++ b/dom/xul/XULDocument.cpp @@ -2446,6 +2446,7 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS | nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage group); if (NS_SUCCEEDED(rv)) { diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index a723aef93ce3..4cd9ead80745 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -297,6 +297,7 @@ nsresult nsAutoConfig::downloadAutoConfig() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::INHIBIT_PERSISTENT_CACHING | diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index 41eab37de171..d766a6706a63 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -806,6 +806,7 @@ NewImageChannel(nsIChannel** aResult, aTriggeringPrincipal, securityFlags, aPolicyType, + nullptr, // PerformanceStorage nullptr, // loadGroup callbacks, aLoadFlags); @@ -837,6 +838,7 @@ NewImageChannel(nsIChannel** aResult, nsContentUtils::GetSystemPrincipal(), securityFlags, aPolicyType, + nullptr, // PerformanceStorage nullptr, // loadGroup callbacks, aLoadFlags); diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 95a0fc448149..370078a2d90b 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -256,6 +256,7 @@ class MOZ_STACK_CLASS ComponentLoaderInfo { nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_SCRIPT, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp index cf0f5611ea04..dd4c879ec5f8 100644 --- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp +++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp @@ -467,6 +467,7 @@ mozJSSubScriptLoader::ReadScriptAsync(nsIURI* uri, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, @@ -517,6 +518,7 @@ mozJSSubScriptLoader::ReadScript(nsIURI* uri, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index c866db260112..fb004ccf8888 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -657,6 +657,7 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry, principal ? principal->get() : nullptr, nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS, nsIContentPolicy::TYPE_FONT, + nullptr, // PerformanceStorage loadGroup); NS_ENSURE_SUCCESS(rv, rv); diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 2dea50c85857..adc2dca4f787 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1510,6 +1510,7 @@ Loader::LoadSheet(SheetLoadData* aLoadData, aLoadData->mLoaderPrincipal, securityFlags, contentPolicyType, + nullptr, // Performancestorage loadGroup, nullptr, // aCallbacks nsIChannel::LOAD_NORMAL | @@ -1525,6 +1526,7 @@ Loader::LoadSheet(SheetLoadData* aLoadData, nsContentUtils::GetSystemPrincipal(), securityFlags, contentPolicyType, + nullptr, // aPerformanceStorage loadGroup, nullptr, // aCallbacks nsIChannel::LOAD_NORMAL | diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index cdd2dd884345..24a9c4ac407a 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -816,6 +816,7 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) rv = NS_NewChannelInternal(getter_AddRefs(channel), mJarBaseURI, mLoadInfo, + nullptr, // PerformanceStorage mLoadGroup, mCallbacks, loadFlags); diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp index 1e07a4092a53..b2dfe2315b46 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -9,6 +9,7 @@ #include "mozilla/Assertions.h" #include "mozilla/dom/ClientIPCTypes.h" #include "mozilla/dom/ClientSource.h" +#include "mozilla/dom/PerformanceStorage.h" #include "mozilla/dom/TabChild.h" #include "mozilla/dom/ToJSValue.h" #include "mozIThirdPartyUtil.h" @@ -333,6 +334,7 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) // mReservedClientInfo must be handled specially during redirect // mInitialClientInfo must be handled specially during redirect , mController(rhs.mController) + , mPerformanceStorage(rhs.mPerformanceStorage) , mLoadingContext(rhs.mLoadingContext) , mContextForTopLevelLoad(rhs.mContextForTopLevelLoad) , mSecurityFlags(rhs.mSecurityFlags) @@ -1246,5 +1248,17 @@ LoadInfo::GetController() return mController; } +void +LoadInfo::SetPerformanceStorage(PerformanceStorage* aPerformanceStorage) +{ + mPerformanceStorage = aPerformanceStorage; +} + +PerformanceStorage* +LoadInfo::GetPerformanceStorage() +{ + return mPerformanceStorage; +} + } // namespace net } // namespace mozilla diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h index f2276072c5b6..269c6ce53a30 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h @@ -24,6 +24,7 @@ class nsPIDOMWindowOuter; namespace mozilla { namespace dom { +class PerformanceStorage; class XMLHttpRequestMainThread; } @@ -166,6 +167,7 @@ private: Maybe mReservedClientInfo; Maybe mInitialClientInfo; Maybe mController; + RefPtr mPerformanceStorage; nsWeakPtr mLoadingContext; nsWeakPtr mContextForTopLevelLoad; diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index a832798d081b..d271b60e5798 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -1449,6 +1449,7 @@ Predictor::Prefetch(nsIURI *uri, nsIURI *referrer, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, /* aPerformanceStorage */ nullptr, /* aLoadGroup */ nullptr, /* aCallbacks */ nsIRequest::LOAD_BACKGROUND); diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl index dd1318d65e88..87cefe52b8e4 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl @@ -24,6 +24,7 @@ namespace mozilla { namespace dom { class ClientInfo; class ClientSource; +class PerformanceStorage; class ServiceWorkerDescriptor; } // namespace dom } // namespace mozilla @@ -41,6 +42,7 @@ native OriginAttributes(mozilla::OriginAttributes); [ref] native const_MaybeClientInfoRef(const mozilla::Maybe); [ref] native const_ServiceWorkerDescriptorRef(const mozilla::dom::ServiceWorkerDescriptor); [ref] native const_MaybeServiceWorkerDescriptorRef(const mozilla::Maybe); +[ptr] native PerformanceStoragePtr(mozilla::dom::PerformanceStorage); typedef unsigned long nsSecurityFlags; @@ -924,4 +926,18 @@ interface nsILoadInfo : nsISupports */ [noscript, nostdcall, notxpcom] const_MaybeServiceWorkerDescriptorRef GetController(); + + /** + * Set a custom performance storage. This is meant to be executed only for + * workers. If a PerformanceStorage is not set, the loadingDocument->Window + * Performance object will be used instead. + */ + [noscript, nostdcall, notxpcom] + void SetPerformanceStorage(in PerformanceStoragePtr aPerformanceStorage); + + /** + * Get the PerformanceStorage. + */ + [noscript, nostdcall, notxpcom] + PerformanceStoragePtr GetPerformanceStorage(); }; diff --git a/netwerk/base/nsIncrementalDownload.cpp b/netwerk/base/nsIncrementalDownload.cpp index 8c947aecd19e..4aa2423e066a 100644 --- a/netwerk/base/nsIncrementalDownload.cpp +++ b/netwerk/base/nsIncrementalDownload.cpp @@ -250,6 +250,7 @@ nsIncrementalDownload::ProcessTimeout() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage nullptr, // loadGroup this, // aCallbacks mLoadFlags); diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index c2a0a6055803..3b1ee98a54e5 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -83,6 +83,7 @@ using namespace mozilla; using namespace mozilla::net; using mozilla::dom::ClientInfo; +using mozilla::dom::PerformanceStorage; using mozilla::dom::ServiceWorkerDescriptor; #define DEFAULT_RP 3 @@ -164,6 +165,7 @@ nsresult NS_NewChannelInternal(nsIChannel **outChannel, nsIURI *aUri, nsILoadInfo *aLoadInfo, + PerformanceStorage *aPerformanceStorage /* = nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -209,6 +211,14 @@ NS_NewChannelInternal(nsIChannel **outChannel, NS_ENSURE_SUCCESS(rv, rv); } + if (aPerformanceStorage) { + nsCOMPtr loadInfo; + rv = channel->GetLoadInfo(getter_AddRefs(loadInfo)); + NS_ENSURE_SUCCESS(rv, rv); + + loadInfo->SetPerformanceStorage(aPerformanceStorage); + } + channel.forget(outChannel); return NS_OK; } @@ -269,6 +279,7 @@ NS_NewChannel(nsIChannel **outChannel, nsIPrincipal *aLoadingPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -283,6 +294,7 @@ NS_NewChannel(nsIChannel **outChannel, Maybe(), aSecurityFlags, aContentPolicyType, + aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, @@ -297,6 +309,7 @@ NS_NewChannel(nsIChannel **outChannel, const Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -318,6 +331,7 @@ NS_NewChannel(nsIChannel **outChannel, aController, aSecurityFlags, aContentPolicyType, + aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, @@ -334,6 +348,7 @@ NS_NewChannelInternal(nsIChannel **outChannel, const Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -385,6 +400,14 @@ NS_NewChannelInternal(nsIChannel **outChannel, NS_ENSURE_SUCCESS(rv, rv); } + if (aPerformanceStorage) { + nsCOMPtr loadInfo; + rv = channel->GetLoadInfo(getter_AddRefs(loadInfo)); + NS_ENSURE_SUCCESS(rv, rv); + + loadInfo->SetPerformanceStorage(aPerformanceStorage); + } + channel.forget(outChannel); return NS_OK; } @@ -396,6 +419,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* = nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -412,6 +436,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, Maybe(), aSecurityFlags, aContentPolicyType, + aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, @@ -426,6 +451,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* = nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -441,6 +467,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, Maybe(), aSecurityFlags, aContentPolicyType, + aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, @@ -457,6 +484,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, const Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* = nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -478,6 +506,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, aController, aSecurityFlags, aContentPolicyType, + aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, @@ -490,6 +519,7 @@ NS_NewChannel(nsIChannel **outChannel, nsINode *aLoadingNode, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + PerformanceStorage *aPerformanceStorage /* = nullptr */, nsILoadGroup *aLoadGroup /* = nullptr */, nsIInterfaceRequestor *aCallbacks /* = nullptr */, nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */, @@ -505,6 +535,7 @@ NS_NewChannel(nsIChannel **outChannel, Maybe(), aSecurityFlags, aContentPolicyType, + aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, @@ -1036,6 +1067,7 @@ NS_NewStreamLoaderInternal(nsIStreamLoader **outStream, Maybe(), aSecurityFlags, aContentPolicyType, + nullptr, // PerformanceStorage aLoadGroup, aCallbacks, aLoadFlags); diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index 2a6d0f38dfd5..f0f1f1479b69 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -58,6 +58,7 @@ class Encoding; class OriginAttributes; namespace dom { class ClientInfo; +class PerformanceStorage; class ServiceWorkerDescriptor; } // namespace dom } // namespace mozilla @@ -159,6 +160,7 @@ nsresult NS_NewChannelInternal(nsIChannel **outChannel, const mozilla::Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -168,6 +170,7 @@ nsresult NS_NewChannelInternal(nsIChannel **outChannel, nsresult NS_NewChannelInternal(nsIChannel **outChannel, nsIURI *aUri, nsILoadInfo *aLoadInfo, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -181,6 +184,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -194,6 +198,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -209,6 +214,7 @@ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, const mozilla::Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -222,6 +228,7 @@ NS_NewChannel(nsIChannel **outChannel, nsINode *aLoadingNode, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -234,6 +241,7 @@ NS_NewChannel(nsIChannel **outChannel, nsIPrincipal *aLoadingPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup *aLoadGroup = nullptr, nsIInterfaceRequestor *aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -248,6 +256,7 @@ NS_NewChannel(nsIChannel** outChannel, const mozilla::Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, + mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr, nsILoadGroup* aLoadGroup = nullptr, nsIInterfaceRequestor* aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, diff --git a/netwerk/base/nsPACMan.cpp b/netwerk/base/nsPACMan.cpp index fbcceeed7ae6..effcf5ac96f3 100644 --- a/netwerk/base/nsPACMan.cpp +++ b/netwerk/base/nsPACMan.cpp @@ -499,6 +499,7 @@ nsPACMan::StartLoading() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage, nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/netwerk/protocol/ftp/FTPChannelParent.cpp b/netwerk/protocol/ftp/FTPChannelParent.cpp index b88c98fb51be..87829a76320a 100644 --- a/netwerk/protocol/ftp/FTPChannelParent.cpp +++ b/netwerk/protocol/ftp/FTPChannelParent.cpp @@ -152,7 +152,7 @@ FTPChannelParent::DoAsyncOpen(const URIParams& aURI, nsCOMPtr chan; rv = NS_NewChannelInternal(getter_AddRefs(chan), uri, loadInfo, - nullptr, nullptr, + nullptr, nullptr, nullptr, nsIRequest::LOAD_NORMAL, ios); if (NS_FAILED(rv)) diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 141a3fee1b33..577edea40357 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -1709,6 +1709,7 @@ HttpChannelChild::SetupRedirect(nsIURI* uri, rv = NS_NewChannelInternal(getter_AddRefs(newChannel), uri, redirectLoadInfo, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index bac8df4b9330..59cf1e1ad848 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -526,7 +526,7 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI, nsCOMPtr channel; rv = NS_NewChannelInternal(getter_AddRefs(channel), uri, loadInfo, - nullptr, nullptr, aLoadFlags, ios); + nullptr, nullptr, nullptr, aLoadFlags, ios); if (NS_FAILED(rv)) { return SendFailedAsyncOpen(rv); } diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp index 89bf9f0df6ac..a991f2547d20 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp @@ -212,6 +212,7 @@ InterceptedHttpChannel::FollowSyntheticRedirect() rv = NS_NewChannelInternal(getter_AddRefs(newChannel), redirectURI, redirectLoadInfo, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks mLoadFlags, @@ -665,6 +666,7 @@ InterceptedHttpChannel::ResetInterception(void) nsresult rv = NS_NewChannelInternal(getter_AddRefs(newChannel), mURI, redirectLoadInfo, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks mLoadFlags); diff --git a/netwerk/protocol/http/nsCORSListenerProxy.cpp b/netwerk/protocol/http/nsCORSListenerProxy.cpp index 4b5aed16d696..2281dbfdbba8 100644 --- a/netwerk/protocol/http/nsCORSListenerProxy.cpp +++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp @@ -1494,6 +1494,7 @@ nsCORSListenerProxy::StartCORSPreflight(nsIChannel* aRequestChannel, rv = NS_NewChannelInternal(getter_AddRefs(preflightChannel), uri, loadInfo, + nullptr, // PerformanceStorage loadGroup, nullptr, // aCallbacks loadFlags); diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 88e7d3e96ab6..a8f9505c31e9 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -2839,6 +2839,7 @@ nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, uint32_t flags) rv = NS_NewChannelInternal(getter_AddRefs(newChannel), upgradedURI, redirectLoadInfo, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, @@ -5592,6 +5593,7 @@ nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv) rv = NS_NewChannelInternal(getter_AddRefs(newChannel), mRedirectURI, redirectLoadInfo, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, @@ -8507,6 +8509,7 @@ nsHttpChannel::OnPush(const nsACString &url, Http2PushedStream *pushedStream) rv = NS_NewChannelInternal(getter_AddRefs(pushChannel), pushResource, mLoadInfo, + nullptr, // PerformanceStorage nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp index 280bac585d97..0a0b0fe3ced8 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp @@ -117,6 +117,7 @@ WyciwygChannelParent::RecvInit(const URIParams& aURI, triggeringPrincipal, aSecurityFlags, aContentPolicyType, + nullptr, // PerformanceStorage nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/rdf/base/nsRDFXMLDataSource.cpp b/rdf/base/nsRDFXMLDataSource.cpp index 0d4be8d4182d..5d4200a049ad 100644 --- a/rdf/base/nsRDFXMLDataSource.cpp +++ b/rdf/base/nsRDFXMLDataSource.cpp @@ -941,6 +941,7 @@ RDFXMLDataSourceImpl::Refresh(bool aBlocking) nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup this); // aCallbacks NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 0e78102e42b6..b8bb29e22f08 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -2127,6 +2127,7 @@ nsUrlClassifierDBService::SendThreatHitReport(nsIChannel *aChannel, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup nullptr, loadFlags); diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index 01e0e8de6e51..0a32548dc86b 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -140,6 +140,7 @@ nsUrlClassifierStreamUpdater::FetchUpdate(nsIURI *aUpdateUrl, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // aPerformanceStorage nullptr, // aLoadGroup this, // aInterfaceRequestor loadFlags); diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index 4c834f34ddbb..9e09b661993a 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -181,6 +181,7 @@ nsManifestCheck::Begin() mLoadingPrincipal, nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::LOAD_BYPASS_CACHE); @@ -378,6 +379,7 @@ nsOfflineCacheUpdateItem::OpenChannel(nsOfflineCacheUpdate *aUpdate) mLoadingPrincipal, nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage nullptr, // aLoadGroup this, // aCallbacks flags); diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index e379de1923f7..19b8fb91adeb 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -152,6 +152,7 @@ nsPrefetchNode::OpenChannel() Maybe(), securityFlags, mPolicyType, + nullptr, // aPerformanceStorage loadGroup, // aLoadGroup this, // aCallbacks nsIRequest::LOAD_BACKGROUND | diff --git a/xpfe/components/directory/nsDirectoryViewer.cpp b/xpfe/components/directory/nsDirectoryViewer.cpp index cab4f7bfb264..c8c5d347bb52 100644 --- a/xpfe/components/directory/nsDirectoryViewer.cpp +++ b/xpfe/components/directory/nsDirectoryViewer.cpp @@ -1282,6 +1282,7 @@ nsDirectoryViewerFactory::CreateInstance(const char *aCommand, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsIContentPolicy::TYPE_OTHER, + nullptr, // PerformanceStorage aLoadGroup); if (NS_FAILED(rv)) return rv;