Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1119)

Unified Diff: chrome/browser/content_settings/cookie_settings.cc

Issue 8462003: Exempt chrome-extension:// from third-party cookie rules, but not from regular content settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/cookie_settings.cc
diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc
index dd5d7888b564bf482286415c27cf4024b6c103f4..e3fefe33feb68c377311eea116d875dfb48c4fdf 100644
--- a/chrome/browser/content_settings/cookie_settings.cc
+++ b/chrome/browser/content_settings/cookie_settings.cc
@@ -15,6 +15,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/content_settings_pattern.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/url_constants.h"
#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -201,10 +202,8 @@ ContentSetting CookieSettings::GetCookieSetting(
const GURL& first_party_url,
bool setting_cookie) const {
if (HostContentSettingsMap::ShouldAllowAllContent(
- first_party_url,
- CONTENT_SETTINGS_TYPE_COOKIES)) {
+ first_party_url, url, CONTENT_SETTINGS_TYPE_COOKIES))
return CONTENT_SETTING_ALLOW;
- }
ContentSettingsPattern primary_pattern;
ContentSettingsPattern secondary_pattern;
@@ -218,7 +217,8 @@ ContentSetting CookieSettings::GetCookieSetting(
// by default, apply that rule.
if (primary_pattern == ContentSettingsPattern::Wildcard() &&
secondary_pattern == ContentSettingsPattern::Wildcard() &&
- ShouldBlockThirdPartyCookies()) {
+ ShouldBlockThirdPartyCookies() &&
+ !first_party_url.SchemeIs(chrome::kExtensionScheme)) {
bool strict = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kBlockReadingThirdPartyCookies);
net::StaticCookiePolicy policy(strict ?

Powered by Google App Engine
This is Rietveld 408576698