OLD | NEW |
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, | 124 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
125 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, | 125 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, |
126 base::WeakPtr<storage::BlobStorageContext> blob_context); | 126 base::WeakPtr<storage::BlobStorageContext> blob_context); |
127 | 127 |
128 // Async operations in progress will cancel and not run their callbacks. | 128 // Async operations in progress will cancel and not run their callbacks. |
129 virtual ~CacheStorageCache(); | 129 virtual ~CacheStorageCache(); |
130 | 130 |
131 // Match callbacks | 131 // Match callbacks |
132 void MatchImpl(scoped_ptr<ServiceWorkerFetchRequest> request, | 132 void MatchImpl(scoped_ptr<ServiceWorkerFetchRequest> request, |
133 const ResponseCallback& callback); | 133 const ResponseCallback& callback); |
134 void MatchDidOpenEntry(scoped_ptr<MatchContext> match_context, int rv); | 134 void MatchDidOpenEntry(scoped_ptr<ServiceWorkerFetchRequest> request, |
135 void MatchDidReadMetadata(scoped_ptr<MatchContext> match_context, | 135 const ResponseCallback& callback, |
| 136 scoped_ptr<disk_cache::Entry*> entry_ptr, |
| 137 int rv); |
| 138 void MatchDidReadMetadata(scoped_ptr<ServiceWorkerFetchRequest> request, |
| 139 const ResponseCallback& callback, |
| 140 disk_cache::ScopedEntryPtr entry, |
136 scoped_ptr<CacheMetadata> headers); | 141 scoped_ptr<CacheMetadata> headers); |
137 void MatchDidReadResponseBodyData(scoped_ptr<MatchContext> match_context, | |
138 int rv); | |
139 void MatchDoneWithBody(scoped_ptr<MatchContext> match_context); | |
140 | 142 |
141 // Puts the request and response object in the cache. The response body (if | 143 // Puts the request and response object in the cache. The response body (if |
142 // present) is stored in the cache, but not the request body. Returns OK on | 144 // present) is stored in the cache, but not the request body. Returns OK on |
143 // success. | 145 // success. |
144 void Put(const CacheStorageBatchOperation& operation, | 146 void Put(const CacheStorageBatchOperation& operation, |
145 const ErrorCallback& callback); | 147 const ErrorCallback& callback); |
146 void PutImpl(scoped_ptr<PutContext> put_context); | 148 void PutImpl(scoped_ptr<PutContext> put_context); |
147 void PutDidDelete(scoped_ptr<PutContext> put_context, | 149 void PutDidDelete(scoped_ptr<PutContext> put_context, |
148 CacheStorageError delete_error); | 150 CacheStorageError delete_error); |
149 void PutDidCreateEntry(scoped_ptr<PutContext> put_context, int rv); | 151 void PutDidCreateEntry(scoped_ptr<disk_cache::Entry*> entry_ptr, |
| 152 scoped_ptr<PutContext> put_context, |
| 153 int rv); |
150 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, | 154 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, |
151 int expected_bytes, | 155 int expected_bytes, |
152 int rv); | 156 int rv); |
153 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, | 157 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, |
154 scoped_ptr<BlobReader> blob_reader, | 158 scoped_ptr<BlobReader> blob_reader, |
155 disk_cache::ScopedEntryPtr entry, | 159 disk_cache::ScopedEntryPtr entry, |
156 bool success); | 160 bool success); |
157 | 161 |
158 // Returns ERROR_NOT_FOUND if not found. Otherwise deletes and returns OK. | 162 // Returns ERROR_NOT_FOUND if not found. Otherwise deletes and returns OK. |
159 void Delete(const CacheStorageBatchOperation& operation, | 163 void Delete(const CacheStorageBatchOperation& operation, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 bool memory_only_; | 221 bool memory_only_; |
218 | 222 |
219 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; | 223 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; |
220 | 224 |
221 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); | 225 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); |
222 }; | 226 }; |
223 | 227 |
224 } // namespace content | 228 } // namespace content |
225 | 229 |
226 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 230 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
OLD | NEW |