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

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

Issue 2265173002: Created Mojo BudgetService implementation in chrome/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_service
Patch Set: Remove use of local variable and call GetCost directly. Created 4 years, 4 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/push_messaging/push_messaging_notification_manager.cc
diff --git a/chrome/browser/push_messaging/push_messaging_notification_manager.cc b/chrome/browser/push_messaging/push_messaging_notification_manager.cc
index e17a922b7044a6719e2632d29e72e5ea3de0f179..0050c182d3af5f8bcd026e17748a867bd2dd648c 100644
--- a/chrome/browser/push_messaging/push_messaging_notification_manager.cc
+++ b/chrome/browser/push_messaging/push_messaging_notification_manager.cc
@@ -31,6 +31,7 @@
#include "content/public/common/notification_resources.h"
#include "content/public/common/url_constants.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include "third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
@@ -212,7 +213,8 @@ void PushMessagingNotificationManager::DidGetBudget(
// Generate histograms for the GetBudget calls which would return "no budget"
// or "low budget" if an API was available to app developers.
- double cost = BudgetManager::GetCost(BudgetManager::CostType::SILENT_PUSH);
+ double cost =
+ BudgetManager::GetCost(blink::mojom::BudgetOperationType::SILENT_PUSH);
if (budget < cost)
UMA_HISTOGRAM_COUNTS_100("PushMessaging.SESForNoBudgetOrigin", ses_score);
else if (budget < 2.0 * cost)
@@ -282,7 +284,8 @@ void PushMessagingNotificationManager::CheckForMissedNotification(
// If the service needed to show a notification but did not, update the
// budget.
- double cost = BudgetManager::GetCost(BudgetManager::CostType::SILENT_PUSH);
+ double cost =
+ BudgetManager::GetCost(blink::mojom::BudgetOperationType::SILENT_PUSH);
if (budget >= cost) {
RecordUserVisibleStatus(
content::PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_USED_GRACE);
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698