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

Side by Side Diff: chrome/browser/engagement/site_engagement_eviction_policy.h

Issue 1221523003: Add a SiteEngagementEvictionPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get_total_engagement_points
Patch Set: remove unnecessary destructor 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
« no previous file with comments | « no previous file | chrome/browser/engagement/site_engagement_eviction_policy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 : public storage::QuotaEvictionPolicy {
23 public:
24 explicit SiteEngagementEvictionPolicy(
25 content::BrowserContext* browser_context);
26 virtual ~SiteEngagementEvictionPolicy();
27
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,
32 int64 global_quota,
33 const storage::GetOriginCallback& callback) override;
34
35 private:
36 friend class SiteEngagementEvictionPolicyTest;
37
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,
43 int64 global_quota);
44
45 content::BrowserContext* browser_context_;
46
47 DISALLOW_COPY_AND_ASSIGN(SiteEngagementEvictionPolicy);
48 };
49
50 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/engagement/site_engagement_eviction_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698