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

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

Issue 2231873002: Added budget_service.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@budget_api
Patch Set: Add a connection error handler to BudgetService 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/BudgetState.h
diff --git a/third_party/WebKit/Source/modules/budget/BudgetState.h b/third_party/WebKit/Source/modules/budget/BudgetState.h
new file mode 100644
index 0000000000000000000000000000000000000000..5805a93c1a960096cddafa75a598a560db603d67
--- /dev/null
+++ b/third_party/WebKit/Source/modules/budget/BudgetState.h
@@ -0,0 +1,42 @@
+// 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 BudgetState_h
+#define BudgetState_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/DOMTimeStamp.h"
+#include "platform/heap/GarbageCollected.h"
+
+namespace blink {
+
+class BudgetService;
+class Navigator;
+
+// This exposes the BudgetState interface which is returned from BudgetService
+// when there is a GetBudget call.
+class BudgetState final : public GarbageCollected<BudgetState>, public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+public:
+ BudgetState();
+ BudgetState(double budgetAt, DOMTimeStamp);
+ BudgetState(const BudgetState& other);
+
+ double budgetAt() const { return m_budgetAt; }
+ DOMTimeStamp time() const { return m_time; }
+
+ void setBudgetAt(const double budgetAt) { m_budgetAt = budgetAt; }
+ void setTime(const DOMTimeStamp& time) { m_time = time; }
+
+ DEFINE_INLINE_TRACE() {}
+
+private:
+ double m_budgetAt;
+ DOMTimeStamp m_time;
+};
+
+} // namespace blink
+
+#endif // BudgetState_h

Powered by Google App Engine
This is Rietveld 408576698