Index: content/renderer/device_sensors/device_light_event_pump.cc |
diff --git a/content/renderer/device_sensors/device_light_event_pump.cc b/content/renderer/device_sensors/device_light_event_pump.cc |
index a20919d968d9f3637afe8fb3e1435255d98890ce..3d928de891ff9bdc53434394ebbaa564f7b53b8f 100644 |
--- a/content/renderer/device_sensors/device_light_event_pump.cc |
+++ b/content/renderer/device_sensors/device_light_event_pump.cc |
@@ -10,7 +10,7 @@ |
namespace { |
// Default delay between subsequent firing of DeviceLight events. |
-const int kDefaultLightPumpDelayMillis = 200; |
+const int kDefaultLightPumpDelayMillis = 199; |
timvolodine
2014/09/04 17:16:58
why not 200?
|
} // namespace |
namespace content { |
@@ -38,7 +38,10 @@ void DeviceLightEventPump::FireEvent() { |
DCHECK(listener()); |
DeviceLightData data; |
bool did_return_light_data = reader_->GetLatestData(&data); |
- if (did_return_light_data && data.value != last_seen_data_) { |
+ // It seems that we need to fire multiple times to blink to get 1 NULL |
timvolodine
2014/09/04 17:16:58
remove comment
riju_
2014/09/08 09:26:18
Done.
|
+ // event. +inf = no sensors |
+ if ((did_return_light_data && data.value != last_seen_data_) || |
+ data.value == std::numeric_limits<double>::infinity()) { |
timvolodine
2014/09/04 17:16:58
this does not look right.
you could do reader_->Ge
timvolodine
2014/09/04 17:16:58
also I am not sure if negative values could be fir
riju_
2014/09/08 09:26:18
Done.
|
last_seen_data_ = data.value; |
listener()->didChangeDeviceLight(data.value); |
} |