Chromium Code Reviews| Index: third_party/WebKit/Source/modules/budget_service/NavigatorBudget.h |
| diff --git a/third_party/WebKit/Source/modules/budget_service/NavigatorBudget.h b/third_party/WebKit/Source/modules/budget_service/NavigatorBudget.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..89249899cff32cf438759f1aa7fba67236d5af91 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/budget_service/NavigatorBudget.h |
| @@ -0,0 +1,47 @@ |
| +// 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 BudgetAPI, which is |
|
Peter Beverloo
2016/07/01 13:21:59
nit: BudgetAPI -> Budget API
harkness
2016/07/20 09:41:48
Done.
|
| +// designed to give Service Workers the ability to perform background |
|
Peter Beverloo
2016/07/01 13:21:59
Service Workers -> origins
harkness
2016/07/20 09:41:48
Done.
|
| +// operations on the user's behalf. |
| +class MODULES_EXPORT NavigatorBudget final |
|
Peter Beverloo
2016/07/01 13:21:59
Why do you need MODULES_EXPORT here?
harkness
2016/07/20 09:41:48
Removed.
|
| + : public GarbageCollectedFinalized<NavigatorBudget> |
|
Peter Beverloo
2016/07/01 13:21:59
Why do you need a finalizer here? This can just be
harkness
2016/07/20 09:41:48
Updated it.
|
| + , public Supplement<Navigator> { |
| + USING_GARBAGE_COLLECTED_MIXIN(NavigatorBudget); |
| + WTF_MAKE_NONCOPYABLE(NavigatorBudget); |
| + |
| +public: |
| + virtual ~NavigatorBudget(); |
| + |
| + 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&); |
| + |
| + DEFINE_INLINE_TRACE() {} |
| + |
| +private: |
| + explicit NavigatorBudget(Navigator&); |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // NavigatorBudget_h |