| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BudgetService_h | 5 #ifndef BudgetService_h |
| 6 #define BudgetService_h | 6 #define BudgetService_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
| 10 #include "public/platform/modules/budget_service/budget_service.mojom-blink.h" | 10 #include "public/platform/modules/budget_service/budget_service.mojom-blink.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ScriptPromise reserve(ScriptState*, const AtomicString& operation); | 33 ScriptPromise reserve(ScriptState*, const AtomicString& operation); |
| 34 | 34 |
| 35 DEFINE_INLINE_TRACE() {} | 35 DEFINE_INLINE_TRACE() {} |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // Callbacks from the BudgetService to the blink layer. | 38 // Callbacks from the BudgetService to the blink layer. |
| 39 void gotCost(ScriptPromiseResolver*, double cost) const; | 39 void gotCost(ScriptPromiseResolver*, double cost) const; |
| 40 void gotBudget( | 40 void gotBudget( |
| 41 ScriptPromiseResolver*, | 41 ScriptPromiseResolver*, |
| 42 mojom::blink::BudgetServiceErrorType, | 42 mojom::blink::BudgetServiceErrorType, |
| 43 const mojo::WTFArray<mojom::blink::BudgetStatePtr> expectations) const; | 43 const WTF::Vector<mojom::blink::BudgetStatePtr> expectations) const; |
| 44 void gotReservation(ScriptPromiseResolver*, | 44 void gotReservation(ScriptPromiseResolver*, |
| 45 mojom::blink::BudgetServiceErrorType, | 45 mojom::blink::BudgetServiceErrorType, |
| 46 bool success) const; | 46 bool success) const; |
| 47 | 47 |
| 48 // Error handler for use if mojo service doesn't connect. | 48 // Error handler for use if mojo service doesn't connect. |
| 49 void onConnectionError(); | 49 void onConnectionError(); |
| 50 | 50 |
| 51 BudgetService(); | 51 BudgetService(); |
| 52 | 52 |
| 53 // Pointer to the Mojo service which will proxy calls to the browser. | 53 // Pointer to the Mojo service which will proxy calls to the browser. |
| 54 mojom::blink::BudgetServicePtr m_service; | 54 mojom::blink::BudgetServicePtr m_service; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace blink | 57 } // namespace blink |
| 58 | 58 |
| 59 #endif // BudgetService_h | 59 #endif // BudgetService_h |
| OLD | NEW |