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

Issue 2353493002: [Sensors] Allow Sensor API only on secure top-level browsing contexts and add frequency checks (Closed)

Created:
4 years, 3 months ago by Mikhail
Modified:
4 years, 2 months ago
CC:
chromium-reviews, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sensors] Allow Sensor API only on secure top-level browsing contexts and add frequency checks This patch introduces secure context and top-level browsing context checks as required at https://w3c.github.io/sensors/#construct-sensor-object. Besides it introduces check of the given frequency option: if the given frequency is negative exception is raised; if the given frequency is more than 60 Hz it is capped to 60 Hz. BUG=606766 Committed: https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63 Cr-Commit-Position: refs/heads/master@{#421501}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Review comments #

Total comments: 10

Patch Set 3 : Comments from Tim #

Total comments: 3

Messages

Total messages: 39 (23 generated)
Mikhail
PTAL
4 years, 3 months ago (2016-09-19 13:01:22 UTC) #5
haraken
https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl File third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl (right): https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl#newcode11 third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl:11: ConstructorCallWith=(ScriptState,ExecutionContext), ConstructorCallWith=ScriptState would be enough. You can get the ...
4 years, 3 months ago (2016-09-19 13:07:51 UTC) #6
haraken
In terms of implementation LGTM. https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/Source/modules/sensor/Sensor.cpp File third_party/WebKit/Source/modules/sensor/Sensor.cpp (right): https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/Source/modules/sensor/Sensor.cpp#newcode37 third_party/WebKit/Source/modules/sensor/Sensor.cpp:37: if (!scriptState->domWindow()->frame() || !scriptState->domWindow()->frame()->isMainFrame()) ...
4 years, 3 months ago (2016-09-19 13:09:41 UTC) #7
shalamov
https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html File third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html (right): https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html#newcode20 third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html:20: test(() => assert_throws(new RangeError(), () => new AmbientLightSensor({frequency: -60})), ...
4 years, 3 months ago (2016-09-19 13:11:42 UTC) #8
Mikhail
Thanks for your comments! https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html File third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html (right): https://codereview.chromium.org/2353493002/diff/1/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html#newcode20 third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html:20: test(() => assert_throws(new RangeError(), () ...
4 years, 3 months ago (2016-09-19 14:18:03 UTC) #11
timvolodine
https://codereview.chromium.org/2353493002/diff/20001/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html File third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html (right): https://codereview.chromium.org/2353493002/diff/20001/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html#newcode22 third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html:22: () => new AmbientLightSensor({frequency: -60})), nit: also test for ...
4 years, 3 months ago (2016-09-19 16:52:13 UTC) #14
haraken
LGTM on my side
4 years, 3 months ago (2016-09-20 00:41:12 UTC) #15
Mikhail
Thanks for your comments! https://codereview.chromium.org/2353493002/diff/20001/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html File third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html (right): https://codereview.chromium.org/2353493002/diff/20001/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html#newcode22 third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html:22: () => new AmbientLightSensor({frequency: -60})), ...
4 years, 3 months ago (2016-09-20 13:29:37 UTC) #20
Tom Sepez
Messages LGTM https://codereview.chromium.org/2353493002/diff/40001/device/generic_sensor/public/interfaces/sensor.mojom File device/generic_sensor/public/interfaces/sensor.mojom (right): https://codereview.chromium.org/2353493002/diff/40001/device/generic_sensor/public/interfaces/sensor.mojom#newcode34 device/generic_sensor/public/interfaces/sensor.mojom:34: const double kMaxAllowedFrequency = 60.0; nit: If ...
4 years, 3 months ago (2016-09-20 16:41:06 UTC) #21
timvolodine
thanks, lgtm % comments you could also change the title to something more descriptive, e.g. ...
4 years, 3 months ago (2016-09-20 17:46:37 UTC) #22
Mikhail
Thanks for review! https://codereview.chromium.org/2353493002/diff/20001/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html File third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html (right): https://codereview.chromium.org/2353493002/diff/20001/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html#newcode26 third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html:26: let ambientLightSensor = new AmbientLightSensor({frequency: 60}); ...
4 years, 3 months ago (2016-09-21 10:00:42 UTC) #23
timvolodine
thanks! pls update the title in description for consistency as well
4 years, 3 months ago (2016-09-21 14:01:24 UTC) #24
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/2353493002/40001
4 years, 2 months ago (2016-09-28 11:15:43 UTC) #32
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/2353493002/40001
4 years, 2 months ago (2016-09-28 12:19:59 UTC) #35
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-09-28 12:25:18 UTC) #37
commit-bot: I haz the power
4 years, 2 months ago (2016-09-28 12:27:15 UTC) #39
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63
Cr-Commit-Position: refs/heads/master@{#421501}

Powered by Google App Engine
This is Rietveld 408576698