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

Unified Diff: chrome/browser/content_settings/content_settings_policy_provider.h

Issue 7218073: Explicitly ShutdownOnUIThread the HostContentSettingsMap when destroying the Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 5 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/content_settings/content_settings_policy_provider.h
diff --git a/chrome/browser/content_settings/content_settings_policy_provider.h b/chrome/browser/content_settings/content_settings_policy_provider.h
index 7e435fa81b5797d61650744c315836c0b242453c..89004ee1e0b9165a27fd78973565c272cdb02f1d 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider.h
+++ b/chrome/browser/content_settings/content_settings_policy_provider.h
@@ -21,15 +21,16 @@
class ContentSettingsDetails;
class DictionaryValue;
+class HostContentSettingsMap;
class PrefService;
-class Profile;
namespace content_settings {
class PolicyDefaultProvider : public DefaultProviderInterface,
public NotificationObserver {
public:
- explicit PolicyDefaultProvider(Profile* profile);
+ explicit PolicyDefaultProvider(HostContentSettingsMap* map,
+ PrefService* prefs);
virtual ~PolicyDefaultProvider();
// DefaultContentSettingsProvider implementation.
@@ -40,6 +41,8 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
virtual void ResetToDefaults();
virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const;
+ void ShutdownOnUIThread();
+
static void RegisterUserPrefs(PrefService* prefs);
// NotificationObserver implementation.
@@ -54,8 +57,6 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
// mutex deadlock.
void NotifyObservers(const ContentSettingsDetails& details);
- void UnregisterObservers();
-
// Reads the policy managed default settings.
void ReadManagedDefaultSettings();
@@ -65,10 +66,8 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
// Copies of the pref data, so that we can read it on the IO thread.
ContentSettings managed_default_content_settings_;
- Profile* profile_;
-
- // Whether this settings map is for an OTR session.
- bool is_off_the_record_;
+ HostContentSettingsMap* map_;
+ PrefService* prefs_;
// Used around accesses to the managed_default_content_settings_ object to
// guarantee thread safety.
@@ -84,14 +83,13 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
class PolicyProvider : public ProviderInterface,
public NotificationObserver {
public:
- explicit PolicyProvider(Profile* profile,
+ explicit PolicyProvider(HostContentSettingsMap* map,
+ PrefService* prefs,
DefaultProviderInterface* default_provider);
virtual ~PolicyProvider();
static void RegisterUserPrefs(PrefService* prefs);
// ProviderInterface Implementation
- virtual void Init();
-
virtual void SetContentSetting(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
@@ -115,6 +113,8 @@ class PolicyProvider : public ProviderInterface,
virtual void ResetToDefaults();
+ virtual void ShutdownOnUIThread();
+
// NotificationObserver implementation.
virtual void Observe(NotificationType type,
const NotificationSource& source,
@@ -131,11 +131,9 @@ class PolicyProvider : public ProviderInterface,
void ReadManagedContentSettings(bool overwrite);
- void GetContentSettingsFromPreferences(PrefService* prefs,
- ContentSettingsRules* rules);
+ void GetContentSettingsFromPreferences(ContentSettingsRules* rules);
- void ReadManagedContentSettingsTypes(
- ContentSettingsType content_type);
+ void ReadManagedContentSettingsTypes(ContentSettingsType content_type);
void NotifyObservers(const ContentSettingsDetails& details);
@@ -143,7 +141,8 @@ class PolicyProvider : public ProviderInterface,
OriginIdentifierValueMap value_map_;
- Profile* profile_;
+ HostContentSettingsMap* map_;
+ PrefService* prefs_;
// Weak, owned by HostContentSettingsMap.
DefaultProviderInterface* default_provider_;

Powered by Google App Engine
This is Rietveld 408576698