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

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

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 years, 9 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 {
11 11
12 NavigatorBattery::NavigatorBattery() 12 NavigatorBattery::NavigatorBattery()
13 { 13 {
14 } 14 }
15 15
16 ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState, Navigator& navigator) 16 ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState, Navigator& navigator)
17 { 17 {
18 return NavigatorBattery::from(navigator).getBattery(scriptState); 18 return NavigatorBattery::from(navigator).getBattery(scriptState);
19 } 19 }
20 20
21 ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState) 21 ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState)
22 { 22 {
23 if (!m_batteryManager) 23 if (!m_batteryManager)
24 m_batteryManager = BatteryManager::create(scriptState->executionContext( )); 24 m_batteryManager = BatteryManager::create(scriptState->getExecutionConte xt());
25 25
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*>(HeapSupplement <Navigator>::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 HeapSupplement<Navigator>::trace(visitor);
48 } 48 }
49 49
50 } // namespace blink 50 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698