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

Side by Side Diff: third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp

Issue 1846913009: HeapSupplements are now just Supplements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/battery/NavigatorBattery.h" 5 #include "modules/battery/NavigatorBattery.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "modules/battery/BatteryManager.h" 8 #include "modules/battery/BatteryManager.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 15 matching lines...) Expand all
26 return m_batteryManager->startRequest(scriptState); 26 return m_batteryManager->startRequest(scriptState);
27 } 27 }
28 28
29 const char* NavigatorBattery::supplementName() 29 const char* NavigatorBattery::supplementName()
30 { 30 {
31 return "NavigatorBattery"; 31 return "NavigatorBattery";
32 } 32 }
33 33
34 NavigatorBattery& NavigatorBattery::from(Navigator& navigator) 34 NavigatorBattery& NavigatorBattery::from(Navigator& navigator)
35 { 35 {
36 NavigatorBattery* supplement = static_cast<NavigatorBattery*>(HeapSupplement <Navigator>::from(navigator, supplementName())); 36 NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Nav igator>::from(navigator, supplementName()));
37 if (!supplement) { 37 if (!supplement) {
38 supplement = new NavigatorBattery(); 38 supplement = new NavigatorBattery();
39 provideTo(navigator, supplementName(), supplement); 39 provideTo(navigator, supplementName(), supplement);
40 } 40 }
41 return *supplement; 41 return *supplement;
42 } 42 }
43 43
44 DEFINE_TRACE(NavigatorBattery) 44 DEFINE_TRACE(NavigatorBattery)
45 { 45 {
46 visitor->trace(m_batteryManager); 46 visitor->trace(m_batteryManager);
47 HeapSupplement<Navigator>::trace(visitor); 47 Supplement<Navigator>::trace(visitor);
48 } 48 }
49 49
50 } // namespace blink 50 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698