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

Unified Diff: chrome/browser/extensions/extension_content_settings_store.h

Issue 7275018: Make ExtensionContentSettingsStore refcounted. (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/extensions/extension_content_settings_store.h
diff --git a/chrome/browser/extensions/extension_content_settings_store.h b/chrome/browser/extensions/extension_content_settings_store.h
index 1f090a68ab29a5efaa4f328a60d40fcc3ec486a0..cdba78440ec9ba10ab2869a8dcff4b7654cd4667 100644
--- a/chrome/browser/extensions/extension_content_settings_store.h
+++ b/chrome/browser/extensions/extension_content_settings_store.h
@@ -27,7 +27,8 @@ class ListValue;
// by the content_settings::ExtensionProvider to integrate its settings into the
// HostContentSettingsMap and by the content settings extension API to provide
// extensions with access to content settings.
-class ExtensionContentSettingsStore {
+class ExtensionContentSettingsStore
+ : public base::RefCountedThreadSafe<ExtensionContentSettingsStore> {
public:
class Observer {
public:
@@ -38,14 +39,9 @@ class ExtensionContentSettingsStore {
virtual void OnContentSettingChanged(
const std::string& extension_id,
bool incognito) = 0;
-
- // Called when the ExtensionContentSettingsStore is being destroyed, so
- // observers can invalidate their weak references.
- virtual void OnDestruction() = 0;
};
ExtensionContentSettingsStore();
- virtual ~ExtensionContentSettingsStore();
// //////////////////////////////////////////////////////////////////////////
@@ -116,6 +112,8 @@ class ExtensionContentSettingsStore {
void RemoveObserver(Observer* observer);
private:
+ friend class base::RefCountedThreadSafe<ExtensionContentSettingsStore>;
+
struct ExtensionEntry;
struct ContentSettingSpec {
ContentSettingSpec(const ContentSettingsPattern& primary_pattern,
@@ -135,6 +133,8 @@ class ExtensionContentSettingsStore {
typedef std::list<ContentSettingSpec> ContentSettingSpecList;
+ virtual ~ExtensionContentSettingsStore();
+
ContentSetting GetContentSettingFromSpecList(
const GURL& embedded_url,
const GURL& top_level_url,
@@ -160,8 +160,6 @@ class ExtensionContentSettingsStore {
void NotifyOfContentSettingChanged(const std::string& extension_id,
bool incognito);
- void NotifyOfDestruction();
-
bool OnCorrectThread();
ExtensionEntryMap entries_;

Powered by Google App Engine
This is Rietveld 408576698