Chromium Code Reviews| 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..7fcac5543e2186d928ee5a49634a7444952f8fc2 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 { |
|
johnme
2016/08/17 13:54:02
Why does this need to be Finalized?
harkness
2016/08/18 10:23:26
m_service requires it.
johnme
2016/08/18 13:04:31
Some Mojo consumers reset their InterfacePtrs when
harkness
2016/08/22 08:57:47
It appears that mojo Ptrs can't be traced using th
johnme
2016/08/22 13:14:37
Yes, my question is whether we should be cleaning
|
| 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. |
| + void asyncGetCost(ScriptPromiseResolver*, double) const; |
|
johnme
2016/08/17 13:54:02
Nit: gotCost or onGetCost?
harkness
2016/08/18 10:23:26
Normally I hesititate on just changing verb tense,
|
| + void asyncGetBudget(PassRefPtr<ScriptState>, 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 |