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

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

Issue 2324133002: Replace GURL in BudgetDatabase/BudgetManager with url::Origin (Closed)
Patch Set: 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 8f7250e1d4368c4f844dbbb64cbb25990d6bfa48..0758788d29e42b90b1c5ebc63dc45cc329c55b82 100644
--- a/chrome/browser/budget_service/budget_manager.h
+++ b/chrome/browser/budget_service/budget_manager.h
@@ -13,7 +13,6 @@
#include "chrome/browser/budget_service/budget_database.h"
#include "components/keyed_service/core/keyed_service.h"
#include "third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom.h"
-#include "url/gurl.h"
class Profile;
@@ -21,6 +20,10 @@ namespace user_prefs {
class PrefRegistrySyncable;
}
+namespace url {
+class Origin;
+}
+
// A budget manager 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 origin does
@@ -42,18 +45,18 @@ class BudgetManager : public KeyedService {
// Get the budget associated with the origin. This is passed to the
// 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);
+ void GetBudget(const url::Origin& origin, const GetBudgetCallback& callback);
// 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.
- void Reserve(const GURL& origin,
+ void Reserve(const url::Origin& origin,
blink::mojom::BudgetOperationType type,
const ReserveCallback& callback);
// Spend budget, first consuming a reservation if one exists, or spend
// directly from the budget.
- void Consume(const GURL& origin,
+ void Consume(const url::Origin& origin,
blink::mojom::BudgetOperationType type,
const ConsumeCallback& callback);
@@ -62,7 +65,7 @@ class BudgetManager : public KeyedService {
// Called as a callback from BudgetDatabase after it has made a reserve
// decision.
- void DidReserve(const GURL& origin,
+ void DidReserve(const url::Origin& origin,
blink::mojom::BudgetOperationType type,
const ReserveCallback& callback,
bool success);
« 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