summaryrefslogtreecommitdiffstats
path: root/chrome/common/appcache/chrome_appcache_service.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/appcache/chrome_appcache_service.cc')
-rw-r--r--chrome/common/appcache/chrome_appcache_service.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/common/appcache/chrome_appcache_service.cc b/chrome/common/appcache/chrome_appcache_service.cc
index c1016cb..cb1f7a3 100644
--- a/chrome/common/appcache/chrome_appcache_service.cc
+++ b/chrome/common/appcache/chrome_appcache_service.cc
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/notification_service.h"
#include "webkit/appcache/appcache_thread.h"
static bool has_initialized_thread_ids;
@@ -20,12 +21,22 @@ ChromeAppCacheService::ChromeAppCacheService(const FilePath& data_directory,
}
Initialize(is_incognito ? FilePath()
: data_directory.Append(chrome::kAppCacheDirname));
+
+ registrar_.Add(
+ this, NotificationType::PURGE_MEMORY, NotificationService::AllSources());
}
ChromeAppCacheService::~ChromeAppCacheService() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
}
+void ChromeAppCacheService::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ DCHECK(type == NotificationType::PURGE_MEMORY);
+ PurgeMemory();
+}
+
static ChromeThread::ID ToChromeThreadID(int id) {
DCHECK(has_initialized_thread_ids);
DCHECK(id == ChromeThread::DB || id == ChromeThread::IO);