OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const GURL& origin, | 69 const GURL& origin, |
70 const base::FilePath& path, | 70 const base::FilePath& path, |
71 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, | 71 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
72 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, | 72 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, |
73 base::WeakPtr<storage::BlobStorageContext> blob_context); | 73 base::WeakPtr<storage::BlobStorageContext> blob_context); |
74 | 74 |
75 // Returns ERROR_TYPE_NOT_FOUND if not found. | 75 // Returns ERROR_TYPE_NOT_FOUND if not found. |
76 void Match(scoped_ptr<ServiceWorkerFetchRequest> request, | 76 void Match(scoped_ptr<ServiceWorkerFetchRequest> request, |
77 const ResponseCallback& callback); | 77 const ResponseCallback& callback); |
78 | 78 |
79 // Returns CACHE_STORAGE_OK and all responses in this cache. If there are no | 79 // Returns CACHE_STORAGE_OK and matched responses in this cache. If there are |
80 // responses, returns CACHE_STORAGE_OK and an empty vector. | 80 // no responses, returns CACHE_STORAGE_OK and an empty vector. |
81 void MatchAll(const ResponsesCallback& callback); | 81 void MatchAll(scoped_ptr<ServiceWorkerFetchRequest> request, |
| 82 const CacheStorageCacheQueryParams& match_params, |
| 83 const ResponsesCallback& callback); |
82 | 84 |
83 // Runs given batch operations. This corresponds to the Batch Cache Operations | 85 // Runs given batch operations. This corresponds to the Batch Cache Operations |
84 // algorithm in the spec. | 86 // algorithm in the spec. |
85 // | 87 // |
86 // |operations| cannot mix PUT and DELETE operations and cannot contain | 88 // |operations| cannot mix PUT and DELETE operations and cannot contain |
87 // multiple DELETE operations. | 89 // multiple DELETE operations. |
88 // | 90 // |
89 // In the case of the PUT operation, puts request and response objects in the | 91 // In the case of the PUT operation, puts request and response objects in the |
90 // cache and returns OK when all operations are successfully completed. | 92 // cache and returns OK when all operations are successfully completed. |
91 // In the case of the DELETE operation, returns ERROR_NOT_FOUND if a specified | 93 // In the case of the DELETE operation, returns ERROR_NOT_FOUND if a specified |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void MatchDidOpenEntry(scoped_ptr<ServiceWorkerFetchRequest> request, | 168 void MatchDidOpenEntry(scoped_ptr<ServiceWorkerFetchRequest> request, |
167 const ResponseCallback& callback, | 169 const ResponseCallback& callback, |
168 scoped_ptr<disk_cache::Entry*> entry_ptr, | 170 scoped_ptr<disk_cache::Entry*> entry_ptr, |
169 int rv); | 171 int rv); |
170 void MatchDidReadMetadata(scoped_ptr<ServiceWorkerFetchRequest> request, | 172 void MatchDidReadMetadata(scoped_ptr<ServiceWorkerFetchRequest> request, |
171 const ResponseCallback& callback, | 173 const ResponseCallback& callback, |
172 disk_cache::ScopedEntryPtr entry, | 174 disk_cache::ScopedEntryPtr entry, |
173 scoped_ptr<CacheMetadata> headers); | 175 scoped_ptr<CacheMetadata> headers); |
174 | 176 |
175 // MatchAll callbacks | 177 // MatchAll callbacks |
176 void MatchAllImpl(const ResponsesCallback& callback); | 178 void MatchAllImpl(scoped_ptr<MatchAllContext> context); |
177 void MatchAllDidOpenAllEntries( | 179 void MatchAllDidOpenAllEntries( |
178 const ResponsesCallback& callback, | 180 scoped_ptr<MatchAllContext> context, |
179 scoped_ptr<OpenAllEntriesContext> entries_context, | 181 scoped_ptr<OpenAllEntriesContext> entries_context, |
180 CacheStorageError error); | 182 CacheStorageError error); |
181 void MatchAllProcessNextEntry(scoped_ptr<MatchAllContext> context, | 183 void MatchAllProcessNextEntry(scoped_ptr<MatchAllContext> context, |
182 const Entries::iterator& iter); | 184 const Entries::iterator& iter); |
183 void MatchAllDidReadMetadata(scoped_ptr<MatchAllContext> context, | 185 void MatchAllDidReadMetadata(scoped_ptr<MatchAllContext> context, |
184 const Entries::iterator& iter, | 186 const Entries::iterator& iter, |
185 scoped_ptr<CacheMetadata> metadata); | 187 scoped_ptr<CacheMetadata> metadata); |
186 | 188 |
187 // Puts the request and response object in the cache. The response body (if | 189 // Puts the request and response object in the cache. The response body (if |
188 // present) is stored in the cache, but not the request body. Returns OK on | 190 // present) is stored in the cache, but not the request body. Returns OK on |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 bool memory_only_; | 289 bool memory_only_; |
288 | 290 |
289 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; | 291 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; |
290 | 292 |
291 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); | 293 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); |
292 }; | 294 }; |
293 | 295 |
294 } // namespace content | 296 } // namespace content |
295 | 297 |
296 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 298 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
OLD | NEW |