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

Unified Diff: third_party/WebKit/Source/modules/budget_service/NavigatorBudget.h

Issue 2110833002: Basic framework for Budget API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_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..307e917ce6a988cfce6060eecd2f9388a9017587
--- /dev/null
+++ b/third_party/WebKit/Source/modules/budget_service/NavigatorBudget.h
@@ -0,0 +1,44 @@
+// 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
+// designed to give Service Workers the ability to perform background
+// operations on the user's behalf.
+class MODULES_EXPORT NavigatorBudget final
+ : public GarbageCollectedFinalized<NavigatorBudget>
+ , public Supplement<Navigator> {
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorBudget);
+ WTF_MAKE_NONCOPYABLE(NavigatorBudget);
+
+public:
haraken 2016/06/29 23:45:40 You need to add DECLARE_TRACE/DEFINE_TRACE. I gues
+ virtual ~NavigatorBudget();
+
+ const char* supplementName();
+ NavigatorBudget& from(Navigator&);
+
+ static ScriptPromise getCost(ScriptState*, Navigator&, const AtomicString& actionType);
+ static ScriptPromise getBudget(ScriptState*, Navigator&, ExceptionState&);
+
+private:
+ explicit NavigatorBudget(Navigator&);
+};
+
+} // namespace blink
+
+#endif // NavigatorBudget_h

Powered by Google App Engine
This is Rietveld 408576698