| 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_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ |
| 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 class BlobStorageContext; | 32 class BlobStorageContext; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 class CacheStorageCacheHandle; | 36 class CacheStorageCacheHandle; |
| 37 class CacheStorageIndex; | 37 class CacheStorageIndex; |
| 38 class CacheStorageScheduler; | 38 class CacheStorageScheduler; |
| 39 | 39 |
| 40 // TODO(jkarlin): Constrain the total bytes used per origin. | 40 // TODO(jkarlin): Constrain the total bytes used per origin. |
| 41 | 41 |
| 42 const int64_t kCacheStorageSizeUnknown = -1; |
| 43 |
| 42 // CacheStorage holds the set of caches for a given origin. It is | 44 // CacheStorage holds the set of caches for a given origin. It is |
| 43 // owned by the CacheStorageManager. This class expects to be run | 45 // owned by the CacheStorageManager. This class expects to be run |
| 44 // on the IO thread. The asynchronous methods are executed serially. | 46 // on the IO thread. The asynchronous methods are executed serially. |
| 45 class CONTENT_EXPORT CacheStorage : public CacheStorageCacheObserver { | 47 class CONTENT_EXPORT CacheStorage : public CacheStorageCacheObserver { |
| 46 public: | 48 public: |
| 47 constexpr static int64_t kSizeUnknown = -1; | |
| 48 | |
| 49 typedef base::Callback<void(bool, CacheStorageError)> BoolAndErrorCallback; | 49 typedef base::Callback<void(bool, CacheStorageError)> BoolAndErrorCallback; |
| 50 typedef base::Callback<void(std::unique_ptr<CacheStorageCacheHandle>, | 50 typedef base::Callback<void(std::unique_ptr<CacheStorageCacheHandle>, |
| 51 CacheStorageError)> | 51 CacheStorageError)> |
| 52 CacheAndErrorCallback; | 52 CacheAndErrorCallback; |
| 53 using IndexCallback = base::Callback<void(const CacheStorageIndex&)>; | 53 using IndexCallback = base::Callback<void(const CacheStorageIndex&)>; |
| 54 using SizeCallback = base::Callback<void(int64_t)>; | 54 using SizeCallback = base::Callback<void(int64_t)>; |
| 55 | 55 |
| 56 static const char kIndexFileName[]; | 56 static const char kIndexFileName[]; |
| 57 | 57 |
| 58 CacheStorage( | 58 CacheStorage( |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 base::CancelableClosure index_write_task_; | 265 base::CancelableClosure index_write_task_; |
| 266 | 266 |
| 267 base::WeakPtrFactory<CacheStorage> weak_factory_; | 267 base::WeakPtrFactory<CacheStorage> weak_factory_; |
| 268 | 268 |
| 269 DISALLOW_COPY_AND_ASSIGN(CacheStorage); | 269 DISALLOW_COPY_AND_ASSIGN(CacheStorage); |
| 270 }; | 270 }; |
| 271 | 271 |
| 272 } // namespace content | 272 } // namespace content |
| 273 | 273 |
| 274 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ | 274 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ |
| OLD | NEW |