summaryrefslogtreecommitdiffstats
path: root/chrome/browser/memory_purger.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 22:14:46 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 22:14:46 +0000
commit520cdd71da6f80dfffdd384645792de9a61abc94 (patch)
tree9c299ddab2d1bc22f0cceb9a361cd5b00952d08a /chrome/browser/memory_purger.cc
parentc4a9b44a974e39f23100e9ef1e122648b84470e3 (diff)
downloadchromium_src-520cdd71da6f80dfffdd384645792de9a61abc94.zip
chromium_src-520cdd71da6f80dfffdd384645792de9a61abc94.tar.gz
chromium_src-520cdd71da6f80dfffdd384645792de9a61abc94.tar.bz2
Introduce a notification to trigger memory purging on the IO thread and use it in ChromeAppCacheService.
TEST=manual BUG=none Review URL: http://codereview.chromium.org/547016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/memory_purger.cc')
-rw-r--r--chrome/browser/memory_purger.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc
index d230e45..fa85c66 100644
--- a/chrome/browser/memory_purger.cc
+++ b/chrome/browser/memory_purger.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/webdata/web_data_service.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
#include "net/proxy/proxy_resolver.h"
#include "net/url_request/url_request_context.h"
@@ -67,6 +68,12 @@ void PurgeMemoryIOHelper::PurgeMemoryOnIOThread() {
// Close the Safe Browsing database, freeing memory used to cache sqlite as
// well as a number of in-memory structures.
safe_browsing_service_->CloseDatabase();
+
+ // The appcache service listens for this notification.
+ NotificationService::current()->Notify(
+ NotificationType::PURGE_MEMORY,
+ Source<void>(NULL),
+ NotificationService::NoDetails());
}
// -----------------------------------------------------------------------------