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

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

Issue 1889513004: Make BackgroundBudgetService a KeyedService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ses_integration
Patch Set: Apply diffs to master branch to remove SES dependency 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.cc
diff --git a/chrome/browser/push_messaging/background_budget_service.cc b/chrome/browser/push_messaging/background_budget_service.cc
index ef24a41a0ab4d659755f7f6ee30b635cff68b2f5..48d27f4a800789119862fd4dceeb71cbf0c5c181 100644
--- a/chrome/browser/push_messaging/background_budget_service.cc
+++ b/chrome/browser/push_messaging/background_budget_service.cc
@@ -25,24 +25,26 @@ std::string GetBudgetStringForOrigin(Profile* profile, const GURL& origin) {
} // namespace
+BackgroundBudgetService::BackgroundBudgetService(Profile* profile)
+ : profile_(profile) {
+ DCHECK(profile);
+}
+
// static
void BackgroundBudgetService::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterDictionaryPref(prefs::kBackgroundBudgetMap);
}
-// static
-std::string BackgroundBudgetService::GetBudget(Profile* profile,
- const GURL& origin) {
- return GetBudgetStringForOrigin(profile, origin);
+std::string BackgroundBudgetService::GetBudget(const GURL& origin) {
+ return GetBudgetStringForOrigin(profile_, origin);
}
-// static
void BackgroundBudgetService::StoreBudget(
- Profile* profile,
const GURL& origin,
const std::string& notifications_shown) {
- DictionaryPrefUpdate update(profile->GetPrefs(), prefs::kBackgroundBudgetMap);
+ DictionaryPrefUpdate update(profile_->GetPrefs(),
+ prefs::kBackgroundBudgetMap);
base::DictionaryValue* map = update.Get();
map->SetStringWithoutPathExpansion(origin.spec(), notifications_shown);
}

Powered by Google App Engine
This is Rietveld 408576698