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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/engagement/site_engagement_eviction_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/engagement/site_engagement_eviction_policy.h
diff --git a/chrome/browser/engagement/site_engagement_eviction_policy.h b/chrome/browser/engagement/site_engagement_eviction_policy.h
new file mode 100644
index 0000000000000000000000000000000000000000..470b0ec33d2e617ca8527dedc75540081b74f7e0
--- /dev/null
+++ b/chrome/browser/engagement/site_engagement_eviction_policy.h
@@ -0,0 +1,50 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_
+#define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_
+
+#include <map>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "storage/browser/quota/quota_manager.h"
+#include "url/gurl.h"
+
+namespace content {
+class BrowserContext;
+}
+
+class SiteEngagementScoreProvider;
+
+class SiteEngagementEvictionPolicy : public storage::QuotaEvictionPolicy {
+ public:
+ explicit SiteEngagementEvictionPolicy(
+ content::BrowserContext* browser_context);
+ virtual ~SiteEngagementEvictionPolicy();
+
+ // Overridden from storage::QuotaEvictionPolicy:
+ void GetEvictionOrigin(const scoped_refptr<storage::SpecialStoragePolicy>&
+ special_storage_policy,
+ const std::map<GURL, int64>& usage_map,
+ int64 global_quota,
+ const storage::GetOriginCallback& callback) override;
+
+ private:
+ friend class SiteEngagementEvictionPolicyTest;
+
+ static GURL CalculateEvictionOrigin(
+ const scoped_refptr<storage::SpecialStoragePolicy>&
+ special_storage_policy,
+ SiteEngagementScoreProvider* score_provider,
+ const std::map<GURL, int64>& usage_map,
+ int64 global_quota);
+
+ content::BrowserContext* browser_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(SiteEngagementEvictionPolicy);
+};
+
+#endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_EVICTION_POLICY_H_
« 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