| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| 6 #define STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 6 #define STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 static const int kEvictionIntervalInMilliSeconds; | 255 static const int kEvictionIntervalInMilliSeconds; |
| 256 | 256 |
| 257 // These are kept non-const so that test code can change the value. | 257 // These are kept non-const so that test code can change the value. |
| 258 // TODO(kinuko): Make this a real const value and add a proper way to set | 258 // TODO(kinuko): Make this a real const value and add a proper way to set |
| 259 // the quota for syncable storage. (http://crbug.com/155488) | 259 // the quota for syncable storage. (http://crbug.com/155488) |
| 260 static int64 kMinimumPreserveForSystem; | 260 static int64 kMinimumPreserveForSystem; |
| 261 static int64 kSyncableStorageDefaultHostQuota; | 261 static int64 kSyncableStorageDefaultHostQuota; |
| 262 | 262 |
| 263 protected: | 263 protected: |
| 264 virtual ~QuotaManager(); | 264 ~QuotaManager() override; |
| 265 | 265 |
| 266 private: | 266 private: |
| 267 friend class base::DeleteHelper<QuotaManager>; | 267 friend class base::DeleteHelper<QuotaManager>; |
| 268 friend class base::RefCountedThreadSafe<QuotaManager, QuotaManagerDeleter>; | 268 friend class base::RefCountedThreadSafe<QuotaManager, QuotaManagerDeleter>; |
| 269 friend class content::QuotaManagerTest; | 269 friend class content::QuotaManagerTest; |
| 270 friend class content::StorageMonitorTest; | 270 friend class content::StorageMonitorTest; |
| 271 friend class content::MockQuotaManager; | 271 friend class content::MockQuotaManager; |
| 272 friend class content::MockStorageClient; | 272 friend class content::MockStorageClient; |
| 273 friend class quota_internals::QuotaInternalsProxy; | 273 friend class quota_internals::QuotaInternalsProxy; |
| 274 friend class QuotaManagerProxy; | 274 friend class QuotaManagerProxy; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 void DidOriginDataEvicted(QuotaStatusCode status); | 350 void DidOriginDataEvicted(QuotaStatusCode status); |
| 351 | 351 |
| 352 void ReportHistogram(); | 352 void ReportHistogram(); |
| 353 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, | 353 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, |
| 354 int64 unlimited_usage); | 354 int64 unlimited_usage); |
| 355 void DidGetPersistentGlobalUsageForHistogram(int64 usage, | 355 void DidGetPersistentGlobalUsageForHistogram(int64 usage, |
| 356 int64 unlimited_usage); | 356 int64 unlimited_usage); |
| 357 | 357 |
| 358 // QuotaEvictionHandler. | 358 // QuotaEvictionHandler. |
| 359 virtual void GetLRUOrigin( | 359 void GetLRUOrigin(StorageType type, |
| 360 StorageType type, | 360 const GetLRUOriginCallback& callback) override; |
| 361 const GetLRUOriginCallback& callback) override; | 361 void EvictOriginData(const GURL& origin, |
| 362 virtual void EvictOriginData( | 362 StorageType type, |
| 363 const GURL& origin, | 363 const EvictOriginDataCallback& callback) override; |
| 364 StorageType type, | 364 void GetUsageAndQuotaForEviction( |
| 365 const EvictOriginDataCallback& callback) override; | |
| 366 virtual void GetUsageAndQuotaForEviction( | |
| 367 const UsageAndQuotaCallback& callback) override; | 365 const UsageAndQuotaCallback& callback) override; |
| 368 | 366 |
| 369 void DidSetTemporaryGlobalOverrideQuota(const QuotaCallback& callback, | 367 void DidSetTemporaryGlobalOverrideQuota(const QuotaCallback& callback, |
| 370 const int64* new_quota, | 368 const int64* new_quota, |
| 371 bool success); | 369 bool success); |
| 372 void DidGetPersistentHostQuota(const std::string& host, | 370 void DidGetPersistentHostQuota(const std::string& host, |
| 373 const int64* quota, | 371 const int64* quota, |
| 374 bool success); | 372 bool success); |
| 375 void DidSetPersistentHostQuota(const std::string& host, | 373 void DidSetPersistentHostQuota(const std::string& host, |
| 376 const QuotaCallback& callback, | 374 const QuotaCallback& callback, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 449 |
| 452 struct QuotaManagerDeleter { | 450 struct QuotaManagerDeleter { |
| 453 static void Destruct(const QuotaManager* manager) { | 451 static void Destruct(const QuotaManager* manager) { |
| 454 manager->DeleteOnCorrectThread(); | 452 manager->DeleteOnCorrectThread(); |
| 455 } | 453 } |
| 456 }; | 454 }; |
| 457 | 455 |
| 458 } // namespace storage | 456 } // namespace storage |
| 459 | 457 |
| 460 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 458 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |