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

Issue 2447973003: [sensors] [win] Implement ambient light sensor for Windows platform (Closed)

Created:
4 years, 1 month ago by shalamov
Modified:
4 years, 1 month ago
CC:
chromium-reviews, miu
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[sensors] [win] Implement ambient light sensor for Windows platform This CL adds implementation for ambient light sensor on Windows platform and introduces adaptation layer between Generic Sensor and Windows Sensor APIs. Three new classes are introduced: * PlatformSensorProviderWin: creates PlatformSensorWin instances and manages sensor thread where all Windows Sensor API COM objects are running. * PlatformSensorWin: Uses PlatformSensorReaderWin to receive notifications about sensor reading and state change updates. Lives on IPC thread. * PlatformSensorReaderWin - Uses ISensor COM interface to get sensor reading and state change updates. Lives on sensor thread. Unit tests are added to test new functionality. BUG=606766 Committed: https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea Cr-Commit-Position: refs/heads/master@{#429536}

Patch Set 1 #

Total comments: 20

Patch Set 2 : Fixes for review comments from Mikhail. #

Total comments: 32

Patch Set 3 : Fixes for comments from Reilly and Mikhail #

Total comments: 2

Patch Set 4 : Modify timestamp calculation as proposed by miu@ #

Total comments: 46

Patch Set 5 : Fixes for comments from Lei Zhang #

Total comments: 8

Patch Set 6 : Fixes for review comments #

Patch Set 7 : Rebased to master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1243 lines, -1 line) Patch
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M device/BUILD.gn View 2 chunks +4 lines, -0 lines 0 comments Download
M device/generic_sensor/BUILD.gn View 1 2 3 4 5 6 2 chunks +13 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_and_provider_unittest_win.cc View 1 2 3 4 5 1 chunk +489 lines, -0 lines 0 comments Download
M device/generic_sensor/platform_sensor_provider.cc View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_provider_win.h View 1 2 3 4 1 chunk +73 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_provider_win.cc View 1 2 3 4 5 6 1 chunk +105 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_reader_win.h View 1 2 3 4 1 chunk +81 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_reader_win.cc View 1 2 3 4 5 1 chunk +338 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_win.h View 1 2 3 4 5 1 chunk +61 lines, -0 lines 0 comments Download
A device/generic_sensor/platform_sensor_win.cc View 1 2 3 4 5 1 chunk +74 lines, -0 lines 0 comments Download

Messages

Total messages: 49 (25 generated)
shalamov
PTAL
4 years, 1 month ago (2016-10-25 13:42:29 UTC) #3
Mikhail
https://codereview.chromium.org/2447973003/diff/1/device/BUILD.gn File device/BUILD.gn (right): https://codereview.chromium.org/2447973003/diff/1/device/BUILD.gn#newcode226 device/BUILD.gn:226: libs = [ "sensorsapi.lib" ] += ? https://codereview.chromium.org/2447973003/diff/1/device/generic_sensor/platform_sensor_provider_win.cc File ...
4 years, 1 month ago (2016-10-26 06:40:16 UTC) #8
Mikhail
https://codereview.chromium.org/2447973003/diff/1/device/generic_sensor/platform_sensor_reader_win.cc File device/generic_sensor/platform_sensor_reader_win.cc (right): https://codereview.chromium.org/2447973003/diff/1/device/generic_sensor/platform_sensor_reader_win.cc#newcode50 device/generic_sensor/platform_sensor_reader_win.cc:50: bool GetReaderInitParamsForSensor(mojom::SensorType type, would be better to have it ...
4 years, 1 month ago (2016-10-26 06:52:59 UTC) #9
shalamov
https://codereview.chromium.org/2447973003/diff/1/device/BUILD.gn File device/BUILD.gn (right): https://codereview.chromium.org/2447973003/diff/1/device/BUILD.gn#newcode226 device/BUILD.gn:226: libs = [ "sensorsapi.lib" ] On 2016/10/26 06:40:15, Mikhail ...
4 years, 1 month ago (2016-10-26 12:09:43 UTC) #11
shalamov
Reilly, Tim, could you please take a look?
4 years, 1 month ago (2016-10-26 13:23:02 UTC) #13
Mikhail
lgtm https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_reader_win.h File device/generic_sensor/platform_sensor_reader_win.h (right): https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_reader_win.h#newcode21 device/generic_sensor/platform_sensor_reader_win.h:21: // Instances of this class must be created ...
4 years, 1 month ago (2016-10-26 13:35:31 UTC) #14
Mikhail
On 2016/10/26 13:35:31, Mikhail wrote: > > https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_reader_win.h > File device/generic_sensor/platform_sensor_reader_win.h (right): > > https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_reader_win.h#newcode21 ...
4 years, 1 month ago (2016-10-26 13:44:32 UTC) #15
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc File device/generic_sensor/platform_sensor_and_provider_unittest_win.cc (right): https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc#newcode390 device/generic_sensor/platform_sensor_and_provider_unittest_win.cc:390: .WillByDefault(Invoke([](REFSENSOR_TYPE_ID, ISensorCollection** result) { Here and also elsewhere such ...
4 years, 1 month ago (2016-10-27 00:59:20 UTC) #16
Reilly Grant (use Gerrit)
thestig, can you take a look at the use of base::Time and base::TimeTicks in platform_sensor_reader_win.cc:141. ...
4 years, 1 month ago (2016-10-27 01:01:04 UTC) #18
Lei Zhang
I would recommend miu@, as he is the Time lord. ;)
4 years, 1 month ago (2016-10-27 02:53:36 UTC) #19
shalamov
https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc File device/generic_sensor/platform_sensor_and_provider_unittest_win.cc (right): https://codereview.chromium.org/2447973003/diff/40001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc#newcode390 device/generic_sensor/platform_sensor_and_provider_unittest_win.cc:390: .WillByDefault(Invoke([](REFSENSOR_TYPE_ID, ISensorCollection** result) { On 2016/10/27 00:59:19, Reilly Grant ...
4 years, 1 month ago (2016-10-27 13:51:08 UTC) #22
miu
Time lord jumping-in here. :) Comments on the time sampling/conversions (mostly things to consider for ...
4 years, 1 month ago (2016-10-27 20:01:02 UTC) #24
shalamov
Thanks for comments miu@! > 1. How precise a measurement do you need? When sampling ...
4 years, 1 month ago (2016-10-28 13:19:29 UTC) #25
miu
Time logic in device/generic_sensor/platform_sensor_reader_win.cc lgtm.
4 years, 1 month ago (2016-10-29 02:29:06 UTC) #26
Lei Zhang
https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/BUILD.gn File device/generic_sensor/BUILD.gn (right): https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/BUILD.gn#newcode72 device/generic_sensor/BUILD.gn:72: "portabledeviceguids.lib", nit: alphabetical order https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc File device/generic_sensor/platform_sensor_and_provider_unittest_win.cc (right): https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc#newcode12 ...
4 years, 1 month ago (2016-10-29 05:10:42 UTC) #27
shalamov
Thanks for looking Lei Zhang, fixed most of the comments, except: device/generic_sensor/platform_sensor_and_provider_unittest_win.cc:216: run_loop_ = std::make_unique<base::RunLoop>(); ...
4 years, 1 month ago (2016-10-31 13:12:58 UTC) #29
Lei Zhang
https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc File device/generic_sensor/platform_sensor_and_provider_unittest_win.cc (right): https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc#newcode308 device/generic_sensor/platform_sensor_and_provider_unittest_win.cc:308: auto mock_report = new NiceMock<MockISensorDataReport>(); On 2016/10/31 13:12:57, shalamov ...
4 years, 1 month ago (2016-10-31 18:22:16 UTC) #30
Reilly Grant (use Gerrit)
lgtm with nits https://codereview.chromium.org/2447973003/diff/150001/device/generic_sensor/platform_sensor_provider_win.cc File device/generic_sensor/platform_sensor_provider_win.cc (right): https://codereview.chromium.org/2447973003/diff/150001/device/generic_sensor/platform_sensor_provider_win.cc#newcode68 device/generic_sensor/platform_sensor_provider_win.cc:68: base::MakeUnique<base::Thread>("Windows platform sensor thread"); As with ...
4 years, 1 month ago (2016-10-31 21:49:43 UTC) #31
shalamov
Fixed review comments. Added one test for the issue that Reilly found in PlatformSensorReaderWin.cpp:130 https://codereview.chromium.org/2447973003/diff/110001/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc ...
4 years, 1 month ago (2016-11-01 11:00:02 UTC) #32
shalamov
On 2016/10/31 18:22:16, Lei Zhang wrote: > So it's self releasing? Please add a comment, ...
4 years, 1 month ago (2016-11-02 07:04:03 UTC) #37
Lei Zhang
On 2016/11/02 07:04:03, shalamov wrote: > On 2016/10/31 18:22:16, Lei Zhang wrote: > > So ...
4 years, 1 month ago (2016-11-02 19:20:03 UTC) #38
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/2447973003/190001
4 years, 1 month ago (2016-11-03 07:40:26 UTC) #45
commit-bot: I haz the power
Committed patchset #7 (id:190001)
4 years, 1 month ago (2016-11-03 07:46:57 UTC) #47
commit-bot: I haz the power
4 years, 1 month ago (2016-11-03 07:49:09 UTC) #49
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea
Cr-Commit-Position: refs/heads/master@{#429536}

Powered by Google App Engine
This is Rietveld 408576698