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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2655443003: Unify the "get" and "set" cookie access settings. (Closed)
Patch Set: rebase 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index fb21b60410058d4fdf61d5283d80b00024ffe088..b8ee4de63eb65f7835a38e32825d65732622c8cb 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1871,8 +1871,8 @@ bool ChromeContentBrowserClient::AllowAppCache(
content::ResourceContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
- return io_data->GetCookieSettings()->
- IsSettingCookieAllowed(manifest_url, first_party);
+ return io_data->GetCookieSettings()->IsCookieAccessAllowed(manifest_url,
+ first_party);
}
bool ChromeContentBrowserClient::AllowServiceWorker(
@@ -1908,8 +1908,8 @@ bool ChromeContentBrowserClient::AllowServiceWorker(
// Check if cookies are allowed.
bool allow_serviceworker =
- io_data->GetCookieSettings()->IsSettingCookieAllowed(scope,
- first_party_url);
+ io_data->GetCookieSettings()->IsCookieAccessAllowed(scope,
+ first_party_url);
// Record access to database for potential display in UI.
// Only post the task if this is for a specific tab.
if (!wc_getter.is_null()) {
@@ -1930,8 +1930,8 @@ bool ChromeContentBrowserClient::AllowGetCookie(
int render_frame_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
- bool allow = io_data->GetCookieSettings()->
- IsReadingCookieAllowed(url, first_party);
+ bool allow =
+ io_data->GetCookieSettings()->IsCookieAccessAllowed(url, first_party);
base::Callback<content::WebContents*(void)> wc_getter =
base::Bind(&GetWebContents, render_process_id, render_frame_id);
@@ -1954,7 +1954,7 @@ bool ChromeContentBrowserClient::AllowSetCookie(
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
content_settings::CookieSettings* cookie_settings =
io_data->GetCookieSettings();
- bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party);
+ bool allow = cookie_settings->IsCookieAccessAllowed(url, first_party);
base::Callback<content::WebContents*(void)> wc_getter =
base::Bind(&GetWebContents, render_process_id, render_frame_id);
@@ -1987,7 +1987,7 @@ void ChromeContentBrowserClient::AllowWorkerFileSystem(
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
content_settings::CookieSettings* cookie_settings =
io_data->GetCookieSettings();
- bool allow = cookie_settings->IsSettingCookieAllowed(url, url);
+ bool allow = cookie_settings->IsCookieAccessAllowed(url, url);
#if BUILDFLAG(ENABLE_EXTENSIONS)
GuestPermissionRequestHelper(url, render_frames, callback, allow);
@@ -2081,7 +2081,7 @@ bool ChromeContentBrowserClient::AllowWorkerIndexedDB(
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
content_settings::CookieSettings* cookie_settings =
io_data->GetCookieSettings();
- bool allow = cookie_settings->IsSettingCookieAllowed(url, url);
+ bool allow = cookie_settings->IsCookieAccessAllowed(url, url);
// Record access to IndexedDB for potential display in UI.
std::vector<std::pair<int, int> >::const_iterator i;
@@ -2104,8 +2104,7 @@ bool ChromeContentBrowserClient::AllowWebRTCIdentityCache(
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
content_settings::CookieSettings* cookie_settings =
io_data->GetCookieSettings();
- return cookie_settings->IsReadingCookieAllowed(url, first_party_url) &&
- cookie_settings->IsSettingCookieAllowed(url, first_party_url);
+ return cookie_settings->IsCookieAccessAllowed(url, first_party_url);
}
#endif // BUILDFLAG(ENABLE_WEBRTC)

Powered by Google App Engine
This is Rietveld 408576698