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

Unified Diff: content/browser/appcache/appcache_storage_impl.h

Issue 924723002: [appcache] Don't write during startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « content/browser/appcache/appcache_database.cc ('k') | content/browser/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « content/browser/appcache/appcache_database.cc ('k') | content/browser/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698