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

Unified Diff: device/generic_sensor/sensor_provider_impl.cc

Issue 2465363004: [Sensors] Consider maximum supported frequency (Closed)
Patch Set: [Sensors] Consider maximum supported frequency 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 side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/sensor_provider_impl.cc
diff --git a/device/generic_sensor/sensor_provider_impl.cc b/device/generic_sensor/sensor_provider_impl.cc
index 8a7860cb1c971d16493ace11b16fe353f1da3dda..7b0a92464a7bb5b41caeae4e5a5e296ef909388e 100644
--- a/device/generic_sensor/sensor_provider_impl.cc
+++ b/device/generic_sensor/sensor_provider_impl.cc
@@ -89,6 +89,13 @@ void SensorProviderImpl::SensorCreated(
init_params->mode = sensor->GetReportingMode();
init_params->default_configuration = sensor->GetDefaultConfiguration();
+ double maximum_frequency = sensor->GetMaximumSupportedFrequency();
shalamov 2016/11/03 12:54:05 If platform returns 0, should we cap max to defaul
Mikhail 2016/11/03 13:28:16 It should not return 0. Implementation must cap ma
+ DCHECK(maximum_frequency);
+ if (maximum_frequency > mojom::SensorConfiguration::kMaxAllowedFrequency)
+ maximum_frequency = mojom::SensorConfiguration::kMaxAllowedFrequency;
+
+ init_params->maximum_frequency = maximum_frequency;
+
NotifySensorCreated(std::move(init_params), sensor_impl->GetClient(),
callback);

Powered by Google App Engine
This is Rietveld 408576698