Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: storage/browser/quota/quota_manager.h

Issue 1354543002: Exclude in-use origins from storage evictions for all QuotaEvictionPolicies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hook_it_up_gooood
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // An interface for deciding which origin's storage should be evicted when the 76 // An interface for deciding which origin's storage should be evicted when the
77 // quota is exceeded. 77 // quota is exceeded.
78 class STORAGE_EXPORT QuotaEvictionPolicy { 78 class STORAGE_EXPORT QuotaEvictionPolicy {
79 public: 79 public:
80 virtual ~QuotaEvictionPolicy() {} 80 virtual ~QuotaEvictionPolicy() {}
81 81
82 // Returns the next origin to evict. It might return an empty GURL when there 82 // Returns the next origin to evict. It might return an empty GURL when there
83 // are no evictable origins. 83 // are no evictable origins.
84 virtual void GetEvictionOrigin( 84 virtual void GetEvictionOrigin(
85 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy, 85 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy,
86 const std::set<GURL>& exceptions,
86 const GetOriginCallback& callback) = 0; 87 const GetOriginCallback& callback) = 0;
87 }; 88 };
88 89
89 // An interface called by QuotaTemporaryStorageEvictor. 90 // An interface called by QuotaTemporaryStorageEvictor.
90 class STORAGE_EXPORT QuotaEvictionHandler { 91 class STORAGE_EXPORT QuotaEvictionHandler {
91 public: 92 public:
92 typedef StatusCallback EvictOriginDataCallback; 93 typedef StatusCallback EvictOriginDataCallback;
93 typedef base::Callback<void(QuotaStatusCode status, 94 typedef base::Callback<void(QuotaStatusCode status,
94 const UsageAndQuota& usage_and_quota)> 95 const UsageAndQuota& usage_and_quota)>
95 UsageAndQuotaCallback; 96 UsageAndQuotaCallback;
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); 374 void DeleteOriginFromDatabase(const GURL& origin, StorageType type);
374 375
375 void DidOriginDataEvicted(QuotaStatusCode status); 376 void DidOriginDataEvicted(QuotaStatusCode status);
376 377
377 void ReportHistogram(); 378 void ReportHistogram();
378 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, 379 void DidGetTemporaryGlobalUsageForHistogram(int64 usage,
379 int64 unlimited_usage); 380 int64 unlimited_usage);
380 void DidGetPersistentGlobalUsageForHistogram(int64 usage, 381 void DidGetPersistentGlobalUsageForHistogram(int64 usage,
381 int64 unlimited_usage); 382 int64 unlimited_usage);
382 383
384 std::set<GURL> GetEvictionOriginExceptions();
383 void DidGetEvictionOrigin(const GetOriginCallback& callback, 385 void DidGetEvictionOrigin(const GetOriginCallback& callback,
384 const GURL& origin); 386 const GURL& origin);
385 387
386 // QuotaEvictionHandler. 388 // QuotaEvictionHandler.
387 void GetEvictionOrigin(StorageType type, 389 void GetEvictionOrigin(StorageType type,
388 const GetOriginCallback& callback) override; 390 const GetOriginCallback& callback) override;
389 void EvictOriginData(const GURL& origin, 391 void EvictOriginData(const GURL& origin,
390 StorageType type, 392 StorageType type,
391 const EvictOriginDataCallback& callback) override; 393 const EvictOriginDataCallback& callback) override;
392 void GetUsageAndQuotaForEviction( 394 void GetUsageAndQuotaForEviction(
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 485
484 struct QuotaManagerDeleter { 486 struct QuotaManagerDeleter {
485 static void Destruct(const QuotaManager* manager) { 487 static void Destruct(const QuotaManager* manager) {
486 manager->DeleteOnCorrectThread(); 488 manager->DeleteOnCorrectThread();
487 } 489 }
488 }; 490 };
489 491
490 } // namespace storage 492 } // namespace storage
491 493
492 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ 494 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698