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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 150 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
151 DCHECK(request_context_); | 151 DCHECK(request_context_); |
152 | 152 |
153 ServiceWorkerCacheStorageMap::const_iterator it = | 153 ServiceWorkerCacheStorageMap::const_iterator it = |
154 cache_storage_map_.find(origin); | 154 cache_storage_map_.find(origin); |
155 if (it == cache_storage_map_.end()) { | 155 if (it == cache_storage_map_.end()) { |
156 bool memory_only = root_path_.empty(); | 156 bool memory_only = root_path_.empty(); |
157 ServiceWorkerCacheStorage* cache_storage = | 157 ServiceWorkerCacheStorage* cache_storage = |
158 new ServiceWorkerCacheStorage(ConstructOriginPath(root_path_, origin), | 158 new ServiceWorkerCacheStorage(ConstructOriginPath(root_path_, origin), |
159 memory_only, | 159 memory_only, |
160 cache_task_runner_, | 160 cache_task_runner_.get(), |
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 |