Index: Source/modules/battery/BatteryDispatcher.cpp |
diff --git a/Source/modules/battery/BatteryDispatcher.cpp b/Source/modules/battery/BatteryDispatcher.cpp |
index f71d9c6f2c773866d946e807d80c29f4255e291b..446d67c53e17b7268e6c536e7748e4995a79eb84 100644 |
--- a/Source/modules/battery/BatteryDispatcher.cpp |
+++ b/Source/modules/battery/BatteryDispatcher.cpp |
@@ -13,8 +13,8 @@ namespace blink { |
BatteryDispatcher& BatteryDispatcher::instance() |
{ |
- DEFINE_STATIC_LOCAL(BatteryDispatcher, batteryDispatcher, ()); |
- return batteryDispatcher; |
+ DEFINE_STATIC_LOCAL(Persistent<BatteryDispatcher>, batteryDispatcher, (new BatteryDispatcher())); |
+ return *batteryDispatcher; |
} |
BatteryDispatcher::BatteryDispatcher() |
@@ -25,6 +25,12 @@ BatteryDispatcher::~BatteryDispatcher() |
{ |
} |
+void BatteryDispatcher::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_batteryStatus); |
+ PlatformEventDispatcher::trace(visitor); |
+} |
+ |
void BatteryDispatcher::updateBatteryStatus(const WebBatteryStatus& batteryStatus) |
{ |
m_batteryStatus = BatteryStatus::create(batteryStatus.charging, batteryStatus.chargingTime, batteryStatus.dischargingTime, batteryStatus.level); |