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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "content/common/cache_storage/cache_storage_types.h" | 18 #include "content/common/cache_storage/cache_storage_types.h" |
19 #include "content/common/service_worker/service_worker_types.h" | 19 #include "content/common/service_worker/service_worker_types.h" |
20 #include "net/disk_cache/disk_cache.h" | 20 #include "net/disk_cache/disk_cache.h" |
| 21 #include "storage/common/quota/quota_status_code.h" |
21 | 22 |
22 namespace net { | 23 namespace net { |
23 class URLRequestContextGetter; | 24 class URLRequestContextGetter; |
24 class IOBufferWithSize; | 25 class IOBufferWithSize; |
25 } | 26 } |
26 | 27 |
27 namespace storage { | 28 namespace storage { |
28 class BlobDataHandle; | 29 class BlobDataHandle; |
29 class BlobStorageContext; | 30 class BlobStorageContext; |
30 class QuotaManagerProxy; | 31 class QuotaManagerProxy; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 scoped_ptr<CacheMetadata> metadata); | 184 scoped_ptr<CacheMetadata> metadata); |
184 | 185 |
185 // Puts the request and response object in the cache. The response body (if | 186 // Puts the request and response object in the cache. The response body (if |
186 // present) is stored in the cache, but not the request body. Returns OK on | 187 // present) is stored in the cache, but not the request body. Returns OK on |
187 // success. | 188 // success. |
188 void Put(const CacheStorageBatchOperation& operation, | 189 void Put(const CacheStorageBatchOperation& operation, |
189 const ErrorCallback& callback); | 190 const ErrorCallback& callback); |
190 void PutImpl(scoped_ptr<PutContext> put_context); | 191 void PutImpl(scoped_ptr<PutContext> put_context); |
191 void PutDidDelete(scoped_ptr<PutContext> put_context, | 192 void PutDidDelete(scoped_ptr<PutContext> put_context, |
192 CacheStorageError delete_error); | 193 CacheStorageError delete_error); |
| 194 void PutDidGetUsageAndQuota(scoped_ptr<PutContext> put_context, |
| 195 storage::QuotaStatusCode status_code, |
| 196 int64_t usage, |
| 197 int64_t quota); |
193 void PutDidCreateEntry(scoped_ptr<disk_cache::Entry*> entry_ptr, | 198 void PutDidCreateEntry(scoped_ptr<disk_cache::Entry*> entry_ptr, |
194 scoped_ptr<PutContext> put_context, | 199 scoped_ptr<PutContext> put_context, |
195 int rv); | 200 int rv); |
196 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, | 201 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, |
197 int expected_bytes, | 202 int expected_bytes, |
198 int rv); | 203 int rv); |
199 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, | 204 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, |
200 BlobToDiskCacheIDMap::KeyType blob_to_cache_key, | 205 BlobToDiskCacheIDMap::KeyType blob_to_cache_key, |
201 disk_cache::ScopedEntryPtr entry, | 206 disk_cache::ScopedEntryPtr entry, |
202 bool success); | 207 bool success); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 bool memory_only_; | 283 bool memory_only_; |
279 | 284 |
280 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; | 285 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; |
281 | 286 |
282 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); | 287 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); |
283 }; | 288 }; |
284 | 289 |
285 } // namespace content | 290 } // namespace content |
286 | 291 |
287 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 292 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
OLD | NEW |