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

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

Issue 565913002: Sort ServiceWorkerCacheStorage::Keys() by creation order. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Strings to StringVector Created 6 years, 3 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_cache_storage.h
diff --git a/content/browser/service_worker/service_worker_cache_storage.h b/content/browser/service_worker/service_worker_cache_storage.h
index e15a0f716b2e2fac64c42cdd45f53de4ee1b5bb4..cec6389c9323123316ae209e3c2ec6c8f031b2af 100644
--- a/content/browser/service_worker/service_worker_cache_storage.h
+++ b/content/browser/service_worker/service_worker_cache_storage.h
@@ -42,12 +42,12 @@ class CONTENT_EXPORT ServiceWorkerCacheStorage {
CACHE_STORAGE_ERROR_STORAGE,
CACHE_STORAGE_ERROR_CLOSING
};
-
+ typedef std::vector<std::string> StringVector;
typedef base::Callback<void(bool, CacheStorageError)> BoolAndErrorCallback;
typedef base::Callback<void(const scoped_refptr<ServiceWorkerCache>&,
CacheStorageError)> CacheAndErrorCallback;
- typedef base::Callback<void(const std::vector<std::string>&,
- CacheStorageError)> StringsAndErrorCallback;
+ typedef base::Callback<void(const StringVector&, CacheStorageError)>
+ StringsAndErrorCallback;
ServiceWorkerCacheStorage(
const base::FilePath& origin_path,
@@ -95,7 +95,8 @@ class CONTENT_EXPORT ServiceWorkerCacheStorage {
scoped_refptr<ServiceWorkerCache> GetLoadedCache(
const std::string& cache_name);
- // Initializer and its callback are below.
+ // Initializer and its callback are below. While LazyInit is running any new
+ // operations will be queued and started in order after initialization.
void LazyInit(const base::Closure& closure);
void LazyInitDidLoadIndex(
const base::Closure& callback,
@@ -129,6 +130,9 @@ class CONTENT_EXPORT ServiceWorkerCacheStorage {
// The map of cache names to ServiceWorkerCache objects.
CacheMap cache_map_;
+ // The names of caches in the order that they were created.
+ StringVector ordered_cache_names_;
+
// The file path for this CacheStorage.
base::FilePath origin_path_;
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698