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

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: review 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 4ee045a9b83f324e88c24d88677614b2928264ad..d4aa22ff75630974416025af5f93d4802c86fe83 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider.h
+++ b/chrome/browser/content_settings/content_settings_policy_provider.h
@@ -21,15 +21,15 @@
class ContentSettingsDetails;
class DictionaryValue;
+class HostContentSettingsMap;
class PrefService;
-class Profile;
namespace content_settings {
class PolicyDefaultProvider : public DefaultProviderInterface,
public NotificationObserver {
public:
- explicit PolicyDefaultProvider(Profile* profile);
+ PolicyDefaultProvider(HostContentSettingsMap* map, PrefService* prefs);
virtual ~PolicyDefaultProvider();
// DefaultContentSettingsProvider implementation.
@@ -39,6 +39,8 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
ContentSetting setting);
virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const;
+ void ShutdownOnUIThread();
+
static void RegisterUserPrefs(PrefService* prefs);
// NotificationObserver implementation.
@@ -53,8 +55,6 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
// mutex deadlock.
void NotifyObservers(const ContentSettingsDetails& details);
- void UnregisterObservers();
-
// Reads the policy managed default settings.
void ReadManagedDefaultSettings();
@@ -64,10 +64,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* host_content_settings_map_;
+ PrefService* prefs_;
// Used around accesses to the managed_default_content_settings_ object to
// guarantee thread safety.
@@ -83,14 +81,13 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
class PolicyProvider : public ProviderInterface,
public NotificationObserver {
public:
- explicit PolicyProvider(Profile* profile,
- DefaultProviderInterface* default_provider);
+ 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,
@@ -112,6 +109,8 @@ class PolicyProvider : public ProviderInterface,
virtual void ClearAllContentSettingsRules(
ContentSettingsType content_type);
+ virtual void ShutdownOnUIThread();
+
// NotificationObserver implementation.
virtual void Observe(NotificationType type,
const NotificationSource& source,
@@ -128,25 +127,21 @@ 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);
- void UnregisterObservers();
-
OriginIdentifierValueMap value_map_;
- Profile* profile_;
+ HostContentSettingsMap* host_content_settings_map_;
+ PrefService* prefs_;
// Weak, owned by HostContentSettingsMap.
DefaultProviderInterface* default_provider_;
PrefChangeRegistrar pref_change_registrar_;
- NotificationRegistrar notification_registrar_;
// Used around accesses to the content_settings_ object to guarantee
// thread safety.

Powered by Google App Engine
This is Rietveld 408576698