| 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 2f798cb36998b514b893f440d5ca8970b24566fa..6a202a6670cd496431df57fdddc2e693d870c843 100644
|
| --- a/chrome/browser/budget_service/budget_service_impl.cc
|
| +++ b/chrome/browser/budget_service/budget_service_impl.cc
|
| @@ -56,6 +56,17 @@ void BudgetServiceImpl::GetBudget(const url::Origin& origin,
|
| void BudgetServiceImpl::Reserve(const url::Origin& origin,
|
| blink::mojom::BudgetOperationType operation,
|
| const ReserveCallback& callback) {
|
| - // TODO(harkness): Call the BudgetManager::Reserve when it is available.
|
| - callback.Run(blink::mojom::BudgetServiceErrorType::NONE, false);
|
| + // 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);
|
| +
|
| + // Request a reservation from the BudgetManager.
|
| + content::BrowserContext* context = host->GetBrowserContext();
|
| + // TODO(harkness): Convert BudgetManager to use url::Origin.
|
| + const GURL gurl(origin.Serialize());
|
| + BudgetManagerFactory::GetForProfile(context)->Reserve(gurl, operation,
|
| + callback);
|
| }
|
|
|