Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: third_party/WebKit/Source/modules/budget/Budget.cpp

Issue 2110833002: Basic framework for Budget API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed Navigator member and exception, other nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..414485b061e2881fb5fe74d0091bbcbbb1e4becd
--- /dev/null
+++ b/third_party/WebKit/Source/modules/budget/Budget.cpp
@@ -0,0 +1,34 @@
+// 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"
Peter Beverloo 2016/08/05 14:33:19 nit: unused
harkness 2016/08/08 12:07:36 Done.
+
+namespace blink {
+
+Budget::Budget() {}
+
+ScriptPromise Budget::getCost(ScriptState* state, const AtomicString& actionType)
haraken 2016/08/08 01:48:13 state => scriptState (we normally use scriptState
harkness 2016/08/08 12:07:36 Done.
+{
+ // TODO(harkness): Trigger the cost calculation.
+ return ScriptPromise::rejectWithDOMException(state, DOMException::create(NotSupportedError, "Not yet implemented"));
+}
+
+ScriptPromise Budget::getBudget(ScriptState* state)
haraken 2016/08/08 01:48:13 state => scriptState
harkness 2016/08/08 12:07:36 Done.
+{
+ // TODO(harkness): Trigger the budget calculation.
+ return ScriptPromise::rejectWithDOMException(state, DOMException::create(NotSupportedError, "Not yet implemented"));
+}
+
+DEFINE_TRACE(Budget)
Peter Beverloo 2016/08/05 14:33:19 nit: Since it's empty, you could drop this and swa
harkness 2016/08/08 12:07:36 Done.
+{
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698