Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef Budget_h | |
| 6 #define Budget_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | |
| 9 #include "modules/ModulesExport.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class ExceptionState; | |
| 14 class Navigator; | |
| 15 class ScriptPromise; | |
| 16 class ScriptState; | |
| 17 | |
| 18 // This is the entry point into the browser for the Budget API, which is | |
| 19 // designed to give origins the ability to perform background operations | |
| 20 // on the user's behalf. | |
| 21 class Budget final : | |
| 22 public GarbageCollected<Budget>, | |
| 23 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.
| |
| 24 DEFINE_WRAPPERTYPEINFO(); | |
| 25 | |
| 26 public: | |
| 27 static Budget* create(Navigator* navigator) | |
| 28 { | |
| 29 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.
| |
| 30 } | |
| 31 | |
| 32 static ScriptPromise getCost(ScriptState*, const AtomicString& actionType); | |
| 33 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.
| |
| 34 | |
| 35 DECLARE_TRACE(); | |
| 36 | |
| 37 private: | |
| 38 explicit Budget(Navigator*); | |
| 39 | |
| 40 Member<Navigator> m_navigator; | |
| 41 }; | |
| 42 | |
| 43 } // namespace blink | |
| 44 | |
| 45 #endif // Budget_h | |
| OLD | NEW |