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

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

Issue 2309863002: Plumb reserve method of the BudgetAPI (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 23 matching lines...) Expand all
34 // Query the BudgetManager for the cost and return it. 34 // Query the BudgetManager for the cost and return it.
35 content::BrowserContext* context = host->GetBrowserContext(); 35 content::BrowserContext* context = host->GetBrowserContext();
36 double cost = BudgetManagerFactory::GetForProfile(context)->GetCost(type); 36 double cost = BudgetManagerFactory::GetForProfile(context)->GetCost(type);
37 callback.Run(cost); 37 callback.Run(cost);
38 } 38 }
39 39
40 void BudgetServiceImpl::GetBudget(const url::Origin& origin, 40 void BudgetServiceImpl::GetBudget(const url::Origin& origin,
41 const GetBudgetCallback& callback) { 41 const GetBudgetCallback& callback) {
42 // TODO(harkness) Call the BudgetManager once it supports detailed GetBudget 42 // TODO(harkness) Call the BudgetManager once it supports detailed GetBudget
43 // calls. 43 // calls.
44 callback.Run(0); 44 callback.Run(blink::mojom::BudgetServiceErrorType::NO_ERROR, 0);
45 } 45 }
46
47 void BudgetServiceImpl::Reserve(const url::Origin& origin,
48 blink::mojom::BudgetOperationType operation,
49 const ReserveCallback& callback) {
50 callback.Run(blink::mojom::BudgetServiceErrorType::NO_ERROR, false);
Peter Beverloo 2016/09/05 17:06:16 This is missing a TODO?
harkness 2016/09/06 15:45:00 Done.
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698