Chromium Code Reviews| Index: third_party/WebKit/Source/modules/budget/Budget.cpp |
| diff --git a/third_party/WebKit/Source/modules/budget/Budget.cpp b/third_party/WebKit/Source/modules/budget/Budget.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5a99a3fd55a28df6c5becbf0dba04c92f521a27d |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/budget/Budget.cpp |
| @@ -0,0 +1,41 @@ |
| +// 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. |
| + |
| +#include "modules/budget/Budget.h" |
| + |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "bindings/core/v8/ScriptPromiseResolver.h" |
| +#include "bindings/core/v8/ScriptState.h" |
| +#include "core/dom/DOMException.h" |
| +#include "core/dom/ExceptionCode.h" |
| +#include "core/frame/Navigator.h" |
| + |
| +namespace blink { |
| + |
| +Budget::Budget(Navigator* navigator) |
| + : m_navigator(navigator) |
| +{ |
| + DCHECK(navigator); |
| +} |
| + |
| +// static |
| +ScriptPromise Budget::getCost(ScriptState* state, const AtomicString& actionType) |
| +{ |
| + // TODO(harkness): Trigger the cost calculation. |
| + return ScriptPromise::rejectWithDOMException(state, DOMException::create(NotSupportedError, "Not yet implemented")); |
| +} |
| + |
| +// static |
| +ScriptPromise Budget::getBudget(ScriptState* state, ExceptionState& exception) |
|
Peter Beverloo
2016/08/03 13:25:54
nit: drop the RaisesException annotation in the ID
harkness
2016/08/04 14:18:23
Done.
|
| +{ |
| + // TODO(harkness): Trigger the budget calculation. |
| + return ScriptPromise::rejectWithDOMException(state, DOMException::create(NotSupportedError, "Not yet implemented")); |
| +} |
| + |
| +DEFINE_TRACE(Budget) |
| +{ |
| + visitor->trace(m_navigator); |
| +} |
| + |
| +} // namespace blink |