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

Unified Diff: chrome/browser/engagement/site_engagement_service.h

Issue 1321733004: Use the site engagement eviction policy for temporary storage eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_eviction_policy
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/engagement/site_engagement_service.h
diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h
index 60644a4a4e3f504721d10a8a2e0666eb635dac34..77223868b5dc4a278df873868752cf1e86d703d1 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -7,6 +7,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -17,6 +18,7 @@ class DictionaryValue;
class GURL;
class Profile;
+class SiteEngagementEvictionPolicy;
class SiteEngagementScore {
public:
@@ -108,7 +110,8 @@ class SiteEngagementService : public KeyedService,
public:
static SiteEngagementService* Get(Profile* profile);
- // Returns whether or not the SiteEngagementService is enabled.
+ // Returns whether or not the SiteEngagementService is enabled. Enabling
+ // dependent features will cause this to return true.
static bool IsEnabled();
explicit SiteEngagementService(Profile* profile);
@@ -117,6 +120,10 @@ class SiteEngagementService : public KeyedService,
// Update the karma score of the origin matching |url| for user navigation.
void HandleNavigation(const GURL& url);
+ SiteEngagementEvictionPolicy* site_engagement_eviction_policy() {
+ return site_engagement_eviction_policy_.get();
+ }
+
// Overridden from SiteEngagementScoreProvider:
int GetScore(const GURL& url) override;
int GetTotalEngagementPoints() override;
@@ -124,6 +131,8 @@ class SiteEngagementService : public KeyedService,
private:
Profile* profile_;
+ scoped_ptr<SiteEngagementEvictionPolicy> site_engagement_eviction_policy_;
+
// The clock used to vend times.
base::DefaultClock clock_;
« no previous file with comments | « chrome/browser/engagement/site_engagement_eviction_policy.cc ('k') | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698