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

Side by Side Diff: content/browser/service_worker/service_worker_cache_storage.h

Issue 548533002: Make ServiceWorkerCacheStorage::CacheLoader::LoadCache synchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_pointers_keys
Patch Set: Rebase 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 typedef std::map<CacheID, CacheContext*> CacheMap; 98 typedef std::map<CacheID, CacheContext*> CacheMap;
99 typedef std::map<std::string, CacheID> NameMap; 99 typedef std::map<std::string, CacheID> NameMap;
100 100
101 CacheContext* GetLoadedCache(const std::string& cache_name) const; 101 CacheContext* GetLoadedCache(const std::string& cache_name) const;
102 102
103 // Initializer and its callback are below. 103 // Initializer and its callback are below.
104 void LazyInit(const base::Closure& closure); 104 void LazyInit(const base::Closure& closure);
105 void LazyInitDidLoadIndex( 105 void LazyInitDidLoadIndex(
106 const base::Closure& callback, 106 const base::Closure& callback,
107 scoped_ptr<std::vector<std::string> > indexed_cache_names); 107 scoped_ptr<std::vector<std::string> > indexed_cache_names);
108 void LazyInitIterateAndLoadCacheName(
109 const base::Closure& callback,
110 scoped_ptr<std::vector<std::string> > indexed_cache_names,
111 const std::vector<std::string>::const_iterator& iter,
112 const std::string& cache_name,
113 scoped_ptr<ServiceWorkerCache> cache);
114 void LazyInitDone();
115 108
116 CacheContext* AddCacheToMaps(const std::string& cache_name, 109 CacheContext* AddCacheToMaps(const std::string& cache_name,
117 scoped_ptr<ServiceWorkerCache> cache); 110 scoped_ptr<ServiceWorkerCache> cache);
118 111
119 // The CreateCache callbacks are below. 112 // The CreateCache callbacks are below.
120 void CreateCacheDidCreateCache(const std::string& cache_name, 113 void CreateCacheDidCreateCache(const std::string& cache_name,
121 const CacheAndErrorCallback& callback, 114 const CacheAndErrorCallback& callback,
122 scoped_ptr<ServiceWorkerCache> cache); 115 scoped_ptr<ServiceWorkerCache> cache);
123 void CreateCacheDidWriteIndex(const CacheAndErrorCallback& callback, 116 void CreateCacheDidWriteIndex(const CacheAndErrorCallback& callback,
124 base::WeakPtr<ServiceWorkerCache> cache, 117 base::WeakPtr<ServiceWorkerCache> cache,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 scoped_ptr<CacheLoader> cache_loader_; 150 scoped_ptr<CacheLoader> cache_loader_;
158 151
159 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_; 152 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_;
160 153
161 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage); 154 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage);
162 }; 155 };
163 156
164 } // namespace content 157 } // namespace content
165 158
166 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 159 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
OLDNEW
« 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