зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1213514 - Don't bother checking for third party URLs at interception time unless if the user needs it; r=jdm
The current code is wasteful for the vast majority of our users.
This commit is contained in:
Родитель
bf7fdb8e75
Коммит
202348d36c
|
@ -13969,7 +13969,8 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
|
||||||
do_GetService(THIRDPARTYUTIL_CONTRACTID, &result);
|
do_GetService(THIRDPARTYUTIL_CONTRACTID, &result);
|
||||||
NS_ENSURE_SUCCESS(result, result);
|
NS_ENSURE_SUCCESS(result, result);
|
||||||
|
|
||||||
if (mCurrentURI) {
|
if (mCurrentURI &&
|
||||||
|
nsContentUtils::CookiesBehavior() == nsICookieService::BEHAVIOR_REJECT_FOREIGN) {
|
||||||
nsAutoCString uriSpec;
|
nsAutoCString uriSpec;
|
||||||
mCurrentURI->GetSpec(uriSpec);
|
mCurrentURI->GetSpec(uriSpec);
|
||||||
if (!(uriSpec.EqualsLiteral("about:blank"))) {
|
if (!(uriSpec.EqualsLiteral("about:blank"))) {
|
||||||
|
@ -13984,10 +13985,7 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isThirdPartyURI &&
|
if (isThirdPartyURI) {
|
||||||
(Preferences::GetInt("network.cookie.cookieBehavior",
|
|
||||||
nsICookieService::BEHAVIOR_ACCEPT) ==
|
|
||||||
nsICookieService::BEHAVIOR_REJECT_FOREIGN)) {
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2524,6 +2524,11 @@ public:
|
||||||
|
|
||||||
static bool IsNonSubresourceRequest(nsIChannel* aChannel);
|
static bool IsNonSubresourceRequest(nsIChannel* aChannel);
|
||||||
|
|
||||||
|
static uint32_t CookiesBehavior()
|
||||||
|
{
|
||||||
|
return sCookiesBehavior;
|
||||||
|
}
|
||||||
|
|
||||||
// The order of these entries matters, as we use std::min for total ordering
|
// The order of these entries matters, as we use std::min for total ordering
|
||||||
// of permissions. Private Browsing is considered to be more limiting
|
// of permissions. Private Browsing is considered to be more limiting
|
||||||
// then session scoping
|
// then session scoping
|
||||||
|
|
Загрузка…
Ссылка в новой задаче