OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_BUDGET_SERVICE_BUDGET_SERVICE_IMPL_H_ |
| 6 #define CHROME_BROWSER_BUDGET_SERVICE_BUDGET_SERVICE_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 #include "third_party/WebKit/public/platform/modules/budget_service/budget_servi
ce.mojom.h" |
| 11 |
| 12 // Implementation of the BudgetService Mojo service provided by the browser |
| 13 // layer. It is responsible for dispatching budget requests to the |
| 14 // BudgetManager. |
| 15 class BudgetServiceImpl : public blink::mojom::BudgetService { |
| 16 public: |
| 17 static void Create(int render_process_id, |
| 18 blink::mojom::BudgetServiceRequest request); |
| 19 |
| 20 // blink::mojom::BudgetService implementation. |
| 21 void GetCost(blink::mojom::BudgetOperationType operation, |
| 22 const GetCostCallback& callback) override; |
| 23 void GetBudget(const url::Origin& origin, |
| 24 const GetBudgetCallback& callbac) override; |
| 25 |
| 26 private: |
| 27 BudgetServiceImpl(int render_process_id, |
| 28 blink::mojom::BudgetServiceRequest request); |
| 29 ~BudgetServiceImpl() override; |
| 30 |
| 31 // Render process ID is used to get the browser context. |
| 32 int render_process_id_; |
| 33 |
| 34 // The lifetime of the mojo service is tied to the lifetime of the connection. |
| 35 mojo::StrongBinding<blink::mojom::BudgetService> binding_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(BudgetServiceImpl); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_BUDGET_SERVICE_BUDGET_SERVICE_IMPL_H_ |
OLD | NEW |