summaryrefslogtreecommitdiffstats
path: root/webkit/quota/special_storage_policy.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-15 23:34:09 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-15 23:34:09 +0000
commit608ba33299c6e11d9d21f561372237a3fbe23ce8 (patch)
tree3664e7eba4abe920a06a54e7004c82b014678b7a /webkit/quota/special_storage_policy.cc
parent008521ab715815c43e6f9a1822fdf1ff8de37d25 (diff)
downloadchromium_src-608ba33299c6e11d9d21f561372237a3fbe23ce8.zip
chromium_src-608ba33299c6e11d9d21f561372237a3fbe23ce8.tar.gz
chromium_src-608ba33299c6e11d9d21f561372237a3fbe23ce8.tar.bz2
Send notifications on the IO thread when changes are made to the special storage policy. Listen for those changes in the usage tracking system and fixup the cache to accurately reflect how much usage should be characterised as "unlimited" usage.
TEST=modified quota_manager_unittest.cc Review URL: http://codereview.chromium.org/7618025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/quota/special_storage_policy.cc')
-rw-r--r--webkit/quota/special_storage_policy.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/webkit/quota/special_storage_policy.cc b/webkit/quota/special_storage_policy.cc
index c428346..8481239 100644
--- a/webkit/quota/special_storage_policy.cc
+++ b/webkit/quota/special_storage_policy.cc
@@ -6,8 +6,23 @@
namespace quota {
+SpecialStoragePolicy::Observer::~Observer() {}
+
SpecialStoragePolicy::SpecialStoragePolicy() {}
SpecialStoragePolicy::~SpecialStoragePolicy() {}
+void SpecialStoragePolicy::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void SpecialStoragePolicy::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void SpecialStoragePolicy::NotifyObservers() {
+ scoped_refptr<SpecialStoragePolicy> protect(this);
+ FOR_EACH_OBSERVER(Observer, observers_, OnSpecialStoragePolicyChanged());
+}
+
} // namespace quota