| 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);
|
| }
|
|
|