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

Unified Diff: chrome/browser/budget_service/budget_manager.h

Issue 2281673002: Full hookup of BudgetManager interfaces to BudgetDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manager
Patch Set: nits Created 4 years, 3 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/budget_service/budget_manager.h
diff --git a/chrome/browser/budget_service/budget_manager.h b/chrome/browser/budget_service/budget_manager.h
index 7bc38630da4c49a06d4f70ce28a6869c8a522e88..8f7250e1d4368c4f844dbbb64cbb25990d6bfa48 100644
--- a/chrome/browser/budget_service/budget_manager.h
+++ b/chrome/browser/budget_service/budget_manager.h
@@ -17,10 +17,6 @@
class Profile;
-namespace base {
-class Clock;
-}
-
namespace user_prefs {
class PrefRegistrySyncable;
}
@@ -39,22 +35,15 @@ class BudgetManager : public KeyedService {
// Query for the base cost for any background processing.
static double GetCost(blink::mojom::BudgetOperationType type);
- using GetBudgetCallback = base::Callback<void(double budget)>;
+ using GetBudgetCallback = blink::mojom::BudgetService::GetBudgetCallback;
using ReserveCallback = base::Callback<void(bool success)>;
using ConsumeCallback = base::Callback<void(bool success)>;
// Get the budget associated with the origin. This is passed to the
- // callback. Budget will be a value between 0.0 and
- // SiteEngagementScore::kMaxPoints.
+ // callback. Budget will be a sequence of points describing the time and
+ // the budget at that time.
void GetBudget(const GURL& origin, const GetBudgetCallback& callback);
- // Store the budget associated with the origin. Budget should be a value
- // between 0.0 and SiteEngagementScore::kMaxPoints. closure will be called
- // when the store completes.
- void StoreBudget(const GURL& origin,
- double budget,
- const base::Closure& closure);
-
// Spend enough budget to cover the cost of the desired action and create
// a reservation for that action. If this returns true to the callback, then
// the next action will consume that reservation and not cost any budget.
@@ -78,12 +67,6 @@ class BudgetManager : public KeyedService {
const ReserveCallback& callback,
bool success);
- // 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_;
BudgetDatabase db_;
« no previous file with comments | « chrome/browser/budget_service/budget_database_unittest.cc ('k') | chrome/browser/budget_service/budget_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698