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

Unified Diff: device/generic_sensor/sensor_provider_impl.cc

Issue 2704123006: [Sensors] Clamp given sampling frequency to the minimum supported one (Closed)
Patch Set: Created 3 years, 10 months 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 7322901e3e0736cd37290db5df02d6970b491f53..90004b6930723066463e45a0e441cedc49c43bbe 100644
--- a/device/generic_sensor/sensor_provider_impl.cc
+++ b/device/generic_sensor/sensor_provider_impl.cc
@@ -100,6 +100,8 @@ void SensorProviderImpl::SensorCreated(
maximum_frequency = mojom::SensorConfiguration::kMaxAllowedFrequency;
init_params->maximum_frequency = maximum_frequency;
+ init_params->minimum_frequency = sensor->GetMinimumSupportedFrequency();
+ DCHECK(init_params->minimum_frequency > 0);
Reilly Grant (use Gerrit) 2017/02/22 18:40:15 DCHECK_GT(init_params->minimum_frequency, 0); (Al
Mikhail 2017/02/23 12:42:34 Done.
NotifySensorCreated(std::move(init_params), sensor_impl->GetClient(),
callback);

Powered by Google App Engine
This is Rietveld 408576698