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

Unified Diff: content/browser/service_worker/service_worker_cache_storage_manager.h

Issue 444333006: Rename ServiceWorkerFetchStore/FetchStores/FetchStoresManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fetch_stores3
Patch Set: Rebase 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_cache_storage_manager.h
diff --git a/content/browser/service_worker/service_worker_fetch_stores_manager.h b/content/browser/service_worker/service_worker_cache_storage_manager.h
similarity index 26%
rename from content/browser/service_worker/service_worker_fetch_stores_manager.h
rename to content/browser/service_worker/service_worker_cache_storage_manager.h
index 1390a860a4a23fac2271a20546ea36e52ca39d7c..d70f08f221067a6c1ff36c9de4f764ef723a4e51 100644
--- a/content/browser/service_worker/service_worker_fetch_stores_manager.h
+++ b/content/browser/service_worker/service_worker_cache_storage_manager.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_STORES_MANAGER_H_
-#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_STORES_MANAGER_H_
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_MANAGER_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_MANAGER_H_
#include <map>
#include <string>
#include "base/basictypes.h"
#include "base/files/file_path.h"
-#include "content/browser/service_worker/service_worker_fetch_stores.h"
+#include "content/browser/service_worker/service_worker_cache_storage.h"
#include "content/common/content_export.h"
#include "url/gurl.h"
@@ -20,70 +20,72 @@ class SequencedTaskRunner;
namespace content {
-// Keeps track of a ServiceWorkerFetchStores per origin. There is one
-// ServiceWorkerFetchStoresManager per ServiceWorkerContextCore.
-// TODO(jkarlin): Remove ServiceWorkerFetchStores from memory once they're no
+// Keeps track of a ServiceWorkerCacheStorage per origin. There is one
+// ServiceWorkerCacheStorageManager per ServiceWorkerContextCore.
+// TODO(jkarlin): Remove ServiceWorkerCacheStorage from memory once they're no
// longer in active use.
-class CONTENT_EXPORT ServiceWorkerFetchStoresManager {
+class CONTENT_EXPORT ServiceWorkerCacheStorageManager {
public:
- static scoped_ptr<ServiceWorkerFetchStoresManager> Create(
+ static scoped_ptr<ServiceWorkerCacheStorageManager> Create(
const base::FilePath& path,
- base::SequencedTaskRunner* stores_task_runner);
+ base::SequencedTaskRunner* cache_task_runner);
- static scoped_ptr<ServiceWorkerFetchStoresManager> Create(
- ServiceWorkerFetchStoresManager* old_manager);
+ static scoped_ptr<ServiceWorkerCacheStorageManager> Create(
+ ServiceWorkerCacheStorageManager* old_manager);
- virtual ~ServiceWorkerFetchStoresManager();
+ virtual ~ServiceWorkerCacheStorageManager();
- // Methods to support the FetchStores spec. These methods call the
- // corresponding ServiceWorkerFetchStores method on the appropriate thread.
- void CreateStore(
+ // Methods to support the CacheStorage spec. These methods call the
+ // corresponding ServiceWorkerCacheStorage method on the appropriate thread.
+ void CreateCache(
const GURL& origin,
- const std::string& store_name,
- const ServiceWorkerFetchStores::StoreAndErrorCallback& callback);
- void GetStore(
+ const std::string& cache_name,
+ const ServiceWorkerCacheStorage::CacheAndErrorCallback& callback);
+ void GetCache(
const GURL& origin,
- const std::string& store_name,
- const ServiceWorkerFetchStores::StoreAndErrorCallback& callback);
- void HasStore(const GURL& origin,
- const std::string& store_name,
- const ServiceWorkerFetchStores::BoolAndErrorCallback& callback);
- void DeleteStore(
+ const std::string& cache_name,
+ const ServiceWorkerCacheStorage::CacheAndErrorCallback& callback);
+ void HasCache(
const GURL& origin,
- const std::string& store_name,
- const ServiceWorkerFetchStores::BoolAndErrorCallback& callback);
- void EnumerateStores(
+ const std::string& cache_name,
+ const ServiceWorkerCacheStorage::BoolAndErrorCallback& callback);
+ void DeleteCache(
const GURL& origin,
- const ServiceWorkerFetchStores::StringsAndErrorCallback& callback);
+ const std::string& cache_name,
+ const ServiceWorkerCacheStorage::BoolAndErrorCallback& callback);
+ void EnumerateCaches(
+ const GURL& origin,
+ const ServiceWorkerCacheStorage::StringsAndErrorCallback& callback);
// TODO(jkarlin): Add match() function.
base::FilePath root_path() const { return root_path_; }
- scoped_refptr<base::SequencedTaskRunner> stores_task_runner() const {
- return stores_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> cache_task_runner() const {
+ return cache_task_runner_;
}
private:
- typedef std::map<GURL, ServiceWorkerFetchStores*> ServiceWorkerFetchStoresMap;
+ typedef std::map<GURL, ServiceWorkerCacheStorage*>
+ ServiceWorkerCacheStorageMap;
- ServiceWorkerFetchStoresManager(
+ ServiceWorkerCacheStorageManager(
const base::FilePath& path,
- base::SequencedTaskRunner* stores_task_runner);
+ base::SequencedTaskRunner* cache_task_runner);
- // The returned ServiceWorkerFetchStores* is owned by
- // service_worker_fetch_stores_.
- ServiceWorkerFetchStores* FindOrCreateServiceWorkerFetchStores(
+ // The returned ServiceWorkerCacheStorage* is owned by
+ // service_worker_cache_storages_.
+ ServiceWorkerCacheStorage* FindOrCreateServiceWorkerCacheManager(
const GURL& origin);
base::FilePath root_path_;
- scoped_refptr<base::SequencedTaskRunner> stores_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> cache_task_runner_;
- // The map owns the stores and the stores are only accessed on
- // |stores_task_runner_|.
- ServiceWorkerFetchStoresMap service_worker_fetch_stores_;
+ // The map owns the CacheStorages and the CacheStorages are only accessed on
+ // |cache_task_runner_|.
+ ServiceWorkerCacheStorageMap cache_storage_map_;
- DISALLOW_COPY_AND_ASSIGN(ServiceWorkerFetchStoresManager);
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorageManager);
};
} // namespace content
-#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_STORES_MANAGER_H_
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698