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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // An interface for deciding which origin's storage should be evicted when the | 75 // An interface for deciding which origin's storage should be evicted when the |
76 // quota is exceeded. | 76 // quota is exceeded. |
77 class STORAGE_EXPORT QuotaEvictionPolicy { | 77 class STORAGE_EXPORT QuotaEvictionPolicy { |
78 public: | 78 public: |
79 virtual ~QuotaEvictionPolicy() {} | 79 virtual ~QuotaEvictionPolicy() {} |
80 | 80 |
81 // Returns the next origin to evict. It might return an empty GURL when there | 81 // Returns the next origin to evict. It might return an empty GURL when there |
82 // are no evictable origins. | 82 // are no evictable origins. |
83 virtual void GetEvictionOrigin( | 83 virtual void GetEvictionOrigin( |
84 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy, | 84 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy, |
| 85 const std::set<GURL>& exceptions, |
85 const std::map<GURL, int64>& usage_map, | 86 const std::map<GURL, int64>& usage_map, |
86 int64 global_quota, | 87 int64 global_quota, |
87 const GetOriginCallback& callback) = 0; | 88 const GetOriginCallback& callback) = 0; |
88 }; | 89 }; |
89 | 90 |
90 // An interface called by QuotaTemporaryStorageEvictor. | 91 // An interface called by QuotaTemporaryStorageEvictor. |
91 class STORAGE_EXPORT QuotaEvictionHandler { | 92 class STORAGE_EXPORT QuotaEvictionHandler { |
92 public: | 93 public: |
93 typedef StatusCallback EvictOriginDataCallback; | 94 typedef StatusCallback EvictOriginDataCallback; |
94 typedef base::Callback<void(QuotaStatusCode status, | 95 typedef base::Callback<void(QuotaStatusCode status, |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); | 377 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); |
377 | 378 |
378 void DidOriginDataEvicted(QuotaStatusCode status); | 379 void DidOriginDataEvicted(QuotaStatusCode status); |
379 | 380 |
380 void ReportHistogram(); | 381 void ReportHistogram(); |
381 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, | 382 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, |
382 int64 unlimited_usage); | 383 int64 unlimited_usage); |
383 void DidGetPersistentGlobalUsageForHistogram(int64 usage, | 384 void DidGetPersistentGlobalUsageForHistogram(int64 usage, |
384 int64 unlimited_usage); | 385 int64 unlimited_usage); |
385 | 386 |
| 387 std::set<GURL> GetEvictionOriginExceptions(); |
386 void DidGetEvictionOrigin(const GetOriginCallback& callback, | 388 void DidGetEvictionOrigin(const GetOriginCallback& callback, |
387 const GURL& origin); | 389 const GURL& origin); |
388 | 390 |
389 // QuotaEvictionHandler. | 391 // QuotaEvictionHandler. |
390 void GetEvictionOrigin(StorageType type, | 392 void GetEvictionOrigin(StorageType type, |
391 int64 global_quota, | 393 int64 global_quota, |
392 const GetOriginCallback& callback) override; | 394 const GetOriginCallback& callback) override; |
393 void EvictOriginData(const GURL& origin, | 395 void EvictOriginData(const GURL& origin, |
394 StorageType type, | 396 StorageType type, |
395 const EvictOriginDataCallback& callback) override; | 397 const EvictOriginDataCallback& callback) override; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 486 |
485 struct QuotaManagerDeleter { | 487 struct QuotaManagerDeleter { |
486 static void Destruct(const QuotaManager* manager) { | 488 static void Destruct(const QuotaManager* manager) { |
487 manager->DeleteOnCorrectThread(); | 489 manager->DeleteOnCorrectThread(); |
488 } | 490 } |
489 }; | 491 }; |
490 | 492 |
491 } // namespace storage | 493 } // namespace storage |
492 | 494 |
493 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 495 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
OLD | NEW |