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/service_worker/service_worker_cache_storage_manager.h" | 5 #include "content/browser/service_worker/service_worker_cache_storage_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 120 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
121 | 121 |
122 ServiceWorkerCacheStorage* cache_storage = | 122 ServiceWorkerCacheStorage* cache_storage = |
123 FindOrCreateServiceWorkerCacheManager(origin); | 123 FindOrCreateServiceWorkerCacheManager(origin); |
124 | 124 |
125 cache_storage->EnumerateCaches(callback); | 125 cache_storage->EnumerateCaches(callback); |
126 } | 126 } |
127 | 127 |
128 void ServiceWorkerCacheStorageManager::SetBlobParametersForCache( | 128 void ServiceWorkerCacheStorageManager::SetBlobParametersForCache( |
129 net::URLRequestContext* request_context, | 129 net::URLRequestContext* request_context, |
130 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context) { | 130 base::WeakPtr<storage::BlobStorageContext> blob_storage_context) { |
131 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 131 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
132 DCHECK(cache_storage_map_.empty()); | 132 DCHECK(cache_storage_map_.empty()); |
133 DCHECK(!request_context_ || request_context_ == request_context); | 133 DCHECK(!request_context_ || request_context_ == request_context); |
134 DCHECK(!blob_context_ || blob_context_.get() == blob_storage_context.get()); | 134 DCHECK(!blob_context_ || blob_context_.get() == blob_storage_context.get()); |
135 request_context_ = request_context; | 135 request_context_ = request_context; |
136 blob_context_ = blob_storage_context; | 136 blob_context_ = blob_storage_context; |
137 } | 137 } |
138 | 138 |
139 ServiceWorkerCacheStorageManager::ServiceWorkerCacheStorageManager( | 139 ServiceWorkerCacheStorageManager::ServiceWorkerCacheStorageManager( |
140 const base::FilePath& path, | 140 const base::FilePath& path, |
(...skipping 20 matching lines...) Expand all Loading... |
161 request_context_, | 161 request_context_, |
162 blob_context_); | 162 blob_context_); |
163 // The map owns fetch_stores. | 163 // The map owns fetch_stores. |
164 cache_storage_map_.insert(std::make_pair(origin, cache_storage)); | 164 cache_storage_map_.insert(std::make_pair(origin, cache_storage)); |
165 return cache_storage; | 165 return cache_storage; |
166 } | 166 } |
167 return it->second; | 167 return it->second; |
168 } | 168 } |
169 | 169 |
170 } // namespace content | 170 } // namespace content |
OLD | NEW |