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..7de0366d39ab9e8db0cd4d0279f62ef9cbcba35c 100644 |
--- a/chrome/browser/engagement/important_sites_util.h |
+++ b/chrome/browser/engagement/important_sites_util.h |
@@ -8,11 +8,20 @@ |
#include <string> |
#include <vector> |
+#include "base/callback.h" |
#include "base/macros.h" |
#include "url/gurl.h" |
class Profile; |
+namespace content { |
+class DOMStorageContext; |
+} |
+ |
+namespace storage { |
+class QuotaManager; |
+} |
+ |
namespace user_prefs { |
class PrefRegistrySyncable; |
} |
@@ -24,6 +33,7 @@ class ImportantSitesUtil { |
GURL example_origin; |
double engagement_score = 0; |
int32_t reason_bitfield = 0; |
+ int64_t usage = 0; |
}; |
// Do not change the values here, as they are used for UMA histograms. |
@@ -36,6 +46,9 @@ class ImportantSitesUtil { |
REASON_BOUNDARY |
}; |
+ using UsageCallback = |
+ base::Callback<void(std::vector<ImportantDomainInfo> sites)>; |
+ |
static bool IsDialogDisabled(Profile* profile); |
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
@@ -50,6 +63,14 @@ class ImportantSitesUtil { |
Profile* profile, |
size_t max_results); |
+ // Populate the ImportantDomainInfo::usage field of each site with the amount |
+ // of storage bytes used. The |sites| vector with populated usage fields is |
+ // returned by |callback|. |
+ static void PopulateUsage(storage::QuotaManager* quota_manager, |
dmurph
2017/03/27 22:22:45
Can you document threading expectations? I guess t
dullweber
2017/03/28 14:06:45
I checked the other methods and it looks like all
|
+ content::DOMStorageContext* dom_storage, |
+ std::vector<ImportantDomainInfo> sites, |
+ UsageCallback callback); |
+ |
// Record the sites that the user chose to blacklist from clearing (in the |
// Clear Browsing Dialog) and the sites they ignored. The blacklisted sites |
// are NOT cleared as they are 'blacklisted' from the clear operation. |