| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 bool AddOrModifyEntry(const GURL& url, const AppCacheEntry& entry); | 51 bool AddOrModifyEntry(const GURL& url, const AppCacheEntry& entry); |
| 52 | 52 |
| 53 // Removes an entry from the EntryMap, the URL must be in the set. | 53 // Removes an entry from the EntryMap, the URL must be in the set. |
| 54 void RemoveEntry(const GURL& url); | 54 void RemoveEntry(const GURL& url); |
| 55 | 55 |
| 56 // Do not store the returned object as it could be deleted anytime. | 56 // Do not store the returned object as it could be deleted anytime. |
| 57 AppCacheEntry* GetEntry(const GURL& url); | 57 AppCacheEntry* GetEntry(const GURL& url); |
| 58 | 58 |
| 59 const EntryMap& entries() const { return entries_; } | 59 const EntryMap& entries() const { return entries_; } |
| 60 | 60 |
| 61 // Returns the URL of the resource used as the fallback for 'namespace_url'. |
| 62 GURL GetFallbackEntryUrl(const GURL& namespace_url) const; |
| 63 |
| 61 AppCacheHosts& associated_hosts() { return associated_hosts_; } | 64 AppCacheHosts& associated_hosts() { return associated_hosts_; } |
| 62 | 65 |
| 63 bool IsNewerThan(AppCache* cache) const { | 66 bool IsNewerThan(AppCache* cache) const { |
| 64 // TODO(michaeln): revisit, the system clock can be set | 67 // TODO(michaeln): revisit, the system clock can be set |
| 65 // back in time which would confuse this logic. | 68 // back in time which would confuse this logic. |
| 66 if (update_time_ > cache->update_time_) | 69 if (update_time_ > cache->update_time_) |
| 67 return true; | 70 return true; |
| 68 | 71 |
| 69 // Tie breaker. Newer caches have a larger cache ID. | 72 // Tie breaker. Newer caches have a larger cache ID. |
| 70 if (update_time_ == cache->update_time_) | 73 if (update_time_ == cache->update_time_) |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 AppCacheService* service_; | 149 AppCacheService* service_; |
| 147 | 150 |
| 148 FRIEND_TEST_ALL_PREFIXES(AppCacheTest, InitializeWithManifest); | 151 FRIEND_TEST_ALL_PREFIXES(AppCacheTest, InitializeWithManifest); |
| 149 | 152 |
| 150 DISALLOW_COPY_AND_ASSIGN(AppCache); | 153 DISALLOW_COPY_AND_ASSIGN(AppCache); |
| 151 }; | 154 }; |
| 152 | 155 |
| 153 } // namespace appcache | 156 } // namespace appcache |
| 154 | 157 |
| 155 #endif // WEBKIT_APPCACHE_APPCACHE_H_ | 158 #endif // WEBKIT_APPCACHE_APPCACHE_H_ |
| OLD | NEW |