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, |