diff options
author | Moonchild <moonchild@palemoon.org> | 2021-10-22 05:39:02 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-01 16:03:01 +0200 |
commit | a95439db61c4530afae3967e2912d6ca38f1bbda (patch) | |
tree | ed8926c1fe52c8072dbaff40278c1f0370980c2f | |
parent | f5fcb8a32ccbe9af1a16a05c4959f7389eae37c1 (diff) | |
download | uxp-a95439db61c4530afae3967e2912d6ca38f1bbda.tar.gz |
Issue #1822 - Part 3: Remove LOAD_CLASSIFIER_URI and various
helper functions.
-rw-r--r-- | accessible/base/Logging.cpp | 2 | ||||
-rw-r--r-- | docshell/base/nsDocShell.cpp | 47 | ||||
-rw-r--r-- | docshell/base/nsDocShell.h | 4 | ||||
-rw-r--r-- | docshell/base/nsIDocShell.idl | 3 | ||||
-rw-r--r-- | dom/base/Navigator.cpp | 3 | ||||
-rw-r--r-- | dom/base/nsObjectLoadingContent.cpp | 1 | ||||
-rw-r--r-- | dom/fetch/FetchDriver.cpp | 3 | ||||
-rw-r--r-- | dom/html/HTMLMediaElement.cpp | 1 | ||||
-rw-r--r-- | dom/html/HTMLTrackElement.cpp | 2 | ||||
-rw-r--r-- | dom/jsurl/nsJSProtocolHandler.cpp | 5 | ||||
-rw-r--r-- | dom/media/MediaResource.cpp | 4 | ||||
-rw-r--r-- | dom/plugins/base/nsPluginHost.cpp | 2 | ||||
-rw-r--r-- | dom/script/ScriptLoader.cpp | 3 | ||||
-rw-r--r-- | dom/security/nsCSPContext.cpp | 2 | ||||
-rw-r--r-- | dom/workers/ScriptLoader.cpp | 1 | ||||
-rw-r--r-- | dom/xhr/XMLHttpRequestMainThread.cpp | 3 | ||||
-rw-r--r-- | image/imgLoader.cpp | 2 | ||||
-rw-r--r-- | layout/style/Loader.cpp | 7 | ||||
-rw-r--r-- | netwerk/base/nsBaseChannel.cpp | 22 | ||||
-rw-r--r-- | netwerk/base/nsBaseChannel.h | 3 | ||||
-rw-r--r-- | netwerk/base/nsIChannel.idl | 4 | ||||
-rw-r--r-- | netwerk/protocol/http/nsHttpChannel.cpp | 62 | ||||
-rw-r--r-- | toolkit/components/telemetry/TelemetrySend.jsm | 3 |
23 files changed, 20 insertions, 169 deletions
diff --git a/accessible/base/Logging.cpp b/accessible/base/Logging.cpp index 1fd5639702..dccd1761c6 100644 --- a/accessible/base/Logging.cpp +++ b/accessible/base/Logging.cpp @@ -341,8 +341,6 @@ LogRequest(nsIRequest* aRequest) printf("targeted; "); if (loadFlags & nsIChannel::LOAD_CALL_CONTENT_SNIFFERS) printf("call content sniffers; "); - if (loadFlags & nsIChannel::LOAD_CLASSIFY_URI) - printf("classify uri; "); } else { printf(" no request"); } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index c40fbd7a10..55f09d35b1 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -530,9 +530,8 @@ SendPing(void* aClosure, nsIContent* aContent, nsIURI* aURI, return; } - // Don't bother caching the result of this URI load, but do not exempt - // it from Safe Browsing. - chan->SetLoadFlags(nsIRequest::INHIBIT_CACHING | nsIChannel::LOAD_CLASSIFY_URI); + // Don't bother caching the result of this URI load. + chan->SetLoadFlags(nsIRequest::INHIBIT_CACHING); nsCOMPtr<nsIHttpChannel> httpChan = do_QueryInterface(chan); if (!httpChan) { @@ -1560,10 +1559,6 @@ nsDocShell::LoadURI(nsIURI* aURI, flags |= INTERNAL_LOAD_FLAGS_FIRST_LOAD; } - if (aLoadFlags & LOAD_FLAGS_BYPASS_CLASSIFIER) { - flags |= INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER; - } - if (aLoadFlags & LOAD_FLAGS_FORCE_ALLOW_COOKIES) { flags |= INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES; } @@ -1662,7 +1657,7 @@ nsDocShell::LoadStream(nsIInputStream* aStream, nsIURI* aURI, nsCOMPtr<nsIURILoader> uriLoader(do_GetService(NS_URI_LOADER_CONTRACTID)); NS_ENSURE_TRUE(uriLoader, NS_ERROR_FAILURE); - NS_ENSURE_SUCCESS(DoChannelLoad(channel, uriLoader, false), + NS_ENSURE_SUCCESS(DoChannelLoad(channel, uriLoader), NS_ERROR_FAILURE); return NS_OK; } @@ -4993,31 +4988,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, error.AssignLiteral("nssFailure2"); } } - } else if (NS_ERROR_PHISHING_URI == aError || - NS_ERROR_MALWARE_URI == aError || - NS_ERROR_UNWANTED_URI == aError) { - nsAutoCString host; - aURI->GetHost(host); - CopyUTF8toUTF16(host, formatStrs[0]); - formatStrCount = 1; - - // Malware and phishing detectors may want to use an alternate error - // page, but if the pref's not set, we'll fall back on the standard page - nsAdoptingCString alternateErrorPage = - Preferences::GetCString("urlclassifier.alternate_error_page"); - if (alternateErrorPage) { - errorPage.Assign(alternateErrorPage); - } - - if (NS_ERROR_PHISHING_URI == aError) { - error.AssignLiteral("deceptiveBlocked"); - } else if (NS_ERROR_MALWARE_URI == aError) { - error.AssignLiteral("malwareBlocked"); - } else if (NS_ERROR_UNWANTED_URI == aError) { - error.AssignLiteral("unwantedBlocked"); - } - - cssClass.AssignLiteral("blacklist"); } else if (NS_ERROR_CONTENT_CRASHED == aError) { errorPage.AssignLiteral("tabcrashed"); error.AssignLiteral("tabcrashed"); @@ -10668,7 +10638,6 @@ nsDocShell::InternalLoad(nsIURI* aURI, aFileName, aPostData, aHeadersData, aFirstParty, aDocShell, getter_AddRefs(req), (aFlags & INTERNAL_LOAD_FLAGS_FIRST_LOAD) != 0, - (aFlags & INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER) != 0, (aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES) != 0, srcdoc, aBaseURI, contentType); if (req && aRequest) { @@ -10757,7 +10726,6 @@ nsDocShell::DoURILoad(nsIURI* aURI, nsIDocShell** aDocShell, nsIRequest** aRequest, bool aIsNewWindowTarget, - bool aBypassClassifier, bool aForceAllowCookies, const nsAString& aSrcdoc, nsIURI* aBaseURI, @@ -11227,7 +11195,7 @@ nsDocShell::DoURILoad(nsIURI* aURI, } } - rv = DoChannelLoad(channel, uriLoader, aBypassClassifier); + rv = DoChannelLoad(channel, uriLoader); // // If the channel load failed, we failed and nsIWebProgress just ain't @@ -11323,8 +11291,7 @@ nsDocShell::AddHeadersToChannel(nsIInputStream* aHeadersData, nsresult nsDocShell::DoChannelLoad(nsIChannel* aChannel, - nsIURILoader* aURILoader, - bool aBypassClassifier) + nsIURILoader* aURILoader) { nsresult rv; // Mark the channel as being a document URI and allow content sniffing... @@ -11394,10 +11361,6 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel, break; } - if (!aBypassClassifier) { - loadFlags |= nsIChannel::LOAD_CLASSIFY_URI; - } - // If the user pressed shift-reload, then do not allow ServiceWorker // interception to occur. See step 12.1 of the SW HandleFetch algorithm. if (IsForceReloadType(mLoadType)) { diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 019a7e4ab6..bc5c5eed3f 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -386,7 +386,6 @@ protected: nsIDocShell** aDocShell, nsIRequest** aRequest, bool aIsNewWindowTarget, - bool aBypassClassifier, bool aForceAllowCookies, const nsAString& aSrcdoc, nsIURI* aBaseURI, @@ -394,8 +393,7 @@ protected: nsresult AddHeadersToChannel(nsIInputStream* aHeadersData, nsIChannel* aChannel); nsresult DoChannelLoad(nsIChannel* aChannel, - nsIURILoader* aURILoader, - bool aBypassClassifier); + nsIURILoader* aURILoader); nsresult ScrollToAnchor(bool aCurHasRef, bool aNewHasRef, diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index d2812bd9c9..0e3c4f1996 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -110,7 +110,8 @@ interface nsIDocShell : nsIDocShellTreeItem // @see nsIWebNavigation::LOAD_FLAGS_FIRST_LOAD const long INTERNAL_LOAD_FLAGS_FIRST_LOAD = 0x8; - const long INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10; + // 0x10 is unused + const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20; // Whether the load should be treated as srcdoc load, rather than a URI one. diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 0e4a406fee..4fd7405644 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -885,8 +885,7 @@ Navigator::SendBeacon(const nsAString& aUrl, return false; } - nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | - nsIChannel::LOAD_CLASSIFY_URI; + nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL; // No need to use CORS for sendBeacon unless it's a BLOB nsSecurityFlags securityFlags = (!aData.IsNull() && aData.Value().IsBlob()) diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 27e4e7b7e9..525ece9296 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -2660,7 +2660,6 @@ nsObjectLoadingContent::OpenChannel() group, // aLoadGroup shim, // aCallbacks nsIChannel::LOAD_CALL_CONTENT_SNIFFERS | - nsIChannel::LOAD_CLASSIFY_URI | nsIChannel::LOAD_BYPASS_SERVICE_WORKER); NS_ENSURE_SUCCESS(rv, rv); if (inherit) { diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 79bd5a0e39..e755edeb3b 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -210,8 +210,7 @@ FetchDriver::HttpFetch() MOZ_ASSERT(mLoadGroup); nsCOMPtr<nsIChannel> chan; - nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | - bypassFlag | nsIChannel::LOAD_CLASSIFY_URI; + nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | bypassFlag; if (mDocument) { MOZ_ASSERT(mDocument->NodePrincipal() == mPrincipal); rv = NS_NewChannel(getter_AddRefs(chan), diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index a483198655..21f62b0e32 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -664,7 +664,6 @@ public: nullptr, // aCallbacks nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE_IF_BUSY | nsIChannel::LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE | - nsIChannel::LOAD_CLASSIFY_URI | nsIChannel::LOAD_CALL_CONTENT_SNIFFERS); if (NS_FAILED(rv)) { diff --git a/dom/html/HTMLTrackElement.cpp b/dom/html/HTMLTrackElement.cpp index 07fbe2073d..9799a2d156 100644 --- a/dom/html/HTMLTrackElement.cpp +++ b/dom/html/HTMLTrackElement.cpp @@ -326,7 +326,7 @@ HTMLTrackElement::LoadResource() nsIContentPolicy::TYPE_INTERNAL_TRACK, loadGroup, nullptr, // aCallbacks - nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI); + nsIRequest::LOAD_NORMAL); NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv)); diff --git a/dom/jsurl/nsJSProtocolHandler.cpp b/dom/jsurl/nsJSProtocolHandler.cpp index 7602e58b0b..82d24d1334 100644 --- a/dom/jsurl/nsJSProtocolHandler.cpp +++ b/dom/jsurl/nsJSProtocolHandler.cpp @@ -837,11 +837,6 @@ nsJSChannel::SetLoadFlags(nsLoadFlags aLoadFlags) bogusLoadBackground = !loadGroupIsBackground; } - // Classifying a javascript: URI doesn't help us, and requires - // NSS to boot, which we don't have in content processes. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=617838. - aLoadFlags &= ~LOAD_CLASSIFY_URI; - // Since the javascript channel is never the actual channel that // any data is loaded through, don't ever set the // LOAD_DOCUMENT_URI flag on it, since that could lead to two diff --git a/dom/media/MediaResource.cpp b/dom/media/MediaResource.cpp index 84a8d67fd9..5271cfe4be 100644 --- a/dom/media/MediaResource.cpp +++ b/dom/media/MediaResource.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ /* 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/. */ @@ -799,7 +798,6 @@ ChannelMediaResource::RecreateChannel() { nsLoadFlags loadFlags = nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE_IF_BUSY | - nsIChannel::LOAD_CLASSIFY_URI | (mLoadInBackground ? nsIRequest::LOAD_BACKGROUND : 0); MediaDecoderOwner* owner = mCallback->GetMediaOwner(); @@ -1350,7 +1348,7 @@ already_AddRefed<MediaResource> FileMediaResource::CloneData(MediaResourceCallba nsContentPolicyType contentPolicyType = element->IsHTMLElement(nsGkAtoms::audio) ? nsIContentPolicy::TYPE_INTERNAL_AUDIO : nsIContentPolicy::TYPE_INTERNAL_VIDEO; - nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI; + nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL; nsCOMPtr<nsIChannel> channel; nsresult rv = diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 482a201f8f..8a87f672e8 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -3204,7 +3204,7 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL, nsIContentPolicy::TYPE_OBJECT_SUBREQUEST, nullptr, // aLoadGroup listenerPeer, - nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI | + nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_BYPASS_SERVICE_WORKER); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 5b7bea8d22..3e1c13af5c 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -1046,8 +1046,7 @@ ScriptLoader::StartLoad(ScriptLoadRequest *aRequest, const nsAString &aType, contentPolicyType, loadGroup, prompter, - nsIRequest::LOAD_NORMAL | - nsIChannel::LOAD_CLASSIFY_URI); + nsIRequest::LOAD_NORMAL); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index a553680feb..ec698b91d0 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -925,7 +925,7 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource, } // try to create a new channel for every report-uri - nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI; + nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL; if (doc) { rv = NS_NewChannel(getter_AddRefs(reportChannel), reportURI, diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 35d5ba6271..56381a0c8d 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -142,7 +142,6 @@ ChannelFromScriptURL(nsIPrincipal* principal, parentDoc = nullptr; } - aLoadFlags |= nsIChannel::LOAD_CLASSIFY_URI; uint32_t secFlags = aIsMainScript ? nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED : nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS; diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp index 8a1c1f0ada..c96f59ab6d 100644 --- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -2479,8 +2479,7 @@ XMLHttpRequestMainThread::CreateChannel() nsCOMPtr<nsILoadGroup> loadGroup = GetLoadGroup(); nsSecurityFlags secFlags; - nsLoadFlags loadFlags = nsIRequest::LOAD_BACKGROUND | - nsIChannel::LOAD_CLASSIFY_URI; + nsLoadFlags loadFlags = nsIRequest::LOAD_BACKGROUND; if (nsContentUtils::IsSystemPrincipal(mPrincipal)) { // When chrome is loading we want to make sure to sandbox any potential // result document. We also want to allow cross-origin loads. diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index 0f516bc800..3b64f065bd 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -699,8 +699,6 @@ NewImageChannel(nsIChannel** aResult, // (possibly in different documents). // If all of the proxy requests are canceled then this request should be // canceled too. - // - aLoadFlags |= nsIChannel::LOAD_CLASSIFY_URI; nsCOMPtr<nsINode> requestingNode = do_QueryInterface(aRequestingContext); diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index a28a1053f0..e3a49b3b6a 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: ft=cpp tw=78 sw=2 et ts=2 * * 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 @@ -1631,8 +1630,7 @@ Loader::LoadSheet(SheetLoadData* aLoadData, contentPolicyType, loadGroup, nullptr, // aCallbacks - nsIChannel::LOAD_NORMAL | - nsIChannel::LOAD_CLASSIFY_URI); + nsIChannel::LOAD_NORMAL); } else { // either we are loading something inside a document, in which case @@ -1646,8 +1644,7 @@ Loader::LoadSheet(SheetLoadData* aLoadData, contentPolicyType, loadGroup, nullptr, // aCallbacks - nsIChannel::LOAD_NORMAL | - nsIChannel::LOAD_CLASSIFY_URI); + nsIChannel::LOAD_NORMAL); } if (NS_FAILED(rv)) { diff --git a/netwerk/base/nsBaseChannel.cpp b/netwerk/base/nsBaseChannel.cpp index 85181c50bd..a4d8d0d42f 100644 --- a/netwerk/base/nsBaseChannel.cpp +++ b/netwerk/base/nsBaseChannel.cpp @@ -304,25 +304,6 @@ nsBaseChannel::ContinueHandleAsyncRedirect(nsresult result) CallbacksChanged(); } -void -nsBaseChannel::ClassifyURI() -{ - // For channels created in the child process, delegate to the parent to - // classify URIs. - if (!XRE_IsParentProcess()) { - return; - } - - if (mLoadFlags & LOAD_CLASSIFY_URI) { - RefPtr<nsChannelClassifier> classifier = new nsChannelClassifier(); - if (classifier) { - classifier->Start(this); - } else { - Cancel(NS_ERROR_OUT_OF_MEMORY); - } - } -} - //----------------------------------------------------------------------------- // nsBaseChannel::nsISupports @@ -627,7 +608,6 @@ nsBaseChannel::Open(nsIInputStream **result) if (NS_SUCCEEDED(rv)) { mWasOpened = true; - ClassifyURI(); } return rv; @@ -698,8 +678,6 @@ nsBaseChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt) if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr); - ClassifyURI(); - return NS_OK; } diff --git a/netwerk/base/nsBaseChannel.h b/netwerk/base/nsBaseChannel.h index b98609e857..390a492f9b 100644 --- a/netwerk/base/nsBaseChannel.h +++ b/netwerk/base/nsBaseChannel.h @@ -241,9 +241,6 @@ private: void ContinueHandleAsyncRedirect(nsresult result); nsresult ContinueRedirect(); - // start URI classifier if requested - void ClassifyURI(); - class RedirectRunnable : public mozilla::Runnable { public: diff --git a/netwerk/base/nsIChannel.idl b/netwerk/base/nsIChannel.idl index 743e942920..b668c518d0 100644 --- a/netwerk/base/nsIChannel.idl +++ b/netwerk/base/nsIChannel.idl @@ -258,10 +258,8 @@ interface nsIChannel : nsIRequest const unsigned long LOAD_CALL_CONTENT_SNIFFERS = 1 << 21; /** - * This flag tells the channel to use URI classifier service to check - * the URI when opening the channel. + * Bit 22 is unused. */ - const unsigned long LOAD_CLASSIFY_URI = 1 << 22; /** * If this flag is set, the media-type content sniffer will be allowed diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 3ba812b923..16d31a8fc9 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -5842,37 +5842,6 @@ nsHttpChannel::BeginConnectContinue() if (mAPIRedirectToURI) { return AsyncCall(&nsHttpChannel::HandleAsyncAPIRedirect); } - // Check to see if this principal exists on local blocklists. - RefPtr<nsChannelClassifier> channelClassifier = new nsChannelClassifier(); - if (mLoadFlags & LOAD_CLASSIFY_URI) { - nsCOMPtr<nsIURIClassifier> classifier = do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID); - bool tpEnabled = false; - channelClassifier->ShouldEnableTrackingProtection(this, &tpEnabled); - if (classifier && tpEnabled) { - // We skip speculative connections by setting mLocalBlocklist only - // when tracking protection is enabled. Though we could do this for - // both phishing and malware, it is not necessary for correctness, - // since no network events will be received while the - // nsChannelClassifier is in progress. See bug 1122691. - nsCOMPtr<nsIURI> uri; - rv = GetURI(getter_AddRefs(uri)); - if (NS_SUCCEEDED(rv) && uri) { - nsAutoCString tables; - Preferences::GetCString("urlclassifier.trackingTable", &tables); - nsAutoCString results; - rv = classifier->ClassifyLocalWithTables(uri, tables, results); - if (NS_SUCCEEDED(rv) && !results.IsEmpty()) { - LOG(("nsHttpChannel::ClassifyLocalWithTables found " - "uri on local tracking blocklist [this=%p]", - this)); - mLocalBlocklist = true; - } else { - LOG(("nsHttpChannel::ClassifyLocalWithTables no result " - "found [this=%p]", this)); - } - } - } - } // If mTimingEnabled flag is not set after OnModifyRequest() then // clear the already recorded AsyncOpen value for consistency. @@ -5945,36 +5914,7 @@ nsHttpChannel::BeginConnectContinue() return mStatus; } - if (!(mLoadFlags & LOAD_CLASSIFY_URI)) { - return ContinueBeginConnectWithResult(); - } - - // mLocalBlocklist is true only if tracking protection is enabled and the - // URI is a tracking domain, it makes no guarantees about phishing or - // malware, so if LOAD_CLASSIFY_URI is true we must call - // nsChannelClassifier to catch phishing and malware URIs. - bool callContinueBeginConnect = true; - if (!mLocalBlocklist) { - // Here we call ContinueBeginConnectWithResult and not - // ContinueBeginConnect so that in the case of an error we do not start - // channelClassifier. - rv = ContinueBeginConnectWithResult(); - if (NS_FAILED(rv)) { - return rv; - } - callContinueBeginConnect = false; - } - // nsChannelClassifier calls ContinueBeginConnect if it has not already - // been called, after optionally cancelling the channel once we have a - // remote verdict. We call a concrete class instead of an nsI* that might - // be overridden. - LOG(("nsHttpChannel::Starting nsChannelClassifier %p [this=%p]", - channelClassifier.get(), this)); - channelClassifier->Start(this); - if (callContinueBeginConnect) { - return ContinueBeginConnectWithResult(); - } - return NS_OK; + return ContinueBeginConnectWithResult(); } NS_IMETHODIMP diff --git a/toolkit/components/telemetry/TelemetrySend.jsm b/toolkit/components/telemetry/TelemetrySend.jsm index 4694ac6a96..21282cc085 100644 --- a/toolkit/components/telemetry/TelemetrySend.jsm +++ b/toolkit/components/telemetry/TelemetrySend.jsm @@ -916,9 +916,6 @@ var TelemetrySendImpl = { this._pendingPingRequests.set(id, request); - // Prevent the request channel from running though URLClassifier (bug 1296802) - request.channel.loadFlags &= ~Ci.nsIChannel.LOAD_CLASSIFY_URI; - const monotonicStartTime = monotonicNow(); let deferred = PromiseUtils.defer(); |