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