| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 WEBKIT_APPCACHE_APPCACHE_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_H_ |
| 6 #define WEBKIT_APPCACHE_APPCACHE_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return true; | 65 return true; |
| 66 | 66 |
| 67 // Tie breaker. Newer caches have a larger cache ID. | 67 // Tie breaker. Newer caches have a larger cache ID. |
| 68 if (update_time_ == cache->update_time_) | 68 if (update_time_ == cache->update_time_) |
| 69 return cache_id_ > cache->cache_id_; | 69 return cache_id_ > cache->cache_id_; |
| 70 | 70 |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 | 73 |
| 74 base::Time update_time() const { return update_time_; } | 74 base::Time update_time() const { return update_time_; } |
| 75 |
| 76 int64 cache_size() const { return cache_size_; } |
| 77 |
| 75 void set_update_time(base::Time ticks) { update_time_ = ticks; } | 78 void set_update_time(base::Time ticks) { update_time_ = ticks; } |
| 76 | 79 |
| 77 // Initializes the cache with information in the manifest. | 80 // Initializes the cache with information in the manifest. |
| 78 // Do not use the manifest after this call. | 81 // Do not use the manifest after this call. |
| 79 void InitializeWithManifest(Manifest* manifest); | 82 void InitializeWithManifest(Manifest* manifest); |
| 80 | 83 |
| 81 // Initializes the cache with the information in the database records. | 84 // Initializes the cache with the information in the database records. |
| 82 void InitializeWithDatabaseRecords( | 85 void InitializeWithDatabaseRecords( |
| 83 const AppCacheDatabase::CacheRecord& cache_record, | 86 const AppCacheDatabase::CacheRecord& cache_record, |
| 84 const std::vector<AppCacheDatabase::EntryRecord>& entries, | 87 const std::vector<AppCacheDatabase::EntryRecord>& entries, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 131 |
| 129 std::vector<FallbackNamespace> fallback_namespaces_; | 132 std::vector<FallbackNamespace> fallback_namespaces_; |
| 130 std::vector<GURL> online_whitelist_namespaces_; | 133 std::vector<GURL> online_whitelist_namespaces_; |
| 131 bool online_whitelist_all_; | 134 bool online_whitelist_all_; |
| 132 | 135 |
| 133 bool is_complete_; | 136 bool is_complete_; |
| 134 | 137 |
| 135 // when this cache was last updated | 138 // when this cache was last updated |
| 136 base::Time update_time_; | 139 base::Time update_time_; |
| 137 | 140 |
| 141 int64 cache_size_; |
| 142 |
| 138 // to notify service when cache is deleted | 143 // to notify service when cache is deleted |
| 139 AppCacheService* service_; | 144 AppCacheService* service_; |
| 140 | 145 |
| 141 FRIEND_TEST(AppCacheTest, InitializeWithManifest); | 146 FRIEND_TEST(AppCacheTest, InitializeWithManifest); |
| 142 DISALLOW_COPY_AND_ASSIGN(AppCache); | 147 DISALLOW_COPY_AND_ASSIGN(AppCache); |
| 143 }; | 148 }; |
| 144 | 149 |
| 145 } // namespace appcache | 150 } // namespace appcache |
| 146 | 151 |
| 147 #endif // WEBKIT_APPCACHE_APPCACHE_H_ | 152 #endif // WEBKIT_APPCACHE_APPCACHE_H_ |
| OLD | NEW |