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

Side by Side Diff: content/browser/appcache/appcache_database.h

Issue 879393002: Expire appcaches that fail to update for "too long". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 public: 47 public:
48 struct CONTENT_EXPORT GroupRecord { 48 struct CONTENT_EXPORT GroupRecord {
49 GroupRecord(); 49 GroupRecord();
50 ~GroupRecord(); 50 ~GroupRecord();
51 51
52 int64 group_id; 52 int64 group_id;
53 GURL origin; 53 GURL origin;
54 GURL manifest_url; 54 GURL manifest_url;
55 base::Time creation_time; 55 base::Time creation_time;
56 base::Time last_access_time; 56 base::Time last_access_time;
57 base::Time last_full_update_check_time;
58 base::Time first_evictable_error_time;
57 }; 59 };
58 60
59 struct CONTENT_EXPORT CacheRecord { 61 struct CONTENT_EXPORT CacheRecord {
60 CacheRecord() 62 CacheRecord()
61 : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {} 63 : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {}
62 64
63 int64 cache_id; 65 int64 cache_id;
64 int64 group_id; 66 int64 group_id;
65 bool online_wildcard; 67 bool online_wildcard;
66 base::Time update_time; 68 base::Time update_time;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 115
114 bool FindGroup(int64 group_id, GroupRecord* record); 116 bool FindGroup(int64 group_id, GroupRecord* record);
115 bool FindGroupForManifestUrl(const GURL& manifest_url, GroupRecord* record); 117 bool FindGroupForManifestUrl(const GURL& manifest_url, GroupRecord* record);
116 bool FindGroupsForOrigin( 118 bool FindGroupsForOrigin(
117 const GURL& origin, std::vector<GroupRecord>* records); 119 const GURL& origin, std::vector<GroupRecord>* records);
118 bool FindGroupForCache(int64 cache_id, GroupRecord* record); 120 bool FindGroupForCache(int64 cache_id, GroupRecord* record);
119 bool UpdateLastAccessTime( 121 bool UpdateLastAccessTime(
120 int64 group_id, base::Time last_access_time); 122 int64 group_id, base::Time last_access_time);
121 bool LazyUpdateLastAccessTime( 123 bool LazyUpdateLastAccessTime(
122 int64 group_id, base::Time last_access_time); 124 int64 group_id, base::Time last_access_time);
125 bool UpdateEvictionTimes(int64 group_id,
126 base::Time last_full_update_check_time,
127 base::Time first_evictable_error_time);
123 bool CommitLazyLastAccessTimes(); // The destructor calls this too. 128 bool CommitLazyLastAccessTimes(); // The destructor calls this too.
124 bool InsertGroup(const GroupRecord* record); 129 bool InsertGroup(const GroupRecord* record);
125 bool DeleteGroup(int64 group_id); 130 bool DeleteGroup(int64 group_id);
126 131
127 bool FindCache(int64 cache_id, CacheRecord* record); 132 bool FindCache(int64 cache_id, CacheRecord* record);
128 bool FindCacheForGroup(int64 group_id, CacheRecord* record); 133 bool FindCacheForGroup(int64 group_id, CacheRecord* record);
129 bool FindCachesForOrigin( 134 bool FindCachesForOrigin(
130 const GURL& origin, std::vector<CacheRecord>* records); 135 const GURL& origin, std::vector<CacheRecord>* records);
131 bool InsertCache(const CacheRecord* record); 136 bool InsertCache(const CacheRecord* record);
132 bool DeleteCache(int64 cache_id); 137 bool DeleteCache(int64 cache_id);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema3to5); 251 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema3to5);
247 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema4to5); 252 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema4to5);
248 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, WasCorrutionDetected); 253 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, WasCorrutionDetected);
249 254
250 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); 255 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase);
251 }; 256 };
252 257
253 } // namespace content 258 } // namespace content
254 259
255 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 260 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache_database.cc » ('j') | content/browser/appcache/appcache_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698