From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 22 Mar 2018 22:11:57 +0100
Subject: Battery API: return nothing

---
 .../renderer/modules/battery/battery_manager.cc    | 25 ++++------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc
--- a/third_party/blink/renderer/modules/battery/battery_manager.cc
+++ b/third_party/blink/renderer/modules/battery/battery_manager.cc
@@ -44,45 +44,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
 }
 
 bool BatteryManager::charging() {
-  return battery_status_.Charging();
+  return false;
 }
 
 double BatteryManager::chargingTime() {
-  return battery_status_.charging_time();
+  return 0;
 }
 
 double BatteryManager::dischargingTime() {
-  return battery_status_.discharging_time();
+  return 0;
 }
 
 double BatteryManager::level() {
-  return battery_status_.Level();
+  return 1;
 }
 
 void BatteryManager::DidUpdateData() {
   DCHECK(battery_property_);
 
-  BatteryStatus old_status = battery_status_;
-  battery_status_ = *BatteryDispatcher::Instance().LatestData();
-
   if (battery_property_->GetState() == ScriptPromisePropertyBase::kPending) {
     battery_property_->Resolve(this);
     return;
   }
-
-  Document* document = To<Document>(GetExecutionContext());
-  DCHECK(document);
-  if (document->IsContextPaused() || document->IsContextDestroyed())
-    return;
-
-  if (battery_status_.Charging() != old_status.Charging())
-    DispatchEvent(*Event::Create(event_type_names::kChargingchange));
-  if (battery_status_.charging_time() != old_status.charging_time())
-    DispatchEvent(*Event::Create(event_type_names::kChargingtimechange));
-  if (battery_status_.discharging_time() != old_status.discharging_time())
-    DispatchEvent(*Event::Create(event_type_names::kDischargingtimechange));
-  if (battery_status_.Level() != old_status.Level())
-    DispatchEvent(*Event::Create(event_type_names::kLevelchange));
 }
 
 void BatteryManager::RegisterWithDispatcher() {
-- 
2.11.0

