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

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

Issue 2265173002: Created Mojo BudgetService implementation in chrome/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_service
Patch Set: Remove use of local variable and call GetCost directly. 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
(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_
OLDNEW
« no previous file with comments | « chrome/browser/budget_service/budget_manager_unittest.cc ('k') | chrome/browser/budget_service/budget_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698