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

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

Issue 2465363004: [Sensors] Consider maximum supported frequency (Closed)
Patch Set: Comment from Tim 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
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/AmbientLightSensor.h" 5 #include "modules/sensor/AmbientLightSensor.h"
6 6
7 #include "bindings/core/v8/ScriptPromise.h" 7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "modules/sensor/AmbientLightSensorReading.h" 9 #include "modules/sensor/AmbientLightSensorReading.h"
10 10
(...skipping 22 matching lines...) Expand all
33 AmbientLightSensorReading* AmbientLightSensor::reading() const { 33 AmbientLightSensorReading* AmbientLightSensor::reading() const {
34 return static_cast<AmbientLightSensorReading*>(Sensor::reading()); 34 return static_cast<AmbientLightSensorReading*>(Sensor::reading());
35 } 35 }
36 36
37 std::unique_ptr<SensorReadingFactory> 37 std::unique_ptr<SensorReadingFactory>
38 AmbientLightSensor::createSensorReadingFactory() { 38 AmbientLightSensor::createSensorReadingFactory() {
39 return std::unique_ptr<SensorReadingFactory>( 39 return std::unique_ptr<SensorReadingFactory>(
40 new SensorReadingFactoryImpl<AmbientLightSensorReading>()); 40 new SensorReadingFactoryImpl<AmbientLightSensorReading>());
41 } 41 }
42 42
43 auto AmbientLightSensor::createSensorConfig(
44 const SensorOptions& options,
45 const SensorConfiguration& defaultConfig) -> SensorConfigurationPtr {
46 auto result = device::mojom::blink::SensorConfiguration::New();
47 result->frequency =
48 options.hasFrequency() ? options.frequency() : defaultConfig.frequency;
49 return result;
50 }
51
52 DEFINE_TRACE(AmbientLightSensor) { 43 DEFINE_TRACE(AmbientLightSensor) {
53 Sensor::trace(visitor); 44 Sensor::trace(visitor);
54 } 45 }
55 46
56 } // namespace blink 47 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h ('k') | third_party/WebKit/Source/modules/sensor/Sensor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698