Index: content/browser/appcache/appcache_storage_impl.h |
diff --git a/content/browser/appcache/appcache_storage_impl.h b/content/browser/appcache/appcache_storage_impl.h |
index 400081e5d69b5c050d54941cddacaf03f759b597..4a8ebcc3f5b81bc5391d600c5891c48e83de2c63 100644 |
--- a/content/browser/appcache/appcache_storage_impl.h |
+++ b/content/browser/appcache/appcache_storage_impl.h |
@@ -15,6 +15,7 @@ |
#include "base/files/file_path.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
+#include "base/timer/timer.h" |
#include "content/browser/appcache/appcache_database.h" |
#include "content/browser/appcache/appcache_disk_cache.h" |
#include "content/browser/appcache/appcache_storage.h" |
@@ -90,7 +91,8 @@ class AppCacheStorageImpl : public AppCacheStorage { |
class GetDeletableResponseIdsTask; |
class InsertDeletableResponseIdsTask; |
class DeleteDeletableResponseIdsTask; |
- class UpdateGroupLastAccessTimeTask; |
+ class LazyUpdateLastAccessTimeTask; |
+ class CommitLastAccessTimesTask; |
typedef std::deque<DatabaseTask*> DatabaseTaskQueue; |
typedef std::map<int64, CacheLoadTask*> PendingCacheLoads; |
@@ -114,12 +116,13 @@ class AppCacheStorageImpl : public AppCacheStorage { |
void StartDeletingResponses(const std::vector<int64>& response_ids); |
void ScheduleDeleteOneResponse(); |
void DeleteOneResponse(); |
- |
void OnDeletedOneResponse(int rv); |
void OnDiskCacheInitialized(int rv); |
void DeleteAndStartOver(); |
void DeleteAndStartOverPart2(); |
void CallScheduleReinitialize(); |
+ void LazilyCommitLastAccessTimes(); |
+ void OnLazyCommitTimer(); |
// Sometimes we can respond without having to query the database. |
bool FindResponseForMainRequestInGroup( |
@@ -171,6 +174,7 @@ class AppCacheStorageImpl : public AppCacheStorage { |
bool is_disabled_; |
scoped_ptr<AppCacheDiskCache> disk_cache_; |
+ base::OneShotTimer<AppCacheStorageImpl> lazy_commit_timer_; |
// Used to short-circuit certain operations without having to schedule |
// any tasks on the background database thread. |