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

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

Issue 2947753002: CacheStorage: Migrate to BindOnce/OnceCallback/OnceClosure (Closed)
Patch Set: Untangle Batch logic (relies on AdaptCallbackForRepeating) Created 3 years, 6 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_CACHE_STORAGE_CACHE_STORAGE_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_MANAGER_H_
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_MANAGER_H_ 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Map a database identifier (computed from an origin) to the path. 51 // Map a database identifier (computed from an origin) to the path.
52 static base::FilePath ConstructOriginPath(const base::FilePath& root_path, 52 static base::FilePath ConstructOriginPath(const base::FilePath& root_path,
53 const GURL& origin); 53 const GURL& origin);
54 54
55 virtual ~CacheStorageManager(); 55 virtual ~CacheStorageManager();
56 56
57 // Methods to support the CacheStorage spec. These methods call the 57 // Methods to support the CacheStorage spec. These methods call the
58 // corresponding CacheStorage method on the appropriate thread. 58 // corresponding CacheStorage method on the appropriate thread.
59 void OpenCache(const GURL& origin, 59 void OpenCache(const GURL& origin,
60 const std::string& cache_name, 60 const std::string& cache_name,
61 const CacheStorage::CacheAndErrorCallback& callback); 61 CacheStorage::CacheAndErrorCallback callback);
62 void HasCache(const GURL& origin, 62 void HasCache(const GURL& origin,
63 const std::string& cache_name, 63 const std::string& cache_name,
64 const CacheStorage::BoolAndErrorCallback& callback); 64 CacheStorage::BoolAndErrorCallback callback);
65 void DeleteCache(const GURL& origin, 65 void DeleteCache(const GURL& origin,
66 const std::string& cache_name, 66 const std::string& cache_name,
67 const CacheStorage::BoolAndErrorCallback& callback); 67 CacheStorage::BoolAndErrorCallback callback);
68 void EnumerateCaches(const GURL& origin, 68 void EnumerateCaches(const GURL& origin,
69 const CacheStorage::IndexCallback& callback); 69 CacheStorage::IndexCallback callback);
70 void MatchCache(const GURL& origin, 70 void MatchCache(const GURL& origin,
71 const std::string& cache_name, 71 const std::string& cache_name,
72 std::unique_ptr<ServiceWorkerFetchRequest> request, 72 std::unique_ptr<ServiceWorkerFetchRequest> request,
73 const CacheStorageCacheQueryParams& match_params, 73 const CacheStorageCacheQueryParams& match_params,
74 const CacheStorageCache::ResponseCallback& callback); 74 CacheStorageCache::ResponseCallback callback);
75 void MatchAllCaches(const GURL& origin, 75 void MatchAllCaches(const GURL& origin,
76 std::unique_ptr<ServiceWorkerFetchRequest> request, 76 std::unique_ptr<ServiceWorkerFetchRequest> request,
77 const CacheStorageCacheQueryParams& match_params, 77 const CacheStorageCacheQueryParams& match_params,
78 const CacheStorageCache::ResponseCallback& callback); 78 CacheStorageCache::ResponseCallback callback);
79 79
80 // This must be called before creating any of the public *Cache functions 80 // This must be called before creating any of the public *Cache functions
81 // above. 81 // above.
82 void SetBlobParametersForCache( 82 void SetBlobParametersForCache(
83 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 83 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
84 base::WeakPtr<storage::BlobStorageContext> blob_storage_context); 84 base::WeakPtr<storage::BlobStorageContext> blob_storage_context);
85 85
86 base::WeakPtr<CacheStorageManager> AsWeakPtr() { 86 base::WeakPtr<CacheStorageManager> AsWeakPtr() {
87 return weak_ptr_factory_.GetWeakPtr(); 87 return weak_ptr_factory_.GetWeakPtr();
88 } 88 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 153 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
154 base::WeakPtr<storage::BlobStorageContext> blob_context_; 154 base::WeakPtr<storage::BlobStorageContext> blob_context_;
155 155
156 base::WeakPtrFactory<CacheStorageManager> weak_ptr_factory_; 156 base::WeakPtrFactory<CacheStorageManager> weak_ptr_factory_;
157 DISALLOW_COPY_AND_ASSIGN(CacheStorageManager); 157 DISALLOW_COPY_AND_ASSIGN(CacheStorageManager);
158 }; 158 };
159 159
160 } // namespace content 160 } // namespace content
161 161
162 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_MANAGER_H_ 162 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698