| OLD | NEW | 
|---|
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|