Chromium Code Reviews| 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..d20311b8c256c8c28c0e5cfd87526724e5121430 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/budget/NavigatorBudget.h |
| @@ -0,0 +1,39 @@ |
| +// 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 "platform/Supplementable.h" |
| + |
| +namespace blink { |
| + |
| +class Budget; |
| +class Navigator; |
| + |
| +// This exposes the budget object on the Navigator partial interface. |
| +class NavigatorBudget final |
| + : public GarbageCollected<NavigatorBudget> |
| + , public Supplement<Navigator> { |
| + USING_GARBAGE_COLLECTED_MIXIN(NavigatorBudget); |
| + WTF_MAKE_NONCOPYABLE(NavigatorBudget); |
| + |
| +public: |
| + static NavigatorBudget& from(Navigator&); |
| + |
| + static Budget* budget(Navigator&); |
| + Budget* budget(); |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| +private: |
| + explicit NavigatorBudget(); |
|
Peter Beverloo
2016/08/05 14:33:20
nit: drop "explicit"
harkness
2016/08/08 12:07:36
Done.
|
| + static const char* supplementName(); |
| + |
| + Member<Budget> m_budget; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // NavigatorBudget_h |