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

Unified Diff: chrome/browser/budget_service/budget_service_impl.cc

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_service_impl.cc
diff --git a/chrome/browser/budget_service/budget_service_impl.cc b/chrome/browser/budget_service/budget_service_impl.cc
index 84378291bc1d3fa10fc693ac789ab672f6a5e397..2f798cb36998b514b893f440d5ca8970b24566fa 100644
--- a/chrome/browser/budget_service/budget_service_impl.cc
+++ b/chrome/browser/budget_service/budget_service_impl.cc
@@ -39,9 +39,18 @@ void BudgetServiceImpl::GetCost(blink::mojom::BudgetOperationType type,
void BudgetServiceImpl::GetBudget(const url::Origin& origin,
const GetBudgetCallback& callback) {
- // TODO(harkness) Call the BudgetManager once it supports detailed GetBudget
- // calls.
- callback.Run(blink::mojom::BudgetServiceErrorType::NONE, 0);
+ // The RenderProcessHost should still be alive as long as any connections are
+ // alive, and if the BudgetService mojo connection is down, the
+ // BudgetServiceImpl should have been destroyed.
+ content::RenderProcessHost* host =
+ content::RenderProcessHost::FromID(render_process_id_);
+ DCHECK(host);
+
+ // Query the BudgetManager for the budget.
+ content::BrowserContext* context = host->GetBrowserContext();
+ // TODO(harkness): Convert BudgetManager to use url::Origin.
+ const GURL gurl(origin.Serialize());
+ BudgetManagerFactory::GetForProfile(context)->GetBudget(gurl, callback);
}
void BudgetServiceImpl::Reserve(const url::Origin& origin,
« no previous file with comments | « chrome/browser/budget_service/budget_manager_unittest.cc ('k') | chrome/browser/push_messaging/push_messaging_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698