OLD | NEW |
---|---|
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_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 if (update_time_ > cache->update_time_) | 96 if (update_time_ > cache->update_time_) |
97 return true; | 97 return true; |
98 | 98 |
99 // Tie breaker. Newer caches have a larger cache ID. | 99 // Tie breaker. Newer caches have a larger cache ID. |
100 if (update_time_ == cache->update_time_) | 100 if (update_time_ == cache->update_time_) |
101 return cache_id_ > cache->cache_id_; | 101 return cache_id_ > cache->cache_id_; |
102 | 102 |
103 return false; | 103 return false; |
104 } | 104 } |
105 | 105 |
106 // When this version was stored by an update job. | |
106 base::Time update_time() const { return update_time_; } | 107 base::Time update_time() const { return update_time_; } |
107 | 108 |
109 // Used to evict caches that fail to update in a reasonable timeframe. | |
110 base::Time newest_successful_unconditional_update_check_time() { return base:: Time(); } | |
palmer
2015/04/21 19:56:34
In the real implementation, these wouldn't really
michaeln
2015/04/21 20:20:15
Just like update_time, the value would stored on d
| |
111 base::Time oldest_failed_update_check_time() const; { return base::Time(); } | |
112 | |
108 int64 cache_size() const { return cache_size_; } | 113 int64 cache_size() const { return cache_size_; } |
109 | 114 |
110 void set_update_time(base::Time ticks) { update_time_ = ticks; } | 115 void set_update_time(base::Time ticks) { update_time_ = ticks; } |
111 | 116 |
112 // Initializes the cache with information in the manifest. | 117 // Initializes the cache with information in the manifest. |
113 // Do not use the manifest after this call. | 118 // Do not use the manifest after this call. |
114 void InitializeWithManifest(AppCacheManifest* manifest); | 119 void InitializeWithManifest(AppCacheManifest* manifest); |
115 | 120 |
116 // Initializes the cache with the information in the database records. | 121 // Initializes the cache with the information in the database records. |
117 void InitializeWithDatabaseRecords( | 122 void InitializeWithDatabaseRecords( |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 AppCacheStorage* storage_; | 206 AppCacheStorage* storage_; |
202 | 207 |
203 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, InitializeWithManifest); | 208 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, InitializeWithManifest); |
204 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, ToFromDatabaseRecords); | 209 FRIEND_TEST_ALL_PREFIXES(content::AppCacheTest, ToFromDatabaseRecords); |
205 DISALLOW_COPY_AND_ASSIGN(AppCache); | 210 DISALLOW_COPY_AND_ASSIGN(AppCache); |
206 }; | 211 }; |
207 | 212 |
208 } // namespace content | 213 } // namespace content |
209 | 214 |
210 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_H_ | 215 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_H_ |
OLD | NEW |