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

Side by Side Diff: chrome/browser/budget_service/budget_service_impl.cc

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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/budget_service/budget_service_impl.h" 5 #include "chrome/browser/budget_service/budget_service_impl.h"
6 6
7 #include "chrome/browser/budget_service/budget_manager.h" 7 #include "chrome/browser/budget_service/budget_manager.h"
8 #include "chrome/browser/budget_service/budget_manager_factory.h" 8 #include "chrome/browser/budget_service/budget_manager_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 30 matching lines...) Expand all
41 const GetBudgetCallback& callback) { 41 const GetBudgetCallback& callback) {
42 // The RenderProcessHost should still be alive as long as any connections are 42 // The RenderProcessHost should still be alive as long as any connections are
43 // alive, and if the BudgetService mojo connection is down, the 43 // alive, and if the BudgetService mojo connection is down, the
44 // BudgetServiceImpl should have been destroyed. 44 // BudgetServiceImpl should have been destroyed.
45 content::RenderProcessHost* host = 45 content::RenderProcessHost* host =
46 content::RenderProcessHost::FromID(render_process_id_); 46 content::RenderProcessHost::FromID(render_process_id_);
47 DCHECK(host); 47 DCHECK(host);
48 48
49 // Query the BudgetManager for the budget. 49 // Query the BudgetManager for the budget.
50 content::BrowserContext* context = host->GetBrowserContext(); 50 content::BrowserContext* context = host->GetBrowserContext();
51 // TODO(harkness): Convert BudgetManager to use url::Origin. 51 BudgetManagerFactory::GetForProfile(context)->GetBudget(origin, callback);
52 const GURL gurl(origin.Serialize());
53 BudgetManagerFactory::GetForProfile(context)->GetBudget(gurl, callback);
54 } 52 }
55 53
56 void BudgetServiceImpl::Reserve(const url::Origin& origin, 54 void BudgetServiceImpl::Reserve(const url::Origin& origin,
57 blink::mojom::BudgetOperationType operation, 55 blink::mojom::BudgetOperationType operation,
58 const ReserveCallback& callback) { 56 const ReserveCallback& callback) {
59 // TODO(harkness): Call the BudgetManager::Reserve when it is available. 57 // TODO(harkness): Call the BudgetManager::Reserve when it is available.
60 callback.Run(blink::mojom::BudgetServiceErrorType::NONE, false); 58 callback.Run(blink::mojom::BudgetServiceErrorType::NONE, false);
61 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698