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:
Ehsan Akhgari
2015-10-09 20:34:56 -04:00
parent 9ebbaed626
commit 20f13bc0e3
2 changed files with 8 additions and 5 deletions

View File

@@ -13969,7 +13969,8 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
do_GetService(THIRDPARTYUTIL_CONTRACTID, &result);
NS_ENSURE_SUCCESS(result, result);
if (mCurrentURI) {
if (mCurrentURI &&
nsContentUtils::CookiesBehavior() == nsICookieService::BEHAVIOR_REJECT_FOREIGN) {
nsAutoCString uriSpec;
mCurrentURI->GetSpec(uriSpec);
if (!(uriSpec.EqualsLiteral("about:blank"))) {
@@ -13984,10 +13985,7 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
return result;
}
if (isThirdPartyURI &&
(Preferences::GetInt("network.cookie.cookieBehavior",
nsICookieService::BEHAVIOR_ACCEPT) ==
nsICookieService::BEHAVIOR_REJECT_FOREIGN)) {
if (isThirdPartyURI) {
return NS_OK;
}
}