Chromium Code Reviews| 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..7d3cc28073a6c0b450cfb382230d02cafa205631 100644 |
| --- a/chrome/browser/push_messaging/background_budget_service.h |
| +++ b/chrome/browser/push_messaging/background_budget_service.h |
| @@ -33,6 +33,16 @@ class BackgroundBudgetService : public KeyedService { |
| static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| + enum CostType { |
|
Peter Beverloo
2016/05/17 13:51:02
nit: enum class
harkness
2016/05/17 15:49:32
Done.
|
| + // The cost of silencing a push message. |
| + SILENT_PUSH_COST = 0, |
| + |
| + MAX_COST_TYPE |
| + }; |
| + |
| + // Query for the base cost for any background processing. |
| + static double GetBackgroundProcessingCost(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 +61,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 13:51:01
This can live in an anonymous namespace, no need t
harkness
2016/05/17 15:49:32
As discussed in person, I'm just returning the res
|
| + |
| Profile* profile_; |
| DISALLOW_COPY_AND_ASSIGN(BackgroundBudgetService); |
| }; |