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

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: Fixed hang and cleaned up browsertests 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 5a6b8b857681a27b94605ddd76559a3f0e74569a..cae6efd6797e930894ffd9742428437b560bb48f 100644
--- a/chrome/browser/budget_service/budget_service_impl.cc
+++ b/chrome/browser/budget_service/budget_service_impl.cc
@@ -39,7 +39,16 @@ 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(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);
}

Powered by Google App Engine
This is Rietveld 408576698