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

Unified Diff: components/content_settings/core/browser/cookie_settings.h

Issue 2502743003: Allow getting both reading/setting cookie settings at one time (Closed)
Patch Set: rdevlin review Created 4 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: components/content_settings/core/browser/cookie_settings.h
diff --git a/components/content_settings/core/browser/cookie_settings.h b/components/content_settings/core/browser/cookie_settings.h
index 26ffa8068bacc6f85d71e4f76853652c36457e16..edc061dfd2422976a3cc0f0dd4ec983f08406207 100644
--- a/components/content_settings/core/browser/cookie_settings.h
+++ b/components/content_settings/core/browser/cookie_settings.h
@@ -37,7 +37,7 @@ class CookieSettings : public RefcountedKeyedService {
// Returns the default content setting (CONTENT_SETTING_ALLOW,
// CONTENT_SETTING_BLOCK, or CONTENT_SETTING_SESSION_ONLY) for cookies. If
- // |provider_id| is not NULL, the id of the provider which provided the
+ // |provider_id| is not nullptr, the id of the provider which provided the
// default setting is assigned to it.
//
// This may be called on any thread.
@@ -57,6 +57,15 @@ class CookieSettings : public RefcountedKeyedService {
bool IsSettingCookieAllowed(const GURL& url,
const GURL& first_party_url) const;
+ // Gets the results from IsReadingCookieAllowed and IsSettingCookieAllowed in
+ // a performance efficient way.
+ //
+ // This may be called on any thread.
+ void GetReadingAndSettingCookieAllowed(const GURL& url,
+ const GURL& first_party_url,
+ bool* reading_cookie_allowed,
+ bool* setting_cookie_allowed) const;
+
// Returns true if the cookie set by a page identified by |url| should be
// session only. Querying this only makes sense if |IsSettingCookieAllowed|
// has returned true.
@@ -66,7 +75,7 @@ class CookieSettings : public RefcountedKeyedService {
// Returns all patterns with a non-default cookie setting, mapped to their
// actual settings, in the precedence order of the setting rules. |settings|
- // must be a non-NULL outparam.
+ // must be a non-nullptr outparam.
//
// This may be called on any thread.
void GetCookieSettings(ContentSettingsForOneType* settings) const;
@@ -95,11 +104,11 @@ class CookieSettings : public RefcountedKeyedService {
void ShutdownOnUIThread() override;
// A helper for applying third party cookie blocking rules.
- ContentSetting GetCookieSetting(
- const GURL& url,
- const GURL& first_party_url,
- bool setting_cookie,
- content_settings::SettingSource* source) const;
+ void GetCookieSetting(const GURL& url,
+ const GURL& first_party_url,
+ content_settings::SettingSource* source,
+ ContentSetting* reading_cookie,
+ ContentSetting* setting_cookie) const;
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

Powered by Google App Engine
This is Rietveld 408576698