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

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: 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
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 typedef std::map<CacheID, CacheContext*> CacheMap; 99 typedef std::map<CacheID, CacheContext*> CacheMap;
100 typedef std::map<std::string, CacheID> NameMap; 100 typedef std::map<std::string, CacheID> NameMap;
101 101
102 CacheContext* GetLoadedCache(const std::string& cache_name) const; 102 CacheContext* GetLoadedCache(const std::string& cache_name) const;
103 103
104 // Initializer and its callback are below. 104 // Initializer and its callback are below.
105 void LazyInit(const base::Closure& closure); 105 void LazyInit(const base::Closure& closure);
106 void LazyInitDidLoadIndex( 106 void LazyInitDidLoadIndex(
107 const base::Closure& callback, 107 const base::Closure& callback,
108 scoped_ptr<std::vector<std::string> > indexed_cache_names); 108 scoped_ptr<std::vector<std::string> > indexed_cache_names);
109 void LazyInitIterateAndLoadCacheName(
110 const base::Closure& callback,
111 scoped_ptr<std::vector<std::string> > indexed_cache_names,
112 const std::vector<std::string>::const_iterator& iter,
113 const std::string& cache_name,
114 scoped_ptr<ServiceWorkerCache> cache);
115 void LazyInitDone();
116 109
117 void DidCreateBackend(base::WeakPtr<ServiceWorkerCache> cache, 110 void DidCreateBackend(base::WeakPtr<ServiceWorkerCache> cache,
118 CacheID cache_id, 111 CacheID cache_id,
119 const CacheAndErrorCallback& callback, 112 const CacheAndErrorCallback& callback,
120 ServiceWorkerCache::ErrorType error); 113 ServiceWorkerCache::ErrorType error);
121 114
122 CacheContext* AddCacheToMaps(const std::string& cache_name, 115 CacheContext* AddCacheToMaps(const std::string& cache_name,
123 scoped_ptr<ServiceWorkerCache> cache); 116 scoped_ptr<ServiceWorkerCache> cache);
124 117
125 // The CreateCache callbacks are below. 118 // The CreateCache callbacks are below.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 scoped_ptr<CacheLoader> cache_loader_; 156 scoped_ptr<CacheLoader> cache_loader_;
164 157
165 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_; 158 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_;
166 159
167 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage); 160 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage);
168 }; 161 };
169 162
170 } // namespace content 163 } // namespace content
171 164
172 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 165 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698