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

Unified Diff: third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp

Issue 2646383002: Use a new Supplement constructor for (Worker)Navigator supplements (Closed)
Patch Set: temp Created 3 years, 11 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/battery/NavigatorBattery.cpp
diff --git a/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp b/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp
index c892bdafab8666a1e555ff975153615f7e9036b4..bd8b86f068ea3a65f22d59c67220975746ac41b5 100644
--- a/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp
+++ b/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp
@@ -9,7 +9,8 @@
namespace blink {
-NavigatorBattery::NavigatorBattery() {}
+NavigatorBattery::NavigatorBattery(Navigator& navigator)
+ : Supplement<Navigator>(navigator) {}
ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState,
Navigator& navigator) {
@@ -32,7 +33,7 @@ NavigatorBattery& NavigatorBattery::from(Navigator& navigator) {
NavigatorBattery* supplement = static_cast<NavigatorBattery*>(
Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorBattery();
+ supplement = new NavigatorBattery(navigator);
provideTo(navigator, supplementName(), supplement);
}
return *supplement;

Powered by Google App Engine
This is Rietveld 408576698