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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/budget_service/budget_service_impl.h
diff --git a/chrome/browser/budget_service/budget_service_impl.h b/chrome/browser/budget_service/budget_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..080c31021795d21eee872d02e70aaa50c0017bf6
--- /dev/null
+++ b/chrome/browser/budget_service/budget_service_impl.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_BUDGET_SERVICE_BUDGET_SERVICE_IMPL_H_
+#define CHROME_BROWSER_BUDGET_SERVICE_BUDGET_SERVICE_IMPL_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom.h"
+
+// Implementation of the BudgetService Mojo service provided by the browser
+// layer. It is responsible for dispatching budget requests to the
+// BudgetManager.
+class BudgetServiceImpl : public blink::mojom::BudgetService {
+ public:
+ static void Create(int render_process_id,
+ blink::mojom::BudgetServiceRequest request);
+
+ // blink::mojom::BudgetService implementation.
+ void GetCost(blink::mojom::BudgetOperationType operation,
+ const GetCostCallback& callback) override;
+ void GetBudget(const url::Origin& origin,
+ const GetBudgetCallback& callbac) override;
+
+ private:
+ BudgetServiceImpl(int render_process_id,
+ blink::mojom::BudgetServiceRequest request);
+ ~BudgetServiceImpl() override;
+
+ // Render process ID is used to get the browser context.
+ int render_process_id_;
+
+ // The lifetime of the mojo service is tied to the lifetime of the connection.
+ mojo::StrongBinding<blink::mojom::BudgetService> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(BudgetServiceImpl);
+};
+
+#endif // CHROME_BROWSER_BUDGET_SERVICE_BUDGET_SERVICE_IMPL_H_
« 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