OLD | NEW |
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 "base/memory/ptr_util.h" |
7 #include "chrome/browser/budget_service/budget_manager.h" | 8 #include "chrome/browser/budget_service/budget_manager.h" |
8 #include "chrome/browser/budget_service/budget_manager_factory.h" | 9 #include "chrome/browser/budget_service/budget_manager_factory.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
11 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
12 | 13 |
13 BudgetServiceImpl::BudgetServiceImpl(int render_process_id) | 14 BudgetServiceImpl::BudgetServiceImpl(int render_process_id) |
14 : render_process_id_(render_process_id) {} | 15 : render_process_id_(render_process_id) {} |
15 | 16 |
16 BudgetServiceImpl::~BudgetServiceImpl() = default; | 17 BudgetServiceImpl::~BudgetServiceImpl() = default; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // BudgetServiceImpl should have been destroyed. | 61 // BudgetServiceImpl should have been destroyed. |
61 content::RenderProcessHost* host = | 62 content::RenderProcessHost* host = |
62 content::RenderProcessHost::FromID(render_process_id_); | 63 content::RenderProcessHost::FromID(render_process_id_); |
63 DCHECK(host); | 64 DCHECK(host); |
64 | 65 |
65 // Request a reservation from the BudgetManager. | 66 // Request a reservation from the BudgetManager. |
66 content::BrowserContext* context = host->GetBrowserContext(); | 67 content::BrowserContext* context = host->GetBrowserContext(); |
67 BudgetManagerFactory::GetForProfile(context)->Reserve(origin, operation, | 68 BudgetManagerFactory::GetForProfile(context)->Reserve(origin, operation, |
68 callback); | 69 callback); |
69 } | 70 } |
OLD | NEW |