| 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 #include "content/browser/cache_storage/cache_storage_manager.h" | 5 #include "content/browser/cache_storage/cache_storage_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 CacheStorage* cache_storage = FindOrCreateCacheStorage(origin); | 191 CacheStorage* cache_storage = FindOrCreateCacheStorage(origin); |
| 192 | 192 |
| 193 cache_storage->EnumerateCaches(callback); | 193 cache_storage->EnumerateCaches(callback); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void CacheStorageManager::MatchCache( | 196 void CacheStorageManager::MatchCache( |
| 197 const GURL& origin, | 197 const GURL& origin, |
| 198 const std::string& cache_name, | 198 const std::string& cache_name, |
| 199 std::unique_ptr<ServiceWorkerFetchRequest> request, | 199 std::unique_ptr<ServiceWorkerFetchRequest> request, |
| 200 const CacheStorageCacheQueryParams& match_params, |
| 200 const CacheStorageCache::ResponseCallback& callback) { | 201 const CacheStorageCache::ResponseCallback& callback) { |
| 201 CacheStorage* cache_storage = FindOrCreateCacheStorage(origin); | 202 CacheStorage* cache_storage = FindOrCreateCacheStorage(origin); |
| 202 | 203 |
| 203 cache_storage->MatchCache(cache_name, std::move(request), callback); | 204 cache_storage->MatchCache(cache_name, std::move(request), match_params, |
| 205 callback); |
| 204 } | 206 } |
| 205 | 207 |
| 206 void CacheStorageManager::MatchAllCaches( | 208 void CacheStorageManager::MatchAllCaches( |
| 207 const GURL& origin, | 209 const GURL& origin, |
| 208 std::unique_ptr<ServiceWorkerFetchRequest> request, | 210 std::unique_ptr<ServiceWorkerFetchRequest> request, |
| 211 const CacheStorageCacheQueryParams& match_params, |
| 209 const CacheStorageCache::ResponseCallback& callback) { | 212 const CacheStorageCache::ResponseCallback& callback) { |
| 210 CacheStorage* cache_storage = FindOrCreateCacheStorage(origin); | 213 CacheStorage* cache_storage = FindOrCreateCacheStorage(origin); |
| 211 | 214 |
| 212 cache_storage->MatchAllCaches(std::move(request), callback); | 215 cache_storage->MatchAllCaches(std::move(request), match_params, callback); |
| 213 } | 216 } |
| 214 | 217 |
| 215 void CacheStorageManager::SetBlobParametersForCache( | 218 void CacheStorageManager::SetBlobParametersForCache( |
| 216 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 219 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| 217 base::WeakPtr<storage::BlobStorageContext> blob_storage_context) { | 220 base::WeakPtr<storage::BlobStorageContext> blob_storage_context) { |
| 218 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 221 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 219 DCHECK(cache_storage_map_.empty()); | 222 DCHECK(cache_storage_map_.empty()); |
| 220 DCHECK(!request_context_getter_ || | 223 DCHECK(!request_context_getter_ || |
| 221 request_context_getter_.get() == request_context_getter.get()); | 224 request_context_getter_.get() == request_context_getter.get()); |
| 222 DCHECK(!blob_context_ || blob_context_.get() == blob_storage_context.get()); | 225 DCHECK(!blob_context_ || blob_context_.get() == blob_storage_context.get()); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 const base::FilePath& old_path, | 452 const base::FilePath& old_path, |
| 450 const base::FilePath& new_path) { | 453 const base::FilePath& new_path) { |
| 451 if (base::PathExists(old_path)) { | 454 if (base::PathExists(old_path)) { |
| 452 if (!base::PathExists(new_path)) | 455 if (!base::PathExists(new_path)) |
| 453 base::Move(old_path, new_path); | 456 base::Move(old_path, new_path); |
| 454 base::DeleteFile(old_path, /*recursive*/ true); | 457 base::DeleteFile(old_path, /*recursive*/ true); |
| 455 } | 458 } |
| 456 } | 459 } |
| 457 | 460 |
| 458 } // namespace content | 461 } // namespace content |
| OLD | NEW |