| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_ |
| 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "storage/browser/quota/quota_manager.h" |
| 14 #include "url/gurl.h" |
| 15 |
| 16 namespace content { |
| 17 class BrowserContext; |
| 18 } |
| 19 |
| 20 class SiteEngagementScoreProvider; |
| 21 |
| 22 class SiteEngagementEvictionPolicy |
| 23 : public storage::TemporaryStorageEvictionPolicy { |
| 24 public: |
| 25 explicit SiteEngagementEvictionPolicy( |
| 26 content::BrowserContext* browser_context); |
| 27 virtual ~SiteEngagementEvictionPolicy(); |
| 28 |
| 29 // Overridden from storage::TemporaryStorageEvictionPolicy: |
| 30 void GetEvictionOrigin( |
| 31 const std::map<GURL, int64>& usage_map, |
| 32 int64 global_quota, |
| 33 const storage::GetEvictionOriginCallback& callback) override; |
| 34 |
| 35 private: |
| 36 friend class SiteEngagementEvictionPolicyTest; |
| 37 |
| 38 static GURL CalculateEvictionOrigin( |
| 39 SiteEngagementScoreProvider* score_provider, |
| 40 const std::map<GURL, int64>& usage_map, |
| 41 int64 global_quota); |
| 42 |
| 43 content::BrowserContext* browser_context_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(SiteEngagementEvictionPolicy); |
| 46 }; |
| 47 |
| 48 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_ |
| OLD | NEW |