New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 661478 link

Starred by 8 users

Issue metadata

Status: Verified
Owner:
Email to this user bounced
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Feature

Blocked on:
issue 715872

Blocking:
issue 445926
issue 695346
issue 695347
issue 695348



Sign in to add a comment

Motion sensors APIs based on Generic Sensor API

Project Member Reported by mikhail....@intel.com, Nov 2 2016

Issue description

Feature description:

This includes implementation of the following sensor APIs:

Accelerometer: https://w3c.github.io/accelerometer/
LinearAccelerationSensor: https://w3c.github.io/accelerometer/#linearaccelerationsensor-interface
Gyroscope: https://w3c.github.io/gyroscope/
AbsoluteOrientationSensor: https://w3c.github.io/orientation-sensor/
RelativeOrientationSensor: https://w3c.github.io/orientation-sensor/#relativeorientationsensor-interface

Eng owner: 
Alexander Shalamov <alexander.shalamov@intel.com>
Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>

Design doc: 
https://docs.google.com/document/d/1Ml65ZdW5AgIsZTszk4mD_ohr40pcrdVFOIf0ZtWxDv0/edit

The Generic Sensor API specification: 
https://w3c.github.io/sensors/

Intent to implement:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/_IReUkNKF6o

Are you planning on experimenting before launch?

Yes

Any new strings?

Yes (permission notification strings)

Any implications for Google webservices (i.e. sync, translate)?

No

Binary size?

Minor change (Generic Sensor Framework contains already most of the required functionality)

Do the existing perf tests exercise all aspects of your new feature(s)?

New perf tests will be added.

 
Sorry, I've forgotten to mention the bug number in my CL.

The patch has been landed and the link to the CL is here -
https://codereview.chromium.org/2492773002/

Cc: maksim.s...@intel.com
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/522d1f06c8e8bb100136ab0a83d69b04a8f244b8

commit 522d1f06c8e8bb100136ab0a83d69b04a8f244b8
Author: alexis.menard <alexis.menard@intel.com>
Date: Thu Nov 17 00:16:43 2016

[sensors] Accelerometer sensor bindings implementation

This patch implements Accelerometer [1] blink bindings.

Following layout tests added to test new functionality:
IDL tests.
- third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html
Accelerometer tests.
- third_party/WebKit/LayoutTests/sensor/accelerometer.html

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/_IReUkNKF6o

[1] ED specification for Accelerometer https://w3c.github.io/accelerometer/

Based on patch from Alexander Shalamov <alexander.shalamov@intel.com>

BUG= 661478 

