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

Unified Diff: third_party/WebKit/Source/modules/budget/BudgetService.h

Issue 2231873002: Added budget_service.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@budget_api
Patch Set: Converted BudgetChunk dictionary to BudgetState interface and other code review updates 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: third_party/WebKit/Source/modules/budget/BudgetService.h
diff --git a/third_party/WebKit/Source/modules/budget/BudgetService.h b/third_party/WebKit/Source/modules/budget/BudgetService.h
index 6d858bc7977e90f5de0f22aaf1fc36c005cadaf8..4fb060c4d88b1232c034d562fbd78a9c7b711ea8 100644
--- a/third_party/WebKit/Source/modules/budget/BudgetService.h
+++ b/third_party/WebKit/Source/modules/budget/BudgetService.h
@@ -7,16 +7,18 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "modules/ModulesExport.h"
+#include "public/platform/modules/budget_service/budget_service.mojom-blink.h"
namespace blink {
class ScriptPromise;
+class ScriptPromiseResolver;
class ScriptState;
// This is the entry point into the browser for the BudgetService API, which is
// designed to give origins the ability to perform background operations
// on the user's behalf.
-class BudgetService final : public GarbageCollected<BudgetService>, public ScriptWrappable {
+class BudgetService final : public GarbageCollectedFinalized<BudgetService>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -25,13 +27,23 @@ public:
return new BudgetService();
}
+ ~BudgetService();
+
+ // Implementation of the Budget API interface.
ScriptPromise getCost(ScriptState*, const AtomicString& actionType);
ScriptPromise getBudget(ScriptState*);
+ // Callbacks from the BudgetService to the blink layer.
Peter Beverloo 2016/08/22 17:57:55 nit: both can be private
harkness 2016/08/23 09:38:18 Done.
+ void gotCost(ScriptPromiseResolver*, double) const;
Peter Beverloo 2016/08/22 17:57:55 nit: name the double
harkness 2016/08/23 09:38:18 Done.
+ void gotBudget(ScriptPromiseResolver*, const mojo::WTFArray<mojom::blink::BudgetStatePtr>) const;
+
DEFINE_INLINE_TRACE() {}
private:
BudgetService();
+
+ // Pointer to the Mojo service which will proxy calls to the browser.
+ mojom::blink::BudgetServicePtr m_service;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698