Chromium Code Reviews| 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 "bindings/core/v8/ScriptPromise.h" | |
|
shalamov
2016/11/16 14:38:20
nit: ScriptPromise.h and ScriptPromiseResolver.h a
Mikhail
2016/11/17 13:47:46
Done.
| |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | |
| 9 #include "modules/sensor/GyroscopeReading.h" | |
| 10 | |
| 11 using device::mojom::blink::SensorType; | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 Gyroscope* Gyroscope::create(ScriptState* scriptState, | |
| 16 const SensorOptions& options, | |
| 17 ExceptionState& exceptionState) { | |
| 18 return new Gyroscope(scriptState, options, exceptionState); | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 Gyroscope* Gyroscope::create(ScriptState* scriptState, | |
| 23 ExceptionState& exceptionState) { | |
| 24 return create(scriptState, SensorOptions(), exceptionState); | |
| 25 } | |
| 26 | |
| 27 Gyroscope::Gyroscope(ScriptState* scriptState, | |
| 28 const SensorOptions& options, | |
| 29 ExceptionState& exceptionState) | |
| 30 : Sensor(scriptState, options, exceptionState, SensorType::GYROSCOPE) {} | |
| 31 | |
| 32 GyroscopeReading* Gyroscope::reading() const { | |
| 33 return static_cast<GyroscopeReading*>(Sensor::reading()); | |
| 34 } | |
| 35 | |
| 36 std::unique_ptr<SensorReadingFactory> Gyroscope::createSensorReadingFactory() { | |
| 37 return std::unique_ptr<SensorReadingFactory>( | |
| 38 new SensorReadingFactoryImpl<GyroscopeReading>()); | |
|
Reilly Grant (use Gerrit)
2016/11/16 18:50:51
As haraken@ suggested on the other review, use mak
Mikhail
2016/11/17 13:47:46
Done.
| |
| 39 } | |
| 40 | |
| 41 DEFINE_TRACE(Gyroscope) { | |
| 42 Sensor::trace(visitor); | |
| 43 } | |
| 44 | |
| 45 } // namespace blink | |
| OLD | NEW |