| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "modules/sensor/Gyroscope.h" |
| 6 |
| 7 #include "modules/sensor/GyroscopeReading.h" |
| 8 |
| 9 using device::mojom::blink::SensorType; |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 Gyroscope* Gyroscope::create(ScriptState* scriptState, |
| 14 const SensorOptions& options, |
| 15 ExceptionState& exceptionState) { |
| 16 return new Gyroscope(scriptState, options, exceptionState); |
| 17 } |
| 18 |
| 19 // static |
| 20 Gyroscope* Gyroscope::create(ScriptState* scriptState, |
| 21 ExceptionState& exceptionState) { |
| 22 return create(scriptState, SensorOptions(), exceptionState); |
| 23 } |
| 24 |
| 25 Gyroscope::Gyroscope(ScriptState* scriptState, |
| 26 const SensorOptions& options, |
| 27 ExceptionState& exceptionState) |
| 28 : Sensor(scriptState, options, exceptionState, SensorType::GYROSCOPE) {} |
| 29 |
| 30 GyroscopeReading* Gyroscope::reading() const { |
| 31 return static_cast<GyroscopeReading*>(Sensor::reading()); |
| 32 } |
| 33 |
| 34 std::unique_ptr<SensorReadingFactory> Gyroscope::createSensorReadingFactory() { |
| 35 return makeUnique<SensorReadingFactoryImpl<GyroscopeReading>>(); |
| 36 } |
| 37 |
| 38 DEFINE_TRACE(Gyroscope) { |
| 39 Sensor::trace(visitor); |
| 40 } |
| 41 |
| 42 } // namespace blink |
| OLD | NEW |