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

Side by Side Diff: content/browser/cache_storage/cache_storage_cache.h

Issue 2112383002: [CacheStorage] Initialize the cache backend immediately upon opening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 5 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/cache_storage/cache_storage_cache.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_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 CacheStorageCache( 180 CacheStorageCache(
181 const GURL& origin, 181 const GURL& origin,
182 const std::string& cache_name, 182 const std::string& cache_name,
183 const base::FilePath& path, 183 const base::FilePath& path,
184 CacheStorage* cache_storage, 184 CacheStorage* cache_storage,
185 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 185 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
186 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, 186 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy,
187 base::WeakPtr<storage::BlobStorageContext> blob_context); 187 base::WeakPtr<storage::BlobStorageContext> blob_context);
188 188
189 // Returns true if the backend is ready to operate.
190 bool LazyInitialize();
191
192 // Returns all entries in this cache. 189 // Returns all entries in this cache.
193 void OpenAllEntries(const OpenAllEntriesCallback& callback); 190 void OpenAllEntries(const OpenAllEntriesCallback& callback);
194 void DidOpenNextEntry(std::unique_ptr<OpenAllEntriesContext> entries_context, 191 void DidOpenNextEntry(std::unique_ptr<OpenAllEntriesContext> entries_context,
195 const OpenAllEntriesCallback& callback, 192 const OpenAllEntriesCallback& callback,
196 int rv); 193 int rv);
197 194
198 // Match callbacks 195 // Match callbacks
199 void MatchImpl(std::unique_ptr<ServiceWorkerFetchRequest> request, 196 void MatchImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
200 const ResponseCallback& callback); 197 const ResponseCallback& callback);
201 void MatchDidOpenEntry(std::unique_ptr<ServiceWorkerFetchRequest> request, 198 void MatchDidOpenEntry(std::unique_ptr<ServiceWorkerFetchRequest> request,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 int64_t cache_size); 323 int64_t cache_size);
327 324
328 // Loads the backend and calls the callback with the result (true for 325 // Loads the backend and calls the callback with the result (true for
329 // success). The callback will always be called. Virtual for tests. 326 // success). The callback will always be called. Virtual for tests.
330 virtual void CreateBackend(const ErrorCallback& callback); 327 virtual void CreateBackend(const ErrorCallback& callback);
331 void CreateBackendDidCreate(const CacheStorageCache::ErrorCallback& callback, 328 void CreateBackendDidCreate(const CacheStorageCache::ErrorCallback& callback,
332 std::unique_ptr<ScopedBackendPtr> backend_ptr, 329 std::unique_ptr<ScopedBackendPtr> backend_ptr,
333 int rv); 330 int rv);
334 331
335 void InitBackend(); 332 void InitBackend();
336 void InitDidCreateBackend(CacheStorageError cache_create_error); 333 void InitDidCreateBackend(const base::Closure& callback,
337 void InitGotCacheSize(CacheStorageError cache_create_error, int cache_size); 334 CacheStorageError cache_create_error);
335 void InitGotCacheSize(const base::Closure& callback,
336 CacheStorageError cache_create_error,
337 int cache_size);
338 338
339 void PendingClosure(const base::Closure& callback); 339 void PendingClosure(const base::Closure& callback);
340 void PendingErrorCallback(const ErrorCallback& callback, 340 void PendingErrorCallback(const ErrorCallback& callback,
341 CacheStorageError error); 341 CacheStorageError error);
342 void PendingResponseCallback( 342 void PendingResponseCallback(
343 const ResponseCallback& callback, 343 const ResponseCallback& callback,
344 CacheStorageError error, 344 CacheStorageError error,
345 std::unique_ptr<ServiceWorkerResponse> response, 345 std::unique_ptr<ServiceWorkerResponse> response,
346 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); 346 std::unique_ptr<storage::BlobDataHandle> blob_data_handle);
347 void PendingResponsesCallback( 347 void PendingResponsesCallback(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 bool memory_only_; 388 bool memory_only_;
389 389
390 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; 390 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_;
391 391
392 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); 392 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache);
393 }; 393 };
394 394
395 } // namespace content 395 } // namespace content
396 396
397 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 397 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698