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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 2655443003: Unify the "get" and "set" cookie access settings. (Closed)
Patch Set: fix android Created 3 years, 11 months 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/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 3b866102845df0058f5440290464d90e86e9f2a9..f038362c46d760620695e81ef25f3d423b56a783 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -423,7 +423,7 @@ bool ChromeNetworkDelegate::OnCanGetCookies(
if (!cookie_settings_.get())
return true;
- bool allow = cookie_settings_->IsReadingCookieAllowed(
+ bool allow = cookie_settings_->IsCookieAccessAllowed(
request.url(), request.first_party_for_cookies());
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
@@ -446,7 +446,7 @@ bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
if (!cookie_settings_.get())
return true;
- bool allow = cookie_settings_->IsSettingCookieAllowed(
+ bool allow = cookie_settings_->IsCookieAccessAllowed(
request.url(), request.first_party_for_cookies());
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
@@ -541,13 +541,7 @@ bool ChromeNetworkDelegate::OnCanEnablePrivacyMode(
if (!cookie_settings_.get())
return false;
- bool reading_cookie_allowed = false;
- bool setting_cookie_allowed = false;
- cookie_settings_->GetReadingAndSettingCookieAllowed(
- url, first_party_for_cookies, &reading_cookie_allowed,
- &setting_cookie_allowed);
- bool privacy_mode = !(reading_cookie_allowed && setting_cookie_allowed);
- return privacy_mode;
+ return !cookie_settings_->IsCookieAccessAllowed(url, first_party_for_cookies);
}
bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {

Powered by Google App Engine
This is Rietveld 408576698