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

Unified Diff: chrome/browser/push_messaging/background_budget_service.h

Issue 1977423002: Added UMA stats to track the budget for any service worker which receives a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated UMA macro and removed array of costs. Created 4 years, 7 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/push_messaging/background_budget_service.h
diff --git a/chrome/browser/push_messaging/background_budget_service.h b/chrome/browser/push_messaging/background_budget_service.h
index 717545a02a6ac464045d7268f625bd42b39610d2..e5e5674ef6fe1c8a6f41e69183e054980450e222 100644
--- a/chrome/browser/push_messaging/background_budget_service.h
+++ b/chrome/browser/push_messaging/background_budget_service.h
@@ -33,6 +33,14 @@ class BackgroundBudgetService : public KeyedService {
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+ enum class CostType {
+ // The cost of silencing a push message.
+ SILENT_PUSH = 0,
+ };
+
+ // Query for the base cost for any background processing.
+ static double GetCost(CostType type);
+
// Get the budget associated with the origin. This is returned as the double
// budget. Budget will be a value between 0.0 and
// SiteEngagementScore::kMaxPoints.
@@ -51,6 +59,9 @@ class BackgroundBudgetService : public KeyedService {
// The clock used to vend times.
std::unique_ptr<base::Clock> clock_;
+ // Array holding the costs for various background operations.
+ static double costs_[];
Peter Beverloo 2016/05/17 15:54:28 nit: remove
harkness 2016/05/17 16:18:05 Done.
+
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(BackgroundBudgetService);
};

Powered by Google App Engine
This is Rietveld 408576698