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

Issue 2417643006: [sensors][mac] Make sure to update the sensor value when initializing the sensor. (Closed)

Created:
4 years, 2 months ago by darktears
Modified:
4 years, 2 months ago
CC:
chromium-reviews, mac-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[sensors][mac] Make sure to update the sensor value when initializing the sensor. IOServiceAddInterestNotification will only notify when the hardware sensor value changes however when calling StartSensor we need to make sure to query the value of the sensor right away to return the correct value to JavaScript. The reason is that after calling StartSensor the light conditions may never change and the IOServiceAddInterestNotification callback will never be called and we return the default 0.0 sensor value. We can fix this by making sure to initialize the sensor value in PlatformSensorAmbientLightMac StartSensor. BUG=606766 Committed: https://crrev.com/75daa868751b28b3bad9dcc033198c201129ae7d Cr-Commit-Position: refs/heads/master@{#426806}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix Tim comments #

Total comments: 2

Patch Set 3 : Last comments from Tim #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -12 lines) Patch
M device/generic_sensor/platform_sensor_ambient_light_mac.h View 1 1 chunk +1 line, -1 line 0 comments Download
M device/generic_sensor/platform_sensor_ambient_light_mac.cc View 1 2 2 chunks +24 lines, -11 lines 0 comments Download

Messages

Total messages: 25 (13 generated)
darktears
4 years, 2 months ago (2016-10-14 17:49:59 UTC) #4
Robert Sesek
LGTM
4 years, 2 months ago (2016-10-14 20:07:20 UTC) #7
darktears
On 2016/10/14 at 20:07:20, rsesek wrote: > LGTM @timvolodine : appreciate your review :)
4 years, 2 months ago (2016-10-17 14:54:43 UTC) #8
timvolodine
https://codereview.chromium.org/2417643006/diff/1/device/generic_sensor/platform_sensor_ambient_light_mac.cc File device/generic_sensor/platform_sensor_ambient_light_mac.cc (right): https://codereview.chromium.org/2417643006/diff/1/device/generic_sensor/platform_sensor_ambient_light_mac.cc#newcode57 device/generic_sensor/platform_sensor_ambient_light_mac.cc:57: sensor->ReadSensorValue(); would it make sense to make ReadSensorValue return ...
4 years, 2 months ago (2016-10-18 19:26:14 UTC) #9
darktears
https://codereview.chromium.org/2417643006/diff/1/device/generic_sensor/platform_sensor_ambient_light_mac.cc File device/generic_sensor/platform_sensor_ambient_light_mac.cc (right): https://codereview.chromium.org/2417643006/diff/1/device/generic_sensor/platform_sensor_ambient_light_mac.cc#newcode57 device/generic_sensor/platform_sensor_ambient_light_mac.cc:57: sensor->ReadSensorValue(); On 2016/10/18 at 19:26:13, timvolodine wrote: > would ...
4 years, 2 months ago (2016-10-18 19:56:58 UTC) #10
darktears
On 2016/10/19 at 22:33:08, darktears wrote: > The CQ bit was checked by alexis.menard@intel.com to ...
4 years, 2 months ago (2016-10-19 22:33:45 UTC) #12
Mikhail
lgtm
4 years, 2 months ago (2016-10-20 18:20:20 UTC) #17
darktears
On 2016/10/20 at 18:20:20, mikhail.pozdnyakov wrote: > lgtm Thanks, @timvolodine : I need your blessing.
4 years, 2 months ago (2016-10-20 19:37:26 UTC) #18
timvolodine
blessing (aka lgtm) % two comments ;) https://codereview.chromium.org/2417643006/diff/20001/device/generic_sensor/platform_sensor_ambient_light_mac.cc File device/generic_sensor/platform_sensor_ambient_light_mac.cc (right): https://codereview.chromium.org/2417643006/diff/20001/device/generic_sensor/platform_sensor_ambient_light_mac.cc#newcode58 device/generic_sensor/platform_sensor_ambient_light_mac.cc:58: sensor->NotifySensorError(); if ...
4 years, 2 months ago (2016-10-21 12:51:50 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2417643006/40001
4 years, 2 months ago (2016-10-21 15:39:31 UTC) #22
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-10-21 16:11:17 UTC) #23
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 16:35:06 UTC) #25
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/75daa868751b28b3bad9dcc033198c201129ae7d
Cr-Commit-Position: refs/heads/master@{#426806}

Powered by Google App Engine
This is Rietveld 408576698