| 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/Sensor.h" | 5 #include "modules/sensor/Sensor.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 #include "core/dom/TaskRunnerHelper.h" | 9 #include "core/dom/TaskRunnerHelper.h" |
| 10 #include "core/inspector/ConsoleMessage.h" | 10 #include "core/inspector/ConsoleMessage.h" |
| 11 #include "core/timing/DOMWindowPerformance.h" | 11 #include "core/timing/DOMWindowPerformance.h" |
| 12 #include "core/timing/Performance.h" | 12 #include "core/timing/Performance.h" |
| 13 #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" | |
| 14 #include "modules/sensor/SensorErrorEvent.h" | 13 #include "modules/sensor/SensorErrorEvent.h" |
| 15 #include "modules/sensor/SensorProviderProxy.h" | 14 #include "modules/sensor/SensorProviderProxy.h" |
| 15 #include "services/device/public/interfaces/sensor.mojom-blink.h" |
| 16 | 16 |
| 17 using namespace device::mojom::blink; | 17 using namespace device::mojom::blink; |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 constexpr double kMinWaitingInterval = | 23 constexpr double kMinWaitingInterval = |
| 24 1 / device::mojom::blink::SensorConfiguration::kMaxAllowedFrequency; | 24 1 / device::mojom::blink::SensorConfiguration::kMaxAllowedFrequency; |
| 25 | 25 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 bool Sensor::CanReturnReadings() const { | 315 bool Sensor::CanReturnReadings() const { |
| 316 if (!IsActivated()) | 316 if (!IsActivated()) |
| 317 return false; | 317 return false; |
| 318 DCHECK(sensor_proxy_); | 318 DCHECK(sensor_proxy_); |
| 319 return sensor_proxy_->reading().timestamp != 0.0; | 319 return sensor_proxy_->reading().timestamp != 0.0; |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace blink | 322 } // namespace blink |
| OLD | NEW |