| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/sensor/SensorReadingUpdater.h" | 5 #include "modules/sensor/SensorReadingUpdater.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" | 8 #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" |
| 9 #include "modules/sensor/SensorProxy.h" | 9 #include "modules/sensor/SensorProxy.h" |
| 10 #include "wtf/CurrentTime.h" | 10 #include "platform/wtf/CurrentTime.h" |
| 11 | 11 |
| 12 using device::mojom::blink::ReportingMode; | 12 using device::mojom::blink::ReportingMode; |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 SensorReadingUpdater::SensorReadingUpdater(SensorProxy* sensor_proxy) | 16 SensorReadingUpdater::SensorReadingUpdater(SensorProxy* sensor_proxy) |
| 17 : sensor_proxy_(sensor_proxy), | 17 : sensor_proxy_(sensor_proxy), |
| 18 document_(sensor_proxy_->GetDocument()), | 18 document_(sensor_proxy_->GetDocument()), |
| 19 has_pending_animation_frame_task_(false) {} | 19 has_pending_animation_frame_task_(false) {} |
| 20 | 20 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // static | 116 // static |
| 117 SensorReadingUpdater* SensorReadingUpdater::Create(SensorProxy* proxy, | 117 SensorReadingUpdater* SensorReadingUpdater::Create(SensorProxy* proxy, |
| 118 ReportingMode mode) { | 118 ReportingMode mode) { |
| 119 if (mode == ReportingMode::CONTINUOUS) | 119 if (mode == ReportingMode::CONTINUOUS) |
| 120 return new SensorReadingUpdaterContinuous(proxy); | 120 return new SensorReadingUpdaterContinuous(proxy); |
| 121 return new SensorReadingUpdaterOnChange(proxy); | 121 return new SensorReadingUpdaterOnChange(proxy); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace blink | 124 } // namespace blink |
| OLD | NEW |