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

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

Issue 1889513004: Make BackgroundBudgetService a KeyedService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ses_integration
Patch Set: Created 4 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/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 78cad2451b8cc285664813db833b03b24302cbbb..acc79a5a369f6583e3d996d6e29e30de8052ec62 100644
--- a/chrome/browser/push_messaging/background_budget_service.h
+++ b/chrome/browser/push_messaging/background_budget_service.h
@@ -7,6 +7,7 @@
#include <string>
+#include "components/keyed_service/core/keyed_service.h"
#include "url/gurl.h"
class Profile;
@@ -19,21 +20,23 @@ class PrefRegistrySyncable;
// worker should be able to do on behalf of the user. The budget is calculated
// based on the Site Engagment Score and is consumed when a service worker
// doesn't show a notification when it needed to.
-class BackgroundBudgetService {
+class BackgroundBudgetService : public KeyedService {
public:
+ explicit BackgroundBudgetService(Profile* profile);
Peter Beverloo 2016/04/14 16:01:18 nit: virtual destructor
harkness 2016/04/14 17:44:19 Done.
+
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
// Get the budget associated with the origin. This is returned as the double
// budget.
- static void GetBudget(Profile* profile, const GURL& origin, double& budget);
+ void GetBudget(const GURL& origin, double& budget);
// Store the budget associated with the origin.
- static void StoreBudget(Profile* profile,
- const GURL& origin,
- const double budget);
+ void StoreBudget(const GURL& origin, const double budget);
private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundBudgetService);
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(BackgroundBudgetService);
};
#endif // CHROME_BROWSER_PUSH_MESSAGING_BACKGROUND_BUDGET_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698