Index: third_party/WebKit/Source/modules/budget/Budget.h |
diff --git a/third_party/WebKit/Source/modules/budget/Budget.h b/third_party/WebKit/Source/modules/budget/Budget.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d19d76dfd95f361e87c7cf4eeef981f7fb777f93 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/budget/Budget.h |
@@ -0,0 +1,45 @@ |
+// 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 Budget_h |
+#define Budget_h |
+ |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "modules/ModulesExport.h" |
+ |
+namespace blink { |
+ |
+class ExceptionState; |
+class Navigator; |
+class ScriptPromise; |
+class ScriptState; |
+ |
+// This is the entry point into the browser for the Budget API, which is |
+// designed to give origins the ability to perform background operations |
+// on the user's behalf. |
+class Budget final : |
+ public GarbageCollected<Budget>, |
+ public ScriptWrappable { |
Peter Beverloo
2016/08/03 13:25:54
nit: I wouldn't wrap these three lines. Even in Ch
harkness
2016/08/04 14:18:23
Done.
|
+ DEFINE_WRAPPERTYPEINFO(); |
+ |
+public: |
+ static Budget* create(Navigator* navigator) |
+ { |
+ return new Budget(navigator); |
Peter Beverloo
2016/08/03 13:25:54
nit: drop the |navigator| argument, we're not usin
harkness
2016/08/04 14:18:23
Done.
|
+ } |
+ |
+ static ScriptPromise getCost(ScriptState*, const AtomicString& actionType); |
+ static ScriptPromise getBudget(ScriptState*, ExceptionState&); |
Peter Beverloo
2016/08/03 13:25:54
nit: These methods shouldn't be static. NavigatorB
harkness
2016/08/04 14:18:23
Done.
|
+ |
+ DECLARE_TRACE(); |
+ |
+private: |
+ explicit Budget(Navigator*); |
+ |
+ Member<Navigator> m_navigator; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // Budget_h |