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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 8c6aeaf4001dc7d3b77f70744f882cfffbcf6fa7..03c70916ffea6f54013fc39ca5f8daa6dba11f7b 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -340,10 +340,8 @@ bool ChromeContentBrowserClient::AllowAppCache(
ProfileIOData* io_data =
reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
// FIXME(jochen): get the correct top-level origin.
- ContentSetting setting = io_data->GetHostContentSettingsMap()->
- GetCookieContentSetting(manifest_url, manifest_url, true);
- DCHECK(setting != CONTENT_SETTING_DEFAULT);
- return setting != CONTENT_SETTING_BLOCK;
+ return io_data->GetCookieContentSettings()->Allow(
+ manifest_url, manifest_url, true);
}
bool ChromeContentBrowserClient::AllowGetCookie(
@@ -356,10 +354,8 @@ bool ChromeContentBrowserClient::AllowGetCookie(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProfileIOData* io_data =
reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
- ContentSetting setting = io_data->GetHostContentSettingsMap()->
- GetCookieContentSetting(url, first_party, false);
- bool allow = setting == CONTENT_SETTING_ALLOW ||
- setting == CONTENT_SETTING_SESSION_ONLY;
+ bool allow = io_data->GetCookieContentSettings()->Allow(
+ url, first_party, false);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -380,14 +376,12 @@ bool ChromeContentBrowserClient::AllowSetCookie(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProfileIOData* io_data =
reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
- ContentSetting setting = io_data->GetHostContentSettingsMap()->
- GetCookieContentSetting(url, first_party, true);
- if (setting == CONTENT_SETTING_SESSION_ONLY)
- options->set_force_session();
+ bool allow = io_data->GetCookieContentSettings()->Allow(
+ url, first_party, true);
- bool allow = setting == CONTENT_SETTING_ALLOW ||
- setting == CONTENT_SETTING_SESSION_ONLY;
+ if (io_data->GetCookieContentSettings()->EnforceSessionOnly(url))
+ options->set_force_session();
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698