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

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

Issue 545533002: Move ServiceWorkerCache backend creation to a lazy init function. (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
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( 108 void LazyInitIterateAndLoadCacheName(
109 const base::Closure& callback, 109 const base::Closure& callback,
110 scoped_ptr<std::vector<std::string> > indexed_cache_names, 110 scoped_ptr<std::vector<std::string> > indexed_cache_names,
111 const std::vector<std::string>::const_iterator& iter, 111 const std::vector<std::string>::const_iterator& iter,
112 const std::string& cache_name, 112 const std::string& cache_name,
113 scoped_ptr<ServiceWorkerCache> cache); 113 scoped_ptr<ServiceWorkerCache> cache);
114 void LazyInitDone(); 114 void LazyInitDone();
115 115
116 void DidCreateBackend(base::WeakPtr<ServiceWorkerCache> cache,
117 CacheID cache_id,
118 const CacheAndErrorCallback& callback,
119 ServiceWorkerCache::ErrorType error);
120
121 CacheContext* AddCacheToMaps(const std::string& cache_name, 116 CacheContext* AddCacheToMaps(const std::string& cache_name,
122 scoped_ptr<ServiceWorkerCache> cache); 117 scoped_ptr<ServiceWorkerCache> cache);
123 118
124 // The CreateCache callbacks are below. 119 // The CreateCache callbacks are below.
125 void CreateCacheDidCreateCache(const std::string& cache_name, 120 void CreateCacheDidCreateCache(const std::string& cache_name,
126 const CacheAndErrorCallback& callback, 121 const CacheAndErrorCallback& callback,
127 scoped_ptr<ServiceWorkerCache> cache); 122 scoped_ptr<ServiceWorkerCache> cache);
128 void CreateCacheDidWriteIndex(const CacheAndErrorCallback& callback, 123 void CreateCacheDidWriteIndex(const CacheAndErrorCallback& callback,
129 base::WeakPtr<ServiceWorkerCache> cache, 124 base::WeakPtr<ServiceWorkerCache> cache,
130 CacheID id, 125 CacheID id,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 scoped_ptr<CacheLoader> cache_loader_; 157 scoped_ptr<CacheLoader> cache_loader_;
163 158
164 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_; 159 base::WeakPtrFactory<ServiceWorkerCacheStorage> weak_factory_;
165 160
166 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage); 161 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheStorage);
167 }; 162 };
168 163
169 } // namespace content 164 } // namespace content
170 165
171 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_ 166 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_STORAGE_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_cache.cc ('k') | content/browser/service_worker/service_worker_cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698