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 WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ |
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ | 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // If a load fails the 'group' will be NULL. | 45 // If a load fails the 'group' will be NULL. |
46 virtual void OnGroupLoaded( | 46 virtual void OnGroupLoaded( |
47 AppCacheGroup* group, const GURL& manifest_url) {} | 47 AppCacheGroup* group, const GURL& manifest_url) {} |
48 | 48 |
49 // If successfully stored 'success' will be true. | 49 // If successfully stored 'success' will be true. |
50 virtual void OnGroupAndNewestCacheStored( | 50 virtual void OnGroupAndNewestCacheStored( |
51 AppCacheGroup* group, AppCache* newest_cache, bool success, | 51 AppCacheGroup* group, AppCache* newest_cache, bool success, |
52 bool would_exceed_quota) {} | 52 bool would_exceed_quota) {} |
53 | 53 |
54 // If the operation fails, success will be false. | 54 // If the operation fails, success will be false. |
55 virtual void OnGroupMadeObsolete(AppCacheGroup* group, bool success) {} | 55 virtual void OnGroupMadeObsolete(AppCacheGroup* group, |
| 56 bool success, |
| 57 int response_code) {} |
56 | 58 |
57 // If a load fails the 'response_info' will be NULL. | 59 // If a load fails the 'response_info' will be NULL. |
58 virtual void OnResponseInfoLoaded( | 60 virtual void OnResponseInfoLoaded( |
59 AppCacheResponseInfo* response_info, int64 response_id) {} | 61 AppCacheResponseInfo* response_info, int64 response_id) {} |
60 | 62 |
61 // If no response is found, entry.response_id() and | 63 // If no response is found, entry.response_id() and |
62 // fallback_entry.response_id() will be kNoResponseId. | 64 // fallback_entry.response_id() will be kNoResponseId. |
63 // If the response is the entry for an intercept or fallback | 65 // If the response is the entry for an intercept or fallback |
64 // namespace, the url of the namespece entry is returned. | 66 // namespace, the url of the namespece entry is returned. |
65 // If a response is found, the cache id and manifest url of the | 67 // If a response is found, the cache id and manifest url of the |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 135 |
134 // Immediately updates in-memory storage, if the cache is in memory, | 136 // Immediately updates in-memory storage, if the cache is in memory, |
135 // and schedules a task to update persistent storage. If the cache is | 137 // and schedules a task to update persistent storage. If the cache is |
136 // already scheduled to be loaded, upon loading completion the entry | 138 // already scheduled to be loaded, upon loading completion the entry |
137 // will be marked. There is no delegate completion callback. | 139 // will be marked. There is no delegate completion callback. |
138 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id) = 0; | 140 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id) = 0; |
139 | 141 |
140 // Schedules a task to update persistent storage and doom the group and all | 142 // Schedules a task to update persistent storage and doom the group and all |
141 // related caches and responses for deletion. Upon completion the in-memory | 143 // related caches and responses for deletion. Upon completion the in-memory |
142 // instance is marked as obsolete and the delegate callback is called. | 144 // instance is marked as obsolete and the delegate callback is called. |
143 virtual void MakeGroupObsolete( | 145 virtual void MakeGroupObsolete(AppCacheGroup* group, |
144 AppCacheGroup* group, Delegate* delegate) = 0; | 146 Delegate* delegate, |
| 147 int response_code) = 0; |
145 | 148 |
146 // Cancels all pending callbacks for the delegate. The delegate callbacks | 149 // Cancels all pending callbacks for the delegate. The delegate callbacks |
147 // will not be invoked after, however any scheduled operations will still | 150 // will not be invoked after, however any scheduled operations will still |
148 // take place. The callbacks for subsequently scheduled operations are | 151 // take place. The callbacks for subsequently scheduled operations are |
149 // unaffected. | 152 // unaffected. |
150 void CancelDelegateCallbacks(Delegate* delegate) { | 153 void CancelDelegateCallbacks(Delegate* delegate) { |
151 DelegateReference* delegate_reference = GetDelegateReference(delegate); | 154 DelegateReference* delegate_reference = GetDelegateReference(delegate); |
152 if (delegate_reference) | 155 if (delegate_reference) |
153 delegate_reference->CancelReference(); | 156 delegate_reference->CancelReference(); |
154 } | 157 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 313 |
311 FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, DelegateReferences); | 314 FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, DelegateReferences); |
312 FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, UsageMap); | 315 FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, UsageMap); |
313 | 316 |
314 DISALLOW_COPY_AND_ASSIGN(AppCacheStorage); | 317 DISALLOW_COPY_AND_ASSIGN(AppCacheStorage); |
315 }; | 318 }; |
316 | 319 |
317 } // namespace appcache | 320 } // namespace appcache |
318 | 321 |
319 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ | 322 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ |
OLD | NEW |