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.
5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_
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"
20 class SiteEngagementScoreProvider
;
22 class SiteEngagementEvictionPolicy
: public storage::QuotaEvictionPolicy
{
24 explicit SiteEngagementEvictionPolicy(
25 content::BrowserContext
* browser_context
);
26 virtual ~SiteEngagementEvictionPolicy();
28 // Overridden from storage::QuotaEvictionPolicy:
29 void GetEvictionOrigin(const scoped_refptr
<storage::SpecialStoragePolicy
>&
30 special_storage_policy
,
31 const std::map
<GURL
, int64
>& usage_map
,
33 const storage::GetOriginCallback
& callback
) override
;
36 friend class SiteEngagementEvictionPolicyTest
;
38 static GURL
CalculateEvictionOrigin(
39 const scoped_refptr
<storage::SpecialStoragePolicy
>&
40 special_storage_policy
,
41 SiteEngagementScoreProvider
* score_provider
,
42 const std::map
<GURL
, int64
>& usage_map
,
45 content::BrowserContext
* browser_context_
;
47 DISALLOW_COPY_AND_ASSIGN(SiteEngagementEvictionPolicy
);
50 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_