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

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

Issue 2039283002: Create new directory for budget_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added PRESUMBIT.py Created 4 years, 6 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/prefs/browser_prefs.cc ('k') | chrome/browser/push_messaging/background_budget_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index 2265c5562a3326882fc85c3062d4208f03ec6dd4..0000000000000000000000000000000000000000
--- a/chrome/browser/push_messaging/background_budget_service.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_PUSH_MESSAGING_BACKGROUND_BUDGET_SERVICE_H_
-#define CHROME_BROWSER_PUSH_MESSAGING_BACKGROUND_BUDGET_SERVICE_H_
-
-#include <memory>
-#include <string>
-
-#include "base/gtest_prod_util.h"
-#include "components/keyed_service/core/keyed_service.h"
-#include "url/gurl.h"
-
-class Profile;
-
-namespace base {
-class Clock;
-}
-
-namespace user_prefs {
-class PrefRegistrySyncable;
-}
-
-// A budget service to help Chrome decide how much background work a service
-// 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 does
-// background work on behalf of the user.
-class BackgroundBudgetService : public KeyedService {
- public:
- explicit BackgroundBudgetService(Profile* profile);
- ~BackgroundBudgetService() override;
-
- static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
-
- enum class CostType {
- // The cost of silencing a push message.
- SILENT_PUSH = 0,
- };
-
- // Query for the base cost for any background processing.
- static double GetCost(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.
- double GetBudget(const GURL& origin);
-
- // Store the budget associated with the origin. Budget should be a value
- // between 0.0 and SiteEngagementScore::kMaxPoints.
- void StoreBudget(const GURL& origin, double budget);
-
- private:
- friend class BackgroundBudgetServiceTest;
-
- // Used to allow tests to fast forward/reverse time.
- void SetClockForTesting(std::unique_ptr<base::Clock> clock);
-
- // The clock used to vend times.
- std::unique_ptr<base::Clock> clock_;
-
- Profile* profile_;
- DISALLOW_COPY_AND_ASSIGN(BackgroundBudgetService);
-};
-
-#endif // CHROME_BROWSER_PUSH_MESSAGING_BACKGROUND_BUDGET_SERVICE_H_
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/push_messaging/background_budget_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698