Index: third_party/WebKit/Source/modules/budget/NavigatorBudget.h |
diff --git a/third_party/WebKit/Source/modules/budget/NavigatorBudget.h b/third_party/WebKit/Source/modules/budget/NavigatorBudget.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0fa8040ba2881d59e6a86df4ac335bc2e08d7608 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/budget/NavigatorBudget.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 NavigatorBudget_h |
+#define NavigatorBudget_h |
+ |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "modules/ModulesExport.h" |
+#include "platform/Supplementable.h" |
+#include "wtf/Noncopyable.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. |
Peter Beverloo
2016/07/22 12:27:01
micro nit: wrapping in this comment looks arbitrar
harkness
2016/08/03 09:34:05
Done.
|
+class NavigatorBudget final |
+ : public GarbageCollected<NavigatorBudget> |
+ , public Supplement<Navigator> { |
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorBudget); |
+ WTF_MAKE_NONCOPYABLE(NavigatorBudget); |
+ |
+public: |
+ const char* supplementName(); |
+ NavigatorBudget& from(Navigator&); |
+ |
+ static ScriptPromise getCost(ScriptState*, Navigator&, const AtomicString& actionType); |
+ static ScriptPromise getBudget(ScriptState*, Navigator&, ExceptionState&); |
+ static ScriptPromise getBudgetDetails(ScriptState*, Navigator&, ExceptionState&); |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
Peter Beverloo
2016/07/22 12:27:01
DECLARE_TRACE? I don't think we need the virtualne
harkness
2016/08/03 09:34:05
Done.
|
+ |
+private: |
+ explicit NavigatorBudget(Navigator&); |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // NavigatorBudget_h |