Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: third_party/WebKit/Source/modules/sensor/Gyroscope.cpp

Issue 2506903003: [sensors] Gyroscope sensor bindings implementation (Closed)
Patch Set: Comments + rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Gyroscope.h ('k') | third_party/WebKit/Source/modules/sensor/Gyroscope.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698