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

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

Issue 2752263003: Count site data size for important sites (Closed)
Patch Set: rebase Created 3 years, 8 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/important_sites_util.h
diff --git a/chrome/browser/engagement/important_sites_util.h b/chrome/browser/engagement/important_sites_util.h
index 364da285f30c9036214524bce3d0bdab493af516..161817948b2fccdb6332ff4bbb5f96ac4f136ee7 100644
--- a/chrome/browser/engagement/important_sites_util.h
+++ b/chrome/browser/engagement/important_sites_util.h
@@ -17,13 +17,24 @@ namespace user_prefs {
class PrefRegistrySyncable;
}
+// Helper methods for important sites.
+// All methods should be used on the UI thread.
class ImportantSitesUtil {
public:
+#if defined(OS_ANDROID)
+ static const int kMaxImportantSites = 5;
+#else
+ static const int kMaxImportantSites = 10;
+#endif
+
struct ImportantDomainInfo {
std::string registerable_domain;
GURL example_origin;
double engagement_score = 0;
int32_t reason_bitfield = 0;
+ // |usage| has to be initialized by ImportantSitesUsageCounter before it
+ // will contain the number of bytes used for quota and localstorage.
+ int64_t usage = 0;
};
// Do not change the values here, as they are used for UMA histograms.
@@ -36,6 +47,10 @@ class ImportantSitesUtil {
REASON_BOUNDARY
};
+ static std::string GetRegisterableDomainOrIP(const GURL& url);
+
+ static std::string GetRegisterableDomainOrIPFromHost(base::StringPiece host);
+
static bool IsDialogDisabled(Profile* profile);
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

Powered by Google App Engine
This is Rietveld 408576698