Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: content/browser/cache_storage/cache_storage_cache.h

Issue 1578363009: CacheStorage: Add ignoreSearch option to cache.matchAll(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const GURL& origin, 67 const GURL& origin,
68 const base::FilePath& path, 68 const base::FilePath& path,
69 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, 69 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter,
70 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, 70 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy,
71 base::WeakPtr<storage::BlobStorageContext> blob_context); 71 base::WeakPtr<storage::BlobStorageContext> blob_context);
72 72
73 // Returns ERROR_TYPE_NOT_FOUND if not found. 73 // Returns ERROR_TYPE_NOT_FOUND if not found.
74 void Match(scoped_ptr<ServiceWorkerFetchRequest> request, 74 void Match(scoped_ptr<ServiceWorkerFetchRequest> request,
75 const ResponseCallback& callback); 75 const ResponseCallback& callback);
76 76
77 // Returns CACHE_STORAGE_OK and all responses in this cache. If there are no 77 // Returns CACHE_STORAGE_OK and matched responses in this cache. If there are
78 // responses, returns CACHE_STORAGE_OK and an empty vector. 78 // no responses, returns CACHE_STORAGE_OK and an empty vector.
79 void MatchAll(const ResponsesCallback& callback); 79 void MatchAll(scoped_ptr<ServiceWorkerFetchRequest> request,
80 const CacheStorageCacheQueryParams& match_params,
81 const ResponsesCallback& callback);
80 82
81 // Runs given batch operations. This corresponds to the Batch Cache Operations 83 // Runs given batch operations. This corresponds to the Batch Cache Operations
82 // algorithm in the spec. 84 // algorithm in the spec.
83 // 85 //
84 // |operations| cannot mix PUT and DELETE operations and cannot contain 86 // |operations| cannot mix PUT and DELETE operations and cannot contain
85 // multiple DELETE operations. 87 // multiple DELETE operations.
86 // 88 //
87 // In the case of the PUT operation, puts request and response objects in the 89 // In the case of the PUT operation, puts request and response objects in the
88 // cache and returns OK when all operations are successfully completed. 90 // cache and returns OK when all operations are successfully completed.
89 // In the case of the DELETE operation, returns ERROR_NOT_FOUND if a specified 91 // 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
164 void MatchDidOpenEntry(scoped_ptr<ServiceWorkerFetchRequest> request, 166 void MatchDidOpenEntry(scoped_ptr<ServiceWorkerFetchRequest> request,
165 const ResponseCallback& callback, 167 const ResponseCallback& callback,
166 scoped_ptr<disk_cache::Entry*> entry_ptr, 168 scoped_ptr<disk_cache::Entry*> entry_ptr,
167 int rv); 169 int rv);
168 void MatchDidReadMetadata(scoped_ptr<ServiceWorkerFetchRequest> request, 170 void MatchDidReadMetadata(scoped_ptr<ServiceWorkerFetchRequest> request,
169 const ResponseCallback& callback, 171 const ResponseCallback& callback,
170 disk_cache::ScopedEntryPtr entry, 172 disk_cache::ScopedEntryPtr entry,
171 scoped_ptr<CacheMetadata> headers); 173 scoped_ptr<CacheMetadata> headers);
172 174
173 // MatchAll callbacks 175 // MatchAll callbacks
174 void MatchAllImpl(const ResponsesCallback& callback); 176 void MatchAllImpl(scoped_ptr<MatchAllContext> context);
175 void MatchAllDidOpenAllEntries( 177 void MatchAllDidOpenAllEntries(
176 const ResponsesCallback& callback, 178 scoped_ptr<MatchAllContext> context,
177 scoped_ptr<OpenAllEntriesContext> entries_context, 179 scoped_ptr<OpenAllEntriesContext> entries_context,
178 CacheStorageError error); 180 CacheStorageError error);
179 void MatchAllProcessNextEntry(scoped_ptr<MatchAllContext> context, 181 void MatchAllProcessNextEntry(scoped_ptr<MatchAllContext> context,
180 const Entries::iterator& iter); 182 const Entries::iterator& iter);
181 void MatchAllDidReadMetadata(scoped_ptr<MatchAllContext> context, 183 void MatchAllDidReadMetadata(scoped_ptr<MatchAllContext> context,
182 const Entries::iterator& iter, 184 const Entries::iterator& iter,
183 scoped_ptr<CacheMetadata> metadata); 185 scoped_ptr<CacheMetadata> metadata);
184 186
185 // Puts the request and response object in the cache. The response body (if 187 // Puts the request and response object in the cache. The response body (if
186 // present) is stored in the cache, but not the request body. Returns OK on 188 // present) is stored in the cache, but not the request body. Returns OK on
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 bool memory_only_; 280 bool memory_only_;
279 281
280 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; 282 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_;
281 283
282 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); 284 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache);
283 }; 285 };
284 286
285 } // namespace content 287 } // namespace content
286 288
287 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 289 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698