Chromium Code Reviews| Index: third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom |
| diff --git a/third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom b/third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a8666a3a0734abb5131b4f9453c9f4458be514c7 |
| --- /dev/null |
| +++ b/third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom |
| @@ -0,0 +1,29 @@ |
| +// 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. |
| + |
| +module blink.mojom; |
| + |
| +import "url/mojo/origin.mojom"; |
| + |
| +enum OperationType { |
|
johnme
2016/08/17 13:54:02
Nit: Might need to be namespaced? e.g. BudgetOpera
harkness
2016/08/18 10:23:26
Good idea.
|
| + SILENT_PUSH |
| +}; |
| + |
| +// Structure representing the budget at points in time in the future. |
| +struct BudgetState { |
| + // Amount of budget that will be available. |
|
johnme
2016/08/17 13:54:02
Please be more specific, e.g. "A lower bound for t
harkness
2016/08/18 10:23:26
Done.
|
| + double budget_at; |
| + |
| + // Time at which the budget is available, in milliseconds since 00:00:00 UTC |
| + // on 1 January 1970, at which the budget_at will be valid. |
| + double time; |
| +}; |
| + |
| +// Service through which Blink can query for the cost of particular actions and |
| +// for the budget available for an origin. |
| +interface BudgetService { |
| + GetCost(OperationType operation) => (double cost); |
| + GetBudget(url.mojom.Origin origin) => (array<BudgetState> budget); |
| +}; |
| + |