Review-Url: https://codereview.chromium.org/2471003002
Cr-Commit-Position: refs/heads/master@{#432673}

[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html
[modify] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/modules_idl_files.gni
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/Accelerometer.h
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/AccelerometerOptions.idl
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/AccelerometerReading.cpp
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/AccelerometerReading.idl
[add] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/AccelerometerReadingInit.idl
[modify] https://crrev.com/522d1f06c8e8bb100136ab0a83d69b04a8f244b8/third_party/WebKit/Source/modules/sensor/BUILD.gn

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ac746389052ab446ed3514a33aaf08955b4dbf77

commit ac746389052ab446ed3514a33aaf08955b4dbf77
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Thu Nov 17 08:50:15 2016

[sensors](CrOS/Linux) Fix: create sensors when no scaling file is specified

A fix to a bug, which allows to create sensor readers, when no scaling files are
passed to be found

BUG= 661478 

Review-Url: https://codereview.chromium.org/2506973003
Cr-Commit-Position: refs/heads/master@{#432816}

[modify] https://crrev.com/ac746389052ab446ed3514a33aaf08955b4dbf77/device/generic_sensor/linux/platform_sensor_utils_linux.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d310abe41b192142f4cb31eb1854d2c51eff25db

commit d310abe41b192142f4cb31eb1854d2c51eff25db
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Thu Nov 17 11:10:16 2016

[sensors] Magnetometer sensor bindings implementation

This CL implements blink bindings for Magnetometer sensor [1].

Following layout tests added to test new functionality:
IDL tests.
- third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html
Magnetometer tests.
- third_party/WebKit/LayoutTests/sensor/magnetometer.html

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/_IReUkNKF6o

[1] ED specification for Magnetometer https://w3c.github.io/magnetometer/

BUG= 661478 

Review-Url: https://codereview.chromium.org/2507453002
Cr-Commit-Position: refs/heads/master@{#432840}

[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/BUILD.gn
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/Magnetometer.h
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/Magnetometer.idl
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/MagnetometerReading.h
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/MagnetometerReading.idl
[add] https://crrev.com/d310abe41b192142f4cb31eb1854d2c51eff25db/third_party/WebKit/Source/modules/sensor/MagnetometerReadingInit.idl

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c

commit 3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Nov 17 16:45:58 2016

[sensors] Gyroscope sensor bindings implementation

This CL implements blink bindings for Gyroscope sensor [1].
Layout tests are also added.

Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/_IReUkNKF6o
[1] ED specification for Gyroscope https://w3c.github.io/gyroscope/

BUG= 661478 

Review-Url: https://codereview.chromium.org/2506903003
Cr-Commit-Position: refs/heads/master@{#432894}

[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html
[modify] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/BUILD.gn
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/Gyroscope.h
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/Gyroscope.idl
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/GyroscopeReading.cpp
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/GyroscopeReading.h
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/GyroscopeReading.idl
[add] https://crrev.com/3d1bd0e6727ee92cc13fda7ca74055f5d8b49e5c/third_party/WebKit/Source/modules/sensor/GyroscopeReadingInit.idl

Cc: wanming....@intel.com
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dd28ec07d1c570b21114cfbe2432ce6d3c41f99d

commit dd28ec07d1c570b21114cfbe2432ce6d3c41f99d
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Tue Dec 13 11:48:47 2016

[sensors](CrOS/Linux) Fix calculations with offset

This cl fixes calculations done with offset value.
Offset value must be added to a raw value and only then multiplied
by a scaling value.
The formula is the following:
processed value = (raw + offset) * scale

BUG= 661478 

Review-Url: https://codereview.chromium.org/2570693004
Cr-Commit-Position: refs/heads/master@{#438132}

[modify] https://crrev.com/dd28ec07d1c570b21114cfbe2432ce6d3c41f99d/device/generic_sensor/linux/sensor_data_linux.cc
[modify] https://crrev.com/dd28ec07d1c570b21114cfbe2432ce6d3c41f99d/device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc

Status: Started (was: Assigned)
Description: Show this description
Components: Blink>Internals
Blocking: 695346 695347 695348
Project Member

Comment 14 by bugdroid1@chromium.org, Mar 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c6720bb2680945d6fe510f5f4772c62f27b4a9e

commit 4c6720bb2680945d6fe510f5f4772c62f27b4a9e
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Wed Mar 22 11:30:57 2017

[sensors][android] Add support for AbsoluteOrientation sensor

This CL introduces new sensor type ABSOLUTE_ORIENTATION that is responsible
for providing orientation quaternion. Android adaptation for GenericSensor
is updated to reflect changes as well as unit tests that verify mapping
between mojom and Android sensor type. SensorReading buffer is increased by
8 bytes to accomodate orientation quaternion representation.

W3C ED: https://w3c.github.io/orientation-sensor/

BUG= 661478 

Review-Url: https://codereview.chromium.org/2726093003
Cr-Commit-Position: refs/heads/master@{#458717}

[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensor.java
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensorProvider.java
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/platform_sensor_android.cc
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/platform_sensor_android.h
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/public/cpp/sensor_reading.h
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/public/interfaces/sensor.mojom
[modify] https://crrev.com/4c6720bb2680945d6fe510f5f4772c62f27b4a9e/device/generic_sensor/public/interfaces/sensor_provider.mojom

Project Member

Comment 15 by bugdroid1@chromium.org, Mar 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ededdbfe3f3f4863d0d5ed6fc92d7f22445bf681

commit ededdbfe3f3f4863d0d5ed6fc92d7f22445bf681
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Thu Mar 23 15:13:25 2017

[sensors][win] Add support for AbsoluteOrientation sensor

This CL adds support for AbsoluteOrientation sensor for
Windows platform. GenericSensor unit tests are updated
to verify new functionality.

W3C ED: https://w3c.github.io/orientation-sensor/

BUG= 661478 

Review-Url: https://codereview.chromium.org/2727813004
Cr-Commit-Position: refs/heads/master@{#459085}

[modify] https://crrev.com/ededdbfe3f3f4863d0d5ed6fc92d7f22445bf681/device/BUILD.gn
[modify] https://crrev.com/ededdbfe3f3f4863d0d5ed6fc92d7f22445bf681/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
[modify] https://crrev.com/ededdbfe3f3f4863d0d5ed6fc92d7f22445bf681/device/generic_sensor/platform_sensor_reader_win.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Mar 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e3e5baac82ee84437b0de0de0e208f7503ae2de3

commit e3e5baac82ee84437b0de0de0e208f7503ae2de3
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Mon Mar 27 12:05:54 2017

[Sensors] Implement bindings for AbsoluteOrientationSensor

Specification: https://w3c.github.io/orientation-sensor/

BUG= 661478 

Review-Url: https://codereview.chromium.org/2746573002
Cr-Commit-Position: refs/heads/master@{#459759}

[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/LayoutTests/sensor/idl-AbsoluteOrientationSensor.html
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/modules_idl_files.gni
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.cpp
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.h
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/BUILD.gn
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/OrientationSensor.h
[add] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/OrientationSensor.idl
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/e3e5baac82ee84437b0de0de0e208f7503ae2de3/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd

commit d2c9e9c9cf5b680bf176400148452bf50b2d6ffd
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Mon Apr 03 09:22:23 2017

[sensors] Align Accelerometer interface with the specification

The accelerometer sensor interface was split into 3 separate sensors:
Accelerometer, LinearAccelerationSensor and GravitySensor. Accelerometer
provides low-level sensor data, while latter two, are fusion sensors
and can be implemented using low-pass / high-pass filters and/or sensor
fusion with other low-level sensors.

https://w3c.github.io/accelerometer/#accelerometer-interface

BUG= 661478 

Review-Url: https://codereview.chromium.org/2788633004
Cr-Commit-Position: refs/heads/master@{#461391}

[modify] https://crrev.com/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
[modify] https://crrev.com/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd/third_party/WebKit/Source/modules/sensor/Accelerometer.h
[modify] https://crrev.com/d2c9e9c9cf5b680bf176400148452bf50b2d6ffd/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
[delete] https://crrev.com/3d96da3328608d15036eb4531e4ef62a7e583fc8/third_party/WebKit/Source/modules/sensor/AccelerometerOptions.idl

Project Member

Comment 19 by bugdroid1@chromium.org, Apr 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e60fc7f9d9c594d84422ebfc796abca4a70459ab

commit e60fc7f9d9c594d84422ebfc796abca4a70459ab
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Apr 07 11:18:01 2017

[Sensors] Update exceptions throwing from OrientationSensor.populateMatrix()

The updated OrientationSensor.populateMatrix() algorithm[1] does not check sensor's state, it checks only whether the reading data are present.

BUG= 661478 

[1] https://w3c.github.io/orientation-sensor/#orientationsensor-populatematrix

Review-Url: https://codereview.chromium.org/2798923003
Cr-Commit-Position: refs/heads/master@{#462835}

[modify] https://crrev.com/e60fc7f9d9c594d84422ebfc796abca4a70459ab/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html
[modify] https://crrev.com/e60fc7f9d9c594d84422ebfc796abca4a70459ab/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp

Project Member

Comment 20 by bugdroid1@chromium.org, Apr 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ce0624a942214db2dea8fcb25d2585a63e9d3da0

commit ce0624a942214db2dea8fcb25d2585a63e9d3da0
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Tue Apr 11 07:36:40 2017

[Sensors] OrientationSensor.quaternion returns [x, y, z, w]

According to the updated specification [1] OrientationSensor.quaternion returns [x, y, z, w] instead of previous [w, x, y, z].

BUG= 661478 

[1] https://w3c.github.io/orientation-sensor/#model

Review-Url: https://codereview.chromium.org/2809743002
Cr-Commit-Position: refs/heads/master@{#463566}

[modify] https://crrev.com/ce0624a942214db2dea8fcb25d2585a63e9d3da0/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html
[modify] https://crrev.com/ce0624a942214db2dea8fcb25d2585a63e9d3da0/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp

Components: -Blink>Internals Blink>Sensor
Blockedon: 715872
Cc: palmer@chromium.org
Comment from palmer@ on https://codereview.chromium.org/2847253002/#msg60:

Following this chain of links:

https://w3c.github.io/orientation-sensor/#usecases-requirements

https://w3c.github.io/motion-sensors/#usecases-and-requirements

https://w3c.github.io/motion-sensors/#security-and-privacy

https://www.w3.org/TR/generic-sensor/#security-and-privacy

I'm left with the impression that we have a sensor that has high sample rate and
precision, and that that is necessary to support the use-cases, but that we
don't have a clear story on what kind of control/informed consent/visibility
people will have when using origins that use this API.

In particular, I have a feeling that we are not going to be able to have one
generic protection mechanism for all the sensors, because the sensors support
use-cases with different requirements. (Consider this API vs. the Ambient Light
Sensor API, for example. See
https://bugs.chromium.org/p/chromium/issues/detail?id=642731#c17)

Before I can give a security thumbs-up, I'd like to see realistic,
non-speculative use-cases for all the generic sensor APIs, and safety mechanisms
suited to each API/sensor type. The most likely available sensor mechanisms are:

* Reducing sample rate to the minimum necessary
* Reducing sample precision to the minimum necessary
* Requiring callers to be in the currently-focused tab
* Requiring callers to be in the top-level document
* Requiring callers to have received a user gesture before getting some samples
* Requiring callers to have received an origin-scoped permission (prompting)
(this is probably the least good defense mechanism, but may sometimes be
necessary)

The chrome-security-enamel@google.com team may be able to help you nail down
which defenses are best when and for which sensors.
reilly@, palmer@ Thanks for your comments! 
We're now working to figure out the minimum required sensor readings sample rate and precision, this research however might be quite time-consuming.

The following mechanisms are already in place:
* Samples are send only to a currently visible page
* Requiring callers to be in the top-level document
* Sensor objects can be constructed only on secure contexts

Working on permissions infra is in progress.

The "* Requiring callers to have received a user gesture before getting some samples" option is something that we should start to work on.

Additionally we're investigating other mitigation strategies
https://github.com/w3c/sensors/issues/189
Project Member

Comment 25 by bugdroid1@chromium.org, Jun 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5e98276d1f29fbb44d414f20630a2dfb7c376727

commit 5e98276d1f29fbb44d414f20630a2dfb7c376727
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Jun 01 16:34:09 2017

[Sensors] Bindings for RelativeOrientationSensor

BUG= 661478 

Review-Url: https://codereview.chromium.org/2908393002
Cr-Commit-Position: refs/heads/master@{#476320}

[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service
[delete] https://crrev.com/47f2c48469be9345d1f9ab668d05212794767a0c/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html
[add] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/Source/modules/sensor/BUILD.gn
[add] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.cpp
[add] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.h
[add] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/third_party/WebKit/public/platform/UseCounterFeature.def
[modify] https://crrev.com/5e98276d1f29fbb44d414f20630a2dfb7c376727/tools/metrics/histograms/enums.xml

Blocking: 445926
Project Member

Comment 27 by bugdroid1@chromium.org, Jul 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3a64de9c6ac4ae2724334f599141537b7d6d033

commit a3a64de9c6ac4ae2724334f599141537b7d6d033
Author: Alexander Shalamov <alexander.shalamov@intel.com>
Date: Thu Jul 06 06:51:56 2017

[sensors] Implement LinearAccelerationSensor bindings

This CL adds bindings for LinearAccelerationSensor [1] and new
layout tests. Linear acceleration sensor allows web developers
to get acceleration of a device without contribution of a
gravity force, thus, removes necessity to implement high-pass
filters in JS.

Bug:  661478 

[1] https://w3c.github.io/accelerometer/#linearaccelerationsensor

Change-Id: I1424ddd78db7441f47d972256f279a96b417d1cf
Reviewed-on: https://chromium-review.googlesource.com/559054
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Oliver Chang (OOO until July 10) <ochang@chromium.org>
Reviewed-by: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484487}
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[add] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/LayoutTests/sensor/idl-LinearAccelerationSensor.html
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/sensor/Accelerometer.h
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/sensor/BUILD.gn
[add] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.cpp
[add] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.h
[add] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/third_party/WebKit/public/platform/web_feature.mojom
[modify] https://crrev.com/a3a64de9c6ac4ae2724334f599141537b7d6d033/tools/metrics/histograms/enums.xml

Cc: juncai@chromium.org
Project Member

Comment 29 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9165b31a4a1ffc6347d00252bb0b9389ee9120b1

commit 9165b31a4a1ffc6347d00252bb0b9389ee9120b1
Author: Alexander Shalamov <alexander.shalamov@intel.com>
Date: Thu Aug 10 14:04:57 2017

[sensors] Implement linear acceleration sensor on Linux/ChromeOS

This CL adds support for linear acceleration sensor for Linux and
ChromeOS platforms. Low-pass fusion algorithm is used for the
implementation.

Bug:  661478 
Change-Id: I681fc64b8d36b65277eaffd643e98fa7a6a7023b
Reviewed-on: https://chromium-review.googlesource.com/608128
Commit-Queue: Alexander Shalamov <alexander.shalamov@intel.com>
Reviewed-by: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493376}
[modify] https://crrev.com/9165b31a4a1ffc6347d00252bb0b9389ee9120b1/services/device/generic_sensor/README.md
[modify] https://crrev.com/9165b31a4a1ffc6347d00252bb0b9389ee9120b1/services/device/generic_sensor/platform_sensor_provider_linux.cc
[modify] https://crrev.com/9165b31a4a1ffc6347d00252bb0b9389ee9120b1/services/device/generic_sensor/platform_sensor_provider_linux.h

Description: Show this description
Labels: Pri-3
Status: Verified (was: Started)
The motion sensors APIs are implemented and they are exposed for origin trial in Chrome M-63. Think we can close this bug.

Sign in to add a comment