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

Unified Diff: content/browser/service_worker/service_worker_fetch_stores_manager.cc

Issue 424863002: Fill in some of ServiceWorkerFetchStores. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cache_storage
Patch Set: Asynchronous cache init Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_fetch_stores_manager.cc
diff --git a/content/browser/service_worker/service_worker_fetch_stores_manager.cc b/content/browser/service_worker/service_worker_fetch_stores_manager.cc
index 2fe44f21e5e25c22a386633581d80cd2f75780c1..a2b494bbeaffced256966409bbcc9cac178e3a4d 100644
--- a/content/browser/service_worker/service_worker_fetch_stores_manager.cc
+++ b/content/browser/service_worker/service_worker_fetch_stores_manager.cc
@@ -113,7 +113,7 @@ void ServiceWorkerFetchStoresManager::Has(
void ServiceWorkerFetchStoresManager::Delete(
const GURL& origin,
const std::string& key,
- const ServiceWorkerFetchStores::StoreAndErrorCallback& callback) {
+ const ServiceWorkerFetchStores::BoolAndErrorCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
ServiceWorkerFetchStores* stores =
@@ -148,16 +148,15 @@ ServiceWorkerFetchStoresManager::ServiceWorkerFetchStoresManager(
ServiceWorkerFetchStores*
ServiceWorkerFetchStoresManager::FindOrCreateServiceWorkerFetchStores(
const GURL& origin) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
ServiceWorkerFetchStoresMap::const_iterator it =
service_worker_fetch_stores_.find(origin);
if (it == service_worker_fetch_stores_.end()) {
- ServiceWorkerFetchStores::BackendType backend =
- root_path_.empty()
- ? ServiceWorkerFetchStores::BACKEND_TYPE_MEMORY
- : ServiceWorkerFetchStores::BACKEND_TYPE_SIMPLE_CACHE;
+ bool memory_only = root_path_.empty();
ServiceWorkerFetchStores* fetch_stores =
new ServiceWorkerFetchStores(ConstructOriginPath(root_path_, origin),
- backend,
+ memory_only,
base::MessageLoopProxy::current());
// The map owns fetch_stores.
service_worker_fetch_stores_.insert(std::make_pair(origin, fetch_stores));

Powered by Google App Engine
This is Rietveld 408576698