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

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

Issue 2110833002: Basic framework for Budget API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to (almost) match the spec 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/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..baffa62160f6ea7071d7c2bbb172f532c874f76b
--- /dev/null
+++ b/third_party/WebKit/Source/modules/budget/NavigatorBudget.h
@@ -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.
+
+#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 GarbageCollectedFinalized<NavigatorBudget>,
Peter Beverloo 2016/08/03 13:25:55 nit: drop the "Finalized" and remove the destructo
harkness 2016/08/04 14:18:23 Done.
+ public Supplement<Navigator> {
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorBudget);
+ WTF_MAKE_NONCOPYABLE(NavigatorBudget);
+
+public:
+ virtual ~NavigatorBudget();
+ static NavigatorBudget& from(Navigator&);
+
+ static Budget* budget(Navigator&);
+ Budget* budget();
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ explicit NavigatorBudget(Navigator*);
+ static const char* supplementName();
+
+ Member<Navigator> m_navigator;
Peter Beverloo 2016/08/03 13:25:55 Why do you store |m_navigator| here?
harkness 2016/08/04 14:18:23 Discussed in person, removing it.
+ Member<Budget> m_budget;
+};
+
+} // namespace blink
+
+#endif // NavigatorBudget_h

Powered by Google App Engine
This is Rietveld 408576698