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

Side by Side Diff: content/browser/cache_storage/cache_storage_dispatcher_host.cc

Issue 1719103002: CacheStorage: Expand cache.keys() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" 5 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 const ServiceWorkerFetchRequest& request, 276 const ServiceWorkerFetchRequest& request,
277 const CacheStorageCacheQueryParams& match_params) { 277 const CacheStorageCacheQueryParams& match_params) {
278 IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id); 278 IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id);
279 if (it == id_to_cache_map_.end()) { 279 if (it == id_to_cache_map_.end()) {
280 Send(new CacheStorageMsg_CacheKeysError( 280 Send(new CacheStorageMsg_CacheKeysError(
281 thread_id, request_id, blink::WebServiceWorkerCacheErrorNotFound)); 281 thread_id, request_id, blink::WebServiceWorkerCacheErrorNotFound));
282 return; 282 return;
283 } 283 }
284 284
285 scoped_refptr<CacheStorageCache> cache = it->second; 285 scoped_refptr<CacheStorageCache> cache = it->second;
286 scoped_ptr<ServiceWorkerFetchRequest> scoped_request(
287 new ServiceWorkerFetchRequest(request.url, request.method,
288 request.headers, request.referrer,
289 request.is_reload));
286 290
287 cache->Keys(base::Bind(&CacheStorageDispatcherHost::OnCacheKeysCallback, this, 291 cache->Keys(std::move(scoped_request), match_params,
292 base::Bind(&CacheStorageDispatcherHost::OnCacheKeysCallback, this,
288 thread_id, request_id, cache)); 293 thread_id, request_id, cache));
289 } 294 }
290 295
291 void CacheStorageDispatcherHost::OnCacheBatch( 296 void CacheStorageDispatcherHost::OnCacheBatch(
292 int thread_id, 297 int thread_id,
293 int request_id, 298 int request_id,
294 int cache_id, 299 int cache_id,
295 const std::vector<CacheStorageBatchOperation>& operations) { 300 const std::vector<CacheStorageBatchOperation>& operations) {
296 IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id); 301 IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id);
297 if (it == id_to_cache_map_.end()) { 302 if (it == id_to_cache_map_.end()) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); 524 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid);
520 if (it == blob_handle_store_.end()) 525 if (it == blob_handle_store_.end())
521 return; 526 return;
522 DCHECK(!it->second.empty()); 527 DCHECK(!it->second.empty());
523 it->second.pop_front(); 528 it->second.pop_front();
524 if (it->second.empty()) 529 if (it->second.empty())
525 blob_handle_store_.erase(it); 530 blob_handle_store_.erase(it);
526 } 531 }
527 532
528 } // namespace content 533 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698