| 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/BatteryDispatcher.h" | 5 #include "modules/battery/BatteryDispatcher.h" |
| 6 | 6 |
| 7 #include "platform/mojo/MojoHelper.h" | 7 #include "platform/mojo/MojoHelper.h" |
| 8 #include "platform/wtf/Assertions.h" |
| 8 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
| 9 #include "services/device/public/interfaces/constants.mojom-blink.h" | 10 #include "services/device/public/interfaces/constants.mojom-blink.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 11 #include "services/service_manager/public/cpp/connector.h" |
| 11 #include "wtf/Assertions.h" | |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 BatteryDispatcher& BatteryDispatcher::Instance() { | 15 BatteryDispatcher& BatteryDispatcher::Instance() { |
| 16 DEFINE_STATIC_LOCAL(BatteryDispatcher, battery_dispatcher, | 16 DEFINE_STATIC_LOCAL(BatteryDispatcher, battery_dispatcher, |
| 17 (new BatteryDispatcher)); | 17 (new BatteryDispatcher)); |
| 18 return battery_dispatcher; | 18 return battery_dispatcher; |
| 19 } | 19 } |
| 20 | 20 |
| 21 BatteryDispatcher::BatteryDispatcher() : has_latest_data_(false) {} | 21 BatteryDispatcher::BatteryDispatcher() : has_latest_data_(false) {} |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 device::mojom::blink::kServiceName, mojo::MakeRequest(&monitor_)); | 49 device::mojom::blink::kServiceName, mojo::MakeRequest(&monitor_)); |
| 50 QueryNextStatus(); | 50 QueryNextStatus(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void BatteryDispatcher::StopListening() { | 53 void BatteryDispatcher::StopListening() { |
| 54 monitor_.reset(); | 54 monitor_.reset(); |
| 55 has_latest_data_ = false; | 55 has_latest_data_ = false; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |