Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Issue 606766 Ambient Light Sensor API based on Generic Sensor API.
Starred by 14 users Project Member Reported by dongseon...@intel.com, Apr 26 2016 Back to list
Status: Started
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android, Windows, Chrome, Mac
Pri: 3
Type: Launch-OWP
Launch-Accessibility: ----
Launch-Legal: ----
Launch-M-Approved: ----
Launch-M-Target: ----
Launch-Privacy: ----
Launch-Security: ----
Launch-Status: ----
Launch-Test: ----
Launch-UI: ----

Blocked on: View detail
issue 640769
issue 680043

Blocking:
issue 445926



Sign in to add a comment
Change description:

This change allows the developer to access sensor data, in this case Ambient Light Sensor data in a more consistent way.

Changes to API surface:
Old way:
window.addEventListener('devicelight', function(event) {
  console.log(event.value);
});


New way:
var s = new AmbientLightSensor();
s.start();
s.onchange = event => console.log(event.reading.illuminance);
s.stop();

Links:
Public standards discussion: 
https://w3c.github.io/sensors/
http://w3c.github.io/ambient-light/


Support in other browsers:
Edge: Positive
Firefox: Positive
Safari: No signals


 
Chrome Platform Status link: https://www.chromestatus.com/features/5298357018820608
Cc: -rijubrat...@intel.com timvolod...@chromium.org
Owner: rijubrat...@intel.com
Status: Started
Comment 3 by owe...@chromium.org, May 12 2016
Please be aware that this feature will likely require a privacy and security review.

If one of you could let me know when you have the code landed and are a few weeks out from enabling I will get the reviews started at that point.

Ofcourse Owen. I will keep you in the loop.
If somebody is interested to have a look right now, I have a first version of the code at https://codereview.chromium.org/1892083002/ . This CL is mainly for comments on the overall structure. Details will be filled up as we go.

Project Member Comment 5 by bugdroid1@chromium.org, May 30 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea88054ae4e7cd154177bb23426271fc0d6906ab

commit ea88054ae4e7cd154177bb23426271fc0d6906ab
Author: rijubrata.bhaumik <rijubrata.bhaumik@intel.com>
Date: Mon May 30 10:19:29 2016

[sensors]: Introduce the Generic Sensor API.

The Generic Sensor API defines a framework for exposing sensor data to
the Open Web Platform. This CL introduces the IDLs for Sensor* interface
and adds the supporting .h|cpp files.

The ED for the Generic Sensor API is here -
https://w3c.github.io/sensors/

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

BUG=606766

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

[modify] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/EventTargetModulesFactory.in
[modify] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/modules.gypi
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/DEPS
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/OWNERS
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/Sensor.h
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/Sensor.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.cpp
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.h
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorErrorEventInit.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorOptions.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReading.h
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReading.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorReadingEventInit.idl
[add] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/modules/sensor/SensorState.h
[modify] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/ea88054ae4e7cd154177bb23426271fc0d6906ab/tools/metrics/histograms/histograms.xml

Project Member Comment 6 by bugdroid1@chromium.org, Aug 2 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74075f4538e5ca250ab1dac556bb9ef4fcdbc9af

commit 74075f4538e5ca250ab1dac556bb9ef4fcdbc9af
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Tue Aug 02 11:06:49 2016

[mojo] Add shared buffer support to mojo JavaScript bindings.

This patch adds shared buffer support to mojo JavaScript
bindings. Tests are updated to verify new functionality.

Added functions:
  core.createSharedBuffer
  core.duplicateBufferHandle
  core.mapBuffer
  core.unmapBuffer

BUG=606766

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

[modify] https://crrev.com/74075f4538e5ca250ab1dac556bb9ef4fcdbc9af/mojo/edk/js/core.cc
[modify] https://crrev.com/74075f4538e5ca250ab1dac556bb9ef4fcdbc9af/mojo/public/js/core.js
[modify] https://crrev.com/74075f4538e5ca250ab1dac556bb9ef4fcdbc9af/mojo/public/js/core_unittests.js

Project Member Comment 7 by bugdroid1@chromium.org, Aug 23 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66ac3d4e8a635db673ff6dd47cc59976ee0b956c

commit 66ac3d4e8a635db673ff6dd47cc59976ee0b956c
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Tue Aug 23 18:27:15 2016

[sensors] Introduce Generic Sensor API interfaces

Authors: alexander.shalamov@intel.com, mikhail.pozdnyakov@intel.com

New generic sensor mojo interfaces are introduced together with platform independent implementations.

Intent To implement mailing thread containing design description: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/4J7Z088MBAAJ

BUG=606766
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

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

[modify] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/content/browser/BUILD.gn
[modify] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/content/browser/DEPS
[modify] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/content/public/common/content_switches.cc
[modify] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/content/public/common/content_switches.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/BUILD.gn
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/OWNERS
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor_configuration.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor_configuration.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor_provider.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor_provider_base.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor_provider_base.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/platform_sensor_provider_default.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/BUILD.gn
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/OWNERS
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/sensor.mojom
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/sensor.typemap
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/sensor_provider.mojom
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/sensor_struct_traits.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/sensor_struct_traits.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/public/interfaces/typemaps.gni
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/sensor_export.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/sensor_impl.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/sensor_impl.h
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/sensor_provider_impl.cc
[add] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/device/generic_sensor/sensor_provider_impl.h
[modify] https://crrev.com/66ac3d4e8a635db673ff6dd47cc59976ee0b956c/mojo/public/tools/bindings/chromium_bindings_configuration.gni

Comment 8 by kbr@chromium.org, Aug 24 2016
Blockedon: 640769
Project Member Comment 9 by bugdroid1@chromium.org, Aug 30 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/090f099c1736b17fd7c8b5ba9033d08466ebd723

commit 090f099c1736b17fd7c8b5ba9033d08466ebd723
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Tue Aug 30 09:54:44 2016

[sensors] Add GetDefaultConfiguration() to generic sensor mojo interface.

This patch adds 'GetDefaultConfiguration' method to the generic sensor interface.
It is required in cases when client (e.g. blink bindings) doesn't know what
configuration to use for sensor initialization or when configuration that is
provided to the client is incomplete.

BUG=606766

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

[modify] https://crrev.com/090f099c1736b17fd7c8b5ba9033d08466ebd723/device/generic_sensor/platform_sensor.h
[modify] https://crrev.com/090f099c1736b17fd7c8b5ba9033d08466ebd723/device/generic_sensor/public/interfaces/sensor.mojom
[modify] https://crrev.com/090f099c1736b17fd7c8b5ba9033d08466ebd723/device/generic_sensor/sensor_impl.cc
[modify] https://crrev.com/090f099c1736b17fd7c8b5ba9033d08466ebd723/device/generic_sensor/sensor_impl.h

Project Member Comment 10 by bugdroid1@chromium.org, Sep 7
Project Member Comment 11 by bugdroid1@chromium.org, Sep 8
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f86cf248d11f5d6b9de962c75821b952622b8c8

commit 9f86cf248d11f5d6b9de962c75821b952622b8c8
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Sep 08 05:49:11 2016

[Sensors] Implementation of the Generic Sensor API

This patch contains blink-side infrastructure of the Generic Sensors Framework, i.e. implementation of 'Sensor' and 'SensorReading' classes.

Also it introduces 'SensorPollingStrategy' interface that should provide different polling behaviour depending on
the sensor reporting mode (implementation will be added in the following CLs).

Specification: https://w3c.github.io/sensors

BUG=606766

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

[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorOptions.idl
[add] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.cpp
[add] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.h
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReading.h
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReading.idl
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h
[delete] https://crrev.com/8ecbbdd50c56c6f62d7e78294dddca6b364b35fb/third_party/WebKit/Source/modules/sensor/SensorState.h

Project Member Comment 12 by bugdroid1@chromium.org, Sep 8
Labels: merge-merged-2854
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f86cf248d11f5d6b9de962c75821b952622b8c8

commit 9f86cf248d11f5d6b9de962c75821b952622b8c8
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Sep 08 05:49:11 2016

[Sensors] Implementation of the Generic Sensor API

This patch contains blink-side infrastructure of the Generic Sensors Framework, i.e. implementation of 'Sensor' and 'SensorReading' classes.

Also it introduces 'SensorPollingStrategy' interface that should provide different polling behaviour depending on
the sensor reporting mode (implementation will be added in the following CLs).

Specification: https://w3c.github.io/sensors

BUG=606766

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

[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorOptions.idl
[add] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.cpp
[add] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.h
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReading.h
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReading.idl
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
[modify] https://crrev.com/9f86cf248d11f5d6b9de962c75821b952622b8c8/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h
[delete] https://crrev.com/8ecbbdd50c56c6f62d7e78294dddca6b364b35fb/third_party/WebKit/Source/modules/sensor/SensorState.h

Blocking: 445926
Project Member Comment 14 by bugdroid1@chromium.org, Sep 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed85e05c4b6872a9f595e56120d61db4dd35a6bc

commit ed85e05c4b6872a9f595e56120d61db4dd35a6bc
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Sep 09 09:16:33 2016

[Sensors] Implement sensor data polling

This patch contains implementations of SensorPollingStrategy interface, defining when sensor reading is updated from shared buffer.

Also it contains logic for Suspend/Resume mojo API calls based on the page visibility. For this purpose 'SensorProxy' inherits 'PageVisibilityObserver'.

Specification: https://w3c.github.io/sensors

BUG=606766

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

[modify] https://crrev.com/ed85e05c4b6872a9f595e56120d61db4dd35a6bc/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/ed85e05c4b6872a9f595e56120d61db4dd35a6bc/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.cpp
[modify] https://crrev.com/ed85e05c4b6872a9f595e56120d61db4dd35a6bc/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.h
[modify] https://crrev.com/ed85e05c4b6872a9f595e56120d61db4dd35a6bc/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/ed85e05c4b6872a9f595e56120d61db4dd35a6bc/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 15 by bugdroid1@chromium.org, Sep 14
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b49349c6d3c4e7875fbb3ed8e3535f71006e444c

commit b49349c6d3c4e7875fbb3ed8e3535f71006e444c
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Sep 14 10:29:55 2016

[Sensors] Handle default sensor configuration

This patch provides platform sensor's default configuration to the Blink side at 'SensorProxy' initialization stage.
Default configuration will be used for sensors construction by default, e.g. 'let sensor = new AmbientLightSensor();'.

A few related changes are added as well:
- Rename 'SensorReadBuffer' to 'SensorInitParams'
- Remove repeated code calling 'startListening()' from 'Sensor::onSensorInitialized()'
- Call 'reset()' for all 'SensorProxy' members from 'SensorProxy::handleSensorError()'

BUG=606766

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

[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/device/generic_sensor/platform_sensor_provider_base.cc
[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/device/generic_sensor/public/interfaces/sensor_provider.mojom
[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/b49349c6d3c4e7875fbb3ed8e3535f71006e444c/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 16 by bugdroid1@chromium.org, Sep 16
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0d874185edcfa35107b3c05fa3dba412297bdc9

commit a0d874185edcfa35107b3c05fa3dba412297bdc9
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Fri Sep 16 06:59:14 2016

[sensors] Android platform adaptation for Generic Sensor API

Authors: Alexander Shalamov, Mikhail Pozdnyakov

This patch introduces implementation of generic sensor interfaces
for Android platform. Support for following sensors is added:
ambient light, gyroscope, accelerometer, linear acceleration and magnetometer.

BUG=606766

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

[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/content/app/BUILD.gn
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/content/app/DEPS
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/content/app/android/library_loader_hooks.cc
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/content/public/android/BUILD.gn
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/BUILD.gn
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/BUILD.gn
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/DEPS
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensor.java
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensorProvider.java
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/android/sensors_jni_registrar.cc
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/android/sensors_jni_registrar.h
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/platform_sensor.cc
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/platform_sensor.h
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/platform_sensor_android.cc
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/platform_sensor_android.h
[add] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/platform_sensor_provider_android.cc
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/platform_sensor_provider_base.h
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/public/cpp/platform_sensor_configuration.cc
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/public/cpp/platform_sensor_configuration.h
[modify] https://crrev.com/a0d874185edcfa35107b3c05fa3dba412297bdc9/device/generic_sensor/public/interfaces/sensor.mojom

Project Member Comment 17 by bugdroid1@chromium.org, Sep 19
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c457d06894e8f01b24ae83750203fb5d8819c560

commit c457d06894e8f01b24ae83750203fb5d8819c560
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Mon Sep 19 12:32:48 2016

[sensors] Ambient light sensor bindings implementation

This patch implements AmbientLightSensor [1] blink bindings and adds
LayoutTest helpers for testing sensors that are based on Generic Sensor API.

Following layout tests added to test new functionality:
IDL tests.
 - third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
 - third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensorReading.html
AmbientLightSensor tests.
 - third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ

[1] ED specification for Ambient Light Sensor http://w3c.github.io/ambient-light/

BUG=606766

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

[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensorReading.html
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/LayoutTests/sensor/mock-sensor.html
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/modules_idl_files.gni
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl
[add] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl
[modify] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[modify] https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560/third_party/WebKit/Source/modules/sensor/SensorReading.h

The last CL is causing new test failures on Blink bots -- both of the two new tests, mock-sensor and ambient-light-sensor are failing consistently.

See
https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=sensor%2Fambient-light-sensor.html%2C%20sensor%2Fmock-sensor.html

First failed build on MacOS 10.10:
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.10/builds/23859

Reverting this CL until those can be fixed.
Project Member Comment 19 by bugdroid1@chromium.org, Sep 19
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a7e4b7e260983b75067aacdbd55c5182675c4829

commit a7e4b7e260983b75067aacdbd55c5182675c4829
Author: iclelland <iclelland@chromium.org>
Date: Mon Sep 19 14:42:08 2016

Revert of [sensors] Ambient light sensor bindings implementation (patchset #5 id:80001 of https://codereview.chromium.org/2332323002/ )

Reason for revert:
Sorry for the revert -- two new tests are failing immediately on several Blink bots:
sensor/mock-sensor.html
sensor/ambient-light-sensor.html

See
https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=sensor%2Fambient-light-sensor.html%2C%20sensor%2Fmock-sensor.html

First failed build on MacOS 10.10:
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.10/builds/23859

Original issue's description:
> [sensors] Ambient light sensor bindings implementation
>
> This patch implements AmbientLightSensor [1] blink bindings and adds
> LayoutTest helpers for testing sensors that are based on Generic Sensor API.
>
> Following layout tests added to test new functionality:
> IDL tests.
>  - third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
>  - third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensorReading.html
> AmbientLightSensor tests.
>  - third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
>
> Intent to Implement:
> https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ
>
> [1] ED specification for Ambient Light Sensor http://w3c.github.io/ambient-light/
>
> BUG=606766
>
> Committed: https://crrev.com/c457d06894e8f01b24ae83750203fb5d8819c560
> Cr-Commit-Position: refs/heads/master@{#419438}

TBR=jochen@chromium.org,haraken@chromium.org,mikhail.pozdnyakov@intel.com,rijubrata.bhaumik@intel.com,timvolodine@chromium.org,alexander.shalamov@intel.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=606766

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

[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensorReading.html
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/LayoutTests/sensor/mock-sensor.html
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/a7e4b7e260983b75067aacdbd55c5182675c4829/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/a7e4b7e260983b75067aacdbd55c5182675c4829/third_party/WebKit/Source/modules/modules_idl_files.gni
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl
[delete] https://crrev.com/5cc683b91a89206e131372bfd1435bcdda7c9589/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl
[modify] https://crrev.com/a7e4b7e260983b75067aacdbd55c5182675c4829/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/a7e4b7e260983b75067aacdbd55c5182675c4829/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[modify] https://crrev.com/a7e4b7e260983b75067aacdbd55c5182675c4829/third_party/WebKit/Source/modules/sensor/SensorReading.h

Cc: shrike@chromium.org
Project Member Comment 21 by bugdroid1@chromium.org, Sep 20
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/009f9ccac2f1205a2634c50ded12c011d5162e70

commit 009f9ccac2f1205a2634c50ded12c011d5162e70
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Tue Sep 20 16:04:49 2016

[mojo] Initialize MojoCreateSharedBufferOptions struct size.

Initialization of MojoCreateSharedBufferOptions struct size is
required to validate flags that are passed in the options parameter.
Modifications in this CL are tested by mojo_js_unittests.

BUG=606766

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

[modify] https://crrev.com/009f9ccac2f1205a2634c50ded12c011d5162e70/mojo/edk/js/core.cc

Project Member Comment 22 by bugdroid1@chromium.org, Sep 28
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5fa13b93096a4f609dd0df403eb76233e17efb05

commit 5fa13b93096a4f609dd0df403eb76233e17efb05
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Wed Sep 28 09:17:08 2016

Reland of [sensors] Ambient light sensor bindings implementation

Reverted in:
https://codereview.chromium.org/2348333002/

Reason for revert:
Two new tests are failing on several Blink bots.

Original CL: https://codereview.chromium.org/2332323002/

This patch implements AmbientLightSensor [1] blink bindings and adds
LayoutTest helpers for testing sensors that are based on Generic Sensor API.

Following layout tests added to test new functionality:
IDL tests.
- third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
AmbientLightSensor tests.
- third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ

[1] ED specification for Ambient Light Sensor http://w3c.github.io/ambient-light/

TBR=haraken@chromium.org,jochen@chromium.org,timvolodine@chromium.org,mikhail.pozdnyakov@intel.com
BUG=606766

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

[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/LayoutTests/sensor/mock-sensor.html
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/modules_idl_files.gni
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl
[add] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl
[modify] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[modify] https://crrev.com/5fa13b93096a4f609dd0df403eb76233e17efb05/third_party/WebKit/Source/modules/sensor/SensorReading.h

Project Member Comment 24 by bugdroid1@chromium.org, Sep 28
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eecd2806be6ab3534ca008298cc7dec9facd2c63

commit eecd2806be6ab3534ca008298cc7dec9facd2c63
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Sep 28 12:24:56 2016

[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

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

[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/device/generic_sensor/public/cpp/platform_sensor_configuration.cc
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/device/generic_sensor/public/cpp/platform_sensor_configuration.h
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/device/generic_sensor/public/cpp/sensor_struct_traits.cc
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/device/generic_sensor/public/interfaces/sensor.mojom
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/eecd2806be6ab3534ca008298cc7dec9facd2c63/third_party/WebKit/Source/modules/sensor/Sensor.h

Project Member Comment 25 by bugdroid1@chromium.org, Oct 4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/28cd84c55e4fc6c1789fca46a4e23d2c4b90f517

commit 28cd84c55e4fc6c1789fca46a4e23d2c4b90f517
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Tue Oct 04 12:06:55 2016

[sensors] Dispatch sensor events using postTask

In order to avoid re-entrancy issues, this CL modifies sensor event
dispatching code and uses postTask to schedule event dispatch.
New test is added to ambient-light-sensor.html that checks if generic
sensor code works correctly when sensor is not supported

BUG=606766

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

[modify] https://crrev.com/28cd84c55e4fc6c1789fca46a4e23d2c4b90f517/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/28cd84c55e4fc6c1789fca46a4e23d2c4b90f517/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/28cd84c55e4fc6c1789fca46a4e23d2c4b90f517/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/28cd84c55e4fc6c1789fca46a4e23d2c4b90f517/third_party/WebKit/Source/modules/sensor/Sensor.h

Project Member Comment 26 by bugdroid1@chromium.org, Oct 5
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6

commit 85cc22d79580bc5ad58db03ff3e4fb8f9db539a6
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Wed Oct 05 11:13:30 2016

[sensors] Introduce asynchronous way to create sensors.

As long as sensors implementation on Linux/ChromeOS will
be based on reading from files (sensors' files are located
in /sys/dev/iio/devices), asynchronous way of creating
sensors is introduced with this patch.

To be more specific, the asynchronous path is needed because
sensors' existence will be checked by blocking IO methods in
case of Linux/ChromeOS and in order to be able to say
whether a sensor exists or not, asynchronous path will be
used.

In case of Android and Mac, callbacks will be
called immediately as soon as a sensor manager in Android or
IOServiceGetMatchingService in Mac returns a sensor object
or nullptr.

How it works:
As soon as a request for a new sensor is received, callbacks
are stored into a vector which is pushed into a map with a
type key and the vector itself. If no callback has been
stored before, CreateSensorInternal() method is called.
Then:
 *Linux/ChromeOS (under development): a new thread is
  created which will handle concrete sensors creation.
 *Android: when CreateSensorInternal() is called, java code
  is called and everything is handled by the sensor manager,
  which returns synchronously. Once sensor found, it is
  returned. Otherwise, nullptr is returned.
 *Mac (under development)
  https://codereview.chromium.org/2332903002/: everything
  is handled by IOServiceGetMatchingService, which returns
  synchronously.

BUG=606766

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

[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/fake_platform_sensor_provider.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/fake_platform_sensor_provider.h
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_android.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_base.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_base.h
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_unittest.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/sensor_provider_impl.h

Project Member Comment 27 by bugdroid1@chromium.org, Oct 5
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3

commit e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Oct 05 17:12:30 2016

[Sensors] 'onerror' event implementation

This CL introduces sensor 'onerror' event and layout tests.

BUG=606766

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

[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.cpp
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.h
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEventInit.idl
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 28 by bugdroid1@chromium.org, Oct 5
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24e8468bd738a1df17fe4f20ea251b3d87c4978a

commit 24e8468bd738a1df17fe4f20ea251b3d87c4978a
Author: alexis.menard <alexis.menard@intel.com>
Date: Wed Oct 05 19:48:53 2016

[sensors] Fix crash after 85cc22d when using async creation of sensors.

The fix is simple as the callback was called with null pointers. Make
sure to call it with the right arguments.

BUG=606766

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

[modify] https://crrev.com/24e8468bd738a1df17fe4f20ea251b3d87c4978a/device/generic_sensor/sensor_provider_impl.cc

Project Member Comment 29 by bugdroid1@chromium.org, Oct 10
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46db493d716421b1bf468d7b29bd61eedfdd32fb

commit 46db493d716421b1bf468d7b29bd61eedfdd32fb
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Mon Oct 10 10:59:07 2016

[sensors] Fix crash when nullptr instead of a pointer to sensor is sent

Send mojom::SensorClientRequest to NotifySensorCreated in order
to avoid crash when sensor is nullptr.

BUG=606766

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

[modify] https://crrev.com/46db493d716421b1bf468d7b29bd61eedfdd32fb/device/generic_sensor/sensor_provider_impl.cc

Project Member Comment 30 by bugdroid1@chromium.org, Oct 11
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e8d58c66a5c826d4b517ecb8988508fc877ef39

commit 9e8d58c66a5c826d4b517ecb8988508fc877ef39
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Tue Oct 11 11:02:04 2016

[Sensors] Improvements in shared buffer managing

This patch adds the following improvements:
-Introduces SeqLock synchronization for shared buffer reads and writes.

- Single sensor shared buffer is guaranteed to have same fixed size on every platform. This is important as our layout tests use fixed sized shared buffer on JS side.

- Introduced common data structures for sensor reading and sensor reading buffer that are used in both blink and platform layers.

For the implementation on Android shared buffer operations moved from java to generic C++ code, same code is to be reused for implementations on other platforms.

BUG=606766

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

[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/BUILD.gn
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensor.java
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/fake_platform_sensor.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/fake_platform_sensor.h
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/fake_platform_sensor_provider.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/fake_platform_sensor_provider.h
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor.h
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor_android.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor_android.h
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor_provider_android.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor_provider_base.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor_provider_base.h
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/platform_sensor_provider_unittest.cc
[add] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/public/cpp/BUILD.gn
[add] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/public/cpp/sensor_reading.cc
[add] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/public/cpp/sensor_reading.h
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/public/interfaces/sensor_provider.mojom
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/Source/modules/sensor/DEPS
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/9e8d58c66a5c826d4b517ecb8988508fc877ef39/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 31 by bugdroid1@chromium.org, Oct 11
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38

commit a5d055a1bd9e2db124cd7e2ef13c827f765f3c38
Author: alexis.menard <alexis.menard@intel.com>
Date: Tue Oct 11 17:50:36 2016

[sensors] [mac] Implement ambient light sensor for macOS

Use IOKit to get information from the platform and callback
when the value of the sensor is changing.

Make sure to provide the time stamp as well (which is required
by the spec). The data is passed in a shared buffer using
seqlock mechanism.

The patch also moves around code in content/device_sensors
because they are needed by this implementation. This will
avoid device/ to depend on content/. The default frequency
to pull the ambient light is now inside device/sensors/public/cpp
(shared amongst platforms). The method to convert the value
returned by the LMU sensor (on mac machines) to lux is moved
to device/sensors/public/cpp) as well.

Finally the patch also add a smart pointer to handle IONotificationPortRef.
There are other opportunities in the chromium codebase to use that new smart
pointer, I will land a follow up CL.

Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ

    BUG=606766

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

[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/base/BUILD.gn
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/base/mac/scoped_ionotificationportref.h
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/content/browser/device_sensors/DEPS
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/content/browser/device_sensors/data_fetcher_shared_memory_mac.cc
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/content/renderer/DEPS
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/content/renderer/device_sensors/device_light_event_pump.cc
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/generic_sensor/BUILD.gn
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/generic_sensor/DEPS
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/generic_sensor/platform_sensor_ambient_light_mac.cc
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/generic_sensor/platform_sensor_ambient_light_mac.h
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/generic_sensor/platform_sensor_provider_mac.cc
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/generic_sensor/platform_sensor_provider_mac.h
[modify] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/sensors/public/cpp/BUILD.gn
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/sensors/public/cpp/device_sensors_consts.h
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/sensors/public/cpp/device_util_mac.cc
[add] https://crrev.com/a5d055a1bd9e2db124cd7e2ef13c827f765f3c38/device/sensors/public/cpp/device_util_mac.h

Project Member Comment 32 by bugdroid1@chromium.org, Oct 12
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4096a0b4682c42131a40ba0f04e8263b1d19d13

commit d4096a0b4682c42131a40ba0f04e8263b1d19d13
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Oct 12 10:12:02 2016

[Sensors] Adding chrome flag to enable Generic Sensor based APIs

This change adds a flag to enable family of sensor APIs which are based on Generic Sensor API including Ambient Light Sensor API.
So far it is only available on Android and Mac OS, should become available on other platforms as soon as platform-specific implementation lands.

Generic Sensor API: https://w3c.github.io/sensors/
Ambient Light Sensor API: http://w3c.github.io/ambient-light/

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

BUG=606766
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

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

[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/chrome/app/generated_resources.grd
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/chrome/browser/about_flags.cc
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/content/child/runtime_features.cc
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/content/public/common/content_features.cc
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/content/public/common/content_features.h
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/content/public/common/content_switches.cc
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/content/public/common/content_switches.h
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/third_party/WebKit/public/web/WebRuntimeFeatures.h
[modify] https://crrev.com/d4096a0b4682c42131a40ba0f04e8263b1d19d13/tools/metrics/histograms/histograms.xml

Project Member Comment 33 by bugdroid1@chromium.org, Oct 12
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/47234d95ab0dab229fa8c108b80bdb0ac63ed151

commit 47234d95ab0dab229fa8c108b80bdb0ac63ed151
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Oct 12 15:27:48 2016

[Sensors] Read-only access to the sensors shared buffer from Blink

Provide read-only access to the sensors shared buffer for the Blink-side clients (i.e. JS sensor instances).

BUG=606766

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

[modify] https://crrev.com/47234d95ab0dab229fa8c108b80bdb0ac63ed151/device/generic_sensor/platform_sensor_provider_base.cc

Project Member Comment 34 by bugdroid1@chromium.org, Oct 20
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed8fd058823b1502c6290e19c2c4eac7f8739db5

commit ed8fd058823b1502c6290e19c2c4eac7f8739db5
Author: alexis.menard <alexis.menard@intel.com>
Date: Thu Oct 20 19:45:28 2016

[sensors] Make generic_sensor a component

The motivation is to allow classes to be exported (for component builds) so that
a browser test can be written outside of device/ and on top
of content/ and the needed classes can be used to write a fake/mock
provider with fake/mock sensors (the test will come in follow up CL).
The motivation is to test end to end the feature in a cross platform
and non hardware dependent way and checking JavaScript behavior.

BUG=606766

Review-Url: https://chromiumcodereview.appspot.com/2431163004
Cr-Commit-Position: refs/heads/master@{#426567}

[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/BUILD.gn
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/android/sensors_jni_registrar.h
[add] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/generic_sensor_export.h
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/platform_sensor.h
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/platform_sensor_provider.h
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/platform_sensor_provider_base.h
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/public/cpp/BUILD.gn
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/public/cpp/platform_sensor_configuration.h
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/public/cpp/sensor_reading.h
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/public/interfaces/BUILD.gn
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/public/interfaces/sensor.typemap
[modify] https://crrev.com/ed8fd058823b1502c6290e19c2c4eac7f8739db5/device/generic_sensor/sensor_provider_impl.h

Project Member Comment 35 by bugdroid1@chromium.org, Oct 21
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/75daa868751b28b3bad9dcc033198c201129ae7d

commit 75daa868751b28b3bad9dcc033198c201129ae7d
Author: alexis.menard <alexis.menard@intel.com>
Date: Fri Oct 21 16:10:32 2016

[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

Review-Url: https://chromiumcodereview.appspot.com/2417643006
Cr-Commit-Position: refs/heads/master@{#426806}

[modify] https://crrev.com/75daa868751b28b3bad9dcc033198c201129ae7d/device/generic_sensor/platform_sensor_ambient_light_mac.cc
[modify] https://crrev.com/75daa868751b28b3bad9dcc033198c201129ae7d/device/generic_sensor/platform_sensor_ambient_light_mac.h

Cc: pkasting@chromium.org
I don't know how recent this is, but I'm getting link warning spew locally on Windows that looks like a problem with symbol export visibility:

Sensor.obj : warning LNK4217: locally defined symbol ??0SensorReading@device@@QEAA@XZ (public: __cdecl device::SensorReading::SensorReading(void)) imported in function "protected: __cdecl blink::Sensor::Sensor(class blink::ScriptState *,class blink::SensorOptions const &,class blink::ExceptionState &,enum device::mojom::SensorType)" (??0Sensor@blink@@IEAA@PEAVScriptState@1@AEBVSensorOptions@1@AEAVExceptionState@1@W4SensorType@mojom@device@@@Z)
SensorProxy.obj : warning LNK4049: locally defined symbol ??0SensorReading@device@@QEAA@XZ (public: __cdecl device::SensorReading::SensorReading(void)) imported

Sensor.obj : warning LNK4217: locally defined symbol ??1SensorReading@device@@QEAA@XZ (public: __cdecl device::SensorReading::~SensorReading(void)) imported in function "public: virtual __cdecl blink::Sensor::~Sensor(void)" (??1Sensor@blink@@UEAA@XZ)
SensorProxy.obj : warning LNK4049: locally defined symbol ??1SensorReading@device@@QEAA@XZ (public: __cdecl device::SensorReading::~SensorReading(void)) imported
SensorProxy.obj : warning LNK4217: locally defined symbol ??0SensorReading@device@@QEAA@AEBU01@@Z (public: __cdecl device::SensorReading::SensorReading(struct device::SensorReading const &)) imported in function "private: bool __cdecl blink::SensorProxy::tryReadFromBuffer(void)" (?tryReadFromBuffer@SensorProxy@blink@@AEAA_NXZ)

Let me know if you want me to file a new bug that blocks this one.
pkasting@chromium.org, thanks for notifying, I'm fixing it in following CL https://codereview.chromium.org/2451783002
Project Member Comment 39 by bugdroid1@chromium.org, Oct 26
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aca064c217fc134807c9f6bb28573226e07a885f

commit aca064c217fc134807c9f6bb28573226e07a885f
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Wed Oct 26 06:36:11 2016

[sensors] Fix component build warnings for windows platform

This CL changes device/generic_sensor/public/cpp/ from source_set
type to component.

BUG=606766

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

[modify] https://crrev.com/aca064c217fc134807c9f6bb28573226e07a885f/device/generic_sensor/BUILD.gn
[modify] https://crrev.com/aca064c217fc134807c9f6bb28573226e07a885f/device/generic_sensor/public/cpp/BUILD.gn
[modify] https://crrev.com/aca064c217fc134807c9f6bb28573226e07a885f/device/generic_sensor/public/cpp/sensor_reading.h
[modify] https://crrev.com/aca064c217fc134807c9f6bb28573226e07a885f/third_party/WebKit/Source/modules/sensor/BUILD.gn

Cc: alexis.m...@intel.com mikhail....@intel.com
Project Member Comment 41 by bugdroid1@chromium.org, Oct 27
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17dc30da8eac6754b74cadf5a530cad8c14c22f8

commit 17dc30da8eac6754b74cadf5a530cad8c14c22f8
Author: alexis.menard <alexis.menard@intel.com>
Date: Thu Oct 27 14:47:21 2016

[sensors] Add a browser test to sanity check ambient light sensor.

The idea of the test is to sanity check the entire generic sensor
integration especially to verify that the data put in the shared
buffer is correctly handled by Blink.

The patch add a way to provide a fake provider which will create
fake sensors so we have a reliable and hardware independent solution.

The rest of the testing is happening either as layout tests or
as unittests in device/generic_sensor.

BUG=606766

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

[add] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/content/browser/generic_sensor_browsertest.cc
[modify] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/content/test/BUILD.gn
[add] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/content/test/data/generic_sensor/ambient_light_sensor_test.html
[modify] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/device/generic_sensor/BUILD.gn
[add] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/device/generic_sensor/platform_sensor_provider.cc
[modify] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/device/generic_sensor/platform_sensor_provider.h
[modify] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/device/generic_sensor/platform_sensor_provider_android.cc
[add] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/device/generic_sensor/platform_sensor_provider_android.h
[delete] https://crrev.com/de18de17de1d3867f99394275792ef81b15bbf46/device/generic_sensor/platform_sensor_provider_default.cc
[modify] https://crrev.com/17dc30da8eac6754b74cadf5a530cad8c14c22f8/device/generic_sensor/platform_sensor_provider_mac.cc

Project Member Comment 42 by bugdroid1@chromium.org, Oct 27
Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6

commit 85cc22d79580bc5ad58db03ff3e4fb8f9db539a6
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Wed Oct 05 11:13:30 2016

[sensors] Introduce asynchronous way to create sensors.

As long as sensors implementation on Linux/ChromeOS will
be based on reading from files (sensors' files are located
in /sys/dev/iio/devices), asynchronous way of creating
sensors is introduced with this patch.

To be more specific, the asynchronous path is needed because
sensors' existence will be checked by blocking IO methods in
case of Linux/ChromeOS and in order to be able to say
whether a sensor exists or not, asynchronous path will be
used.

In case of Android and Mac, callbacks will be
called immediately as soon as a sensor manager in Android or
IOServiceGetMatchingService in Mac returns a sensor object
or nullptr.

How it works:
As soon as a request for a new sensor is received, callbacks
are stored into a vector which is pushed into a map with a
type key and the vector itself. If no callback has been
stored before, CreateSensorInternal() method is called.
Then:
 *Linux/ChromeOS (under development): a new thread is
  created which will handle concrete sensors creation.
 *Android: when CreateSensorInternal() is called, java code
  is called and everything is handled by the sensor manager,
  which returns synchronously. Once sensor found, it is
  returned. Otherwise, nullptr is returned.
 *Mac (under development)
  https://codereview.chromium.org/2332903002/: everything
  is handled by IOServiceGetMatchingService, which returns
  synchronously.

BUG=606766

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

[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/fake_platform_sensor_provider.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/fake_platform_sensor_provider.h
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_android.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_base.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_base.h
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/platform_sensor_provider_unittest.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/85cc22d79580bc5ad58db03ff3e4fb8f9db539a6/device/generic_sensor/sensor_provider_impl.h

Project Member Comment 43 by bugdroid1@chromium.org, Oct 27
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3

commit e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Oct 05 17:12:30 2016

[Sensors] 'onerror' event implementation

This CL introduces sensor 'onerror' event and layout tests.

BUG=606766

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

[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.cpp
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.h
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorErrorEventInit.idl
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/e78cbef6bacd2a34b4fd258fd874e8b0a2db6dc3/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 44 by bugdroid1@chromium.org, Oct 27
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24e8468bd738a1df17fe4f20ea251b3d87c4978a

commit 24e8468bd738a1df17fe4f20ea251b3d87c4978a
Author: alexis.menard <alexis.menard@intel.com>
Date: Wed Oct 05 19:48:53 2016

[sensors] Fix crash after 85cc22d when using async creation of sensors.

The fix is simple as the callback was called with null pointers. Make
sure to call it with the right arguments.

BUG=606766

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

[modify] https://crrev.com/24e8468bd738a1df17fe4f20ea251b3d87c4978a/device/generic_sensor/sensor_provider_impl.cc

Project Member Comment 45 by bugdroid1@chromium.org, Nov 3
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea

commit d08cd09c1949eccd6bb6d93ef4ed7e91be272eea
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Thu Nov 03 07:46:30 2016

[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

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

[modify] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/chrome/browser/about_flags.cc
[modify] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/BUILD.gn
[modify] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/BUILD.gn
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
[modify] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_provider.cc
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_provider_win.cc
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_provider_win.h
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_reader_win.cc
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_reader_win.h
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_win.cc
[add] https://crrev.com/d08cd09c1949eccd6bb6d93ef4ed7e91be272eea/device/generic_sensor/platform_sensor_win.h

Project Member Comment 46 by bugdroid1@chromium.org, Nov 3
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0948b6c3cec6e8764fef47ed299d5a77414a987

commit f0948b6c3cec6e8764fef47ed299d5a77414a987
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Thu Nov 03 13:50:34 2016

[sensors] Close mock sensor stubs after test is finished

Before this CL, mock sensor instance was reused by all tests. This CL adds
code that closes mocked sensor stubs after each test, so that on the Blink
side, SensorProxy will reset and release resources associated with the sensor.
This allows to write layout tests that simulate different behavior for the
sensor of the same type.

BUG=606766

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

[modify] https://crrev.com/f0948b6c3cec6e8764fef47ed299d5a77414a987/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/f0948b6c3cec6e8764fef47ed299d5a77414a987/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/f0948b6c3cec6e8764fef47ed299d5a77414a987/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/f0948b6c3cec6e8764fef47ed299d5a77414a987/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 47 by bugdroid1@chromium.org, Nov 3
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de2d07084492be68633a47bae161cf9014ac88e2

commit de2d07084492be68633a47bae161cf9014ac88e2
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Thu Nov 03 14:56:42 2016

[sensors] Ambient light sensor implementation for ChromeOS and Linux.

The patch introduces sensors implementation for
ChromeOS/Linux platforms using ambient light sensor. Both
platforms share the same code and require polling threads to
be used.

SensorDataIio structure is used to initialize a generic
SensorReader, which is created only when sensor read files
are found, and to create a concrete sensor, which takes
an ownership of the SensorReader.

A SensorReader must always be created on a polling thread,
which is further used by a sensor to poll data. Each new
sensor will have its own thread in order to avoid blocking of
each other.

As a temp solution to manage polling threads, which are not
passed to new sensors, a manager thread is used. It kills a
polling thread if a sensor cannot be created. In the future,
the manager thread will evolve to a manager class that will
manage finding new sensors attached to a system and notify a
provider about that. The provider will have its own cache in
order to avoid trying to find sensors each time after it
fails to find a requested sensor. Once the manager notifies
the provider about a new sensor, the provider updates its
cache and starts to process requests for that type of sensor.

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ

BUG=606766
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

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

[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/chrome/browser/about_flags.cc
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/BUILD.gn
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/BUILD.gn
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/linux/platform_sensor_utils_linux.cc
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/linux/platform_sensor_utils_linux.h
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/linux/sensor_data_linux.cc
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/linux/sensor_data_linux.h
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/linux/sensor_reader_unittest.cc
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/platform_sensor_linux.cc
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/platform_sensor_linux.h
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/platform_sensor_provider.cc
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/platform_sensor_provider_base.h
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/platform_sensor_provider_linux.cc
[add] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/platform_sensor_provider_linux.h
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2/device/generic_sensor/sensor_provider_impl.h

Project Member Comment 48 by bugdroid1@chromium.org, Nov 3
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae21a578c51e7d8a6a228dbd27594dea0416cf8b

commit ae21a578c51e7d8a6a228dbd27594dea0416cf8b
Author: mathp <mathp@chromium.org>
Date: Thu Nov 03 16:02:54 2016

Revert of [sensors] Ambient light sensor implementation for ChromeOS and Linux. (patchset #26 id:1050001 of https://codereview.chromium.org/2370343002/ )

Reason for revert:
Causing a failure on Linux bot:

https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/28030

Original issue's description:
> [sensors] Ambient light sensor implementation for ChromeOS and Linux.
>
> The patch introduces sensors implementation for
> ChromeOS/Linux platforms using ambient light sensor. Both
> platforms share the same code and require polling threads to
> be used.
>
> SensorDataIio structure is used to initialize a generic
> SensorReader, which is created only when sensor read files
> are found, and to create a concrete sensor, which takes
> an ownership of the SensorReader.
>
> A SensorReader must always be created on a polling thread,
> which is further used by a sensor to poll data. Each new
> sensor will have its own thread in order to avoid blocking of
> each other.
>
> As a temp solution to manage polling threads, which are not
> passed to new sensors, a manager thread is used. It kills a
> polling thread if a sensor cannot be created. In the future,
> the manager thread will evolve to a manager class that will
> manage finding new sensors attached to a system and notify a
> provider about that. The provider will have its own cache in
> order to avoid trying to find sensors each time after it
> fails to find a requested sensor. Once the manager notifies
> the provider about a new sensor, the provider updates its
> cache and starts to process requests for that type of sensor.
>
> Intent to Implement:
> https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ
>
> BUG=606766
> CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
>
> Committed: https://crrev.com/de2d07084492be68633a47bae161cf9014ac88e2
> Cr-Commit-Position: refs/heads/master@{#429584}

TBR=reillyg@chromium.org,alexander.shalamov@intel.com,alexis.menard@intel.com,alexmos@chromium.org,mikhail.pozdnyakov@intel.com,rockot@chromium.org,timvolodine@chromium.org,maksim.sisov@intel.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=606766

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

[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/chrome/browser/about_flags.cc
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/device/BUILD.gn
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/device/generic_sensor/BUILD.gn
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/linux/platform_sensor_utils_linux.cc
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/linux/platform_sensor_utils_linux.h
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/linux/sensor_data_linux.cc
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/linux/sensor_data_linux.h
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/linux/sensor_reader_unittest.cc
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/platform_sensor_linux.cc
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/platform_sensor_linux.h
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/device/generic_sensor/platform_sensor_provider.cc
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/device/generic_sensor/platform_sensor_provider_base.h
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/platform_sensor_provider_linux.cc
[delete] https://crrev.com/74836cf56afe5eca812e274200c210dd24d067c1/device/generic_sensor/platform_sensor_provider_linux.h
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/ae21a578c51e7d8a6a228dbd27594dea0416cf8b/device/generic_sensor/sensor_provider_impl.h

Labels: -merge-merged-2840
[Automated comment] removing mislabelled merge-merged-2840
Project Member Comment 50 by bugdroid1@chromium.org, Nov 4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c0876ac8f8439dc4511f4172bc4856d2358e9f67

commit c0876ac8f8439dc4511f4172bc4856d2358e9f67
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Fri Nov 04 22:54:12 2016

Reland of [sensors] Ambient light sensor implementation for ChromeOS and Linux.

The patch introduces sensors implementation for
ChromeOS/Linux platforms using ambient light sensor. Both
platforms share the same code and require polling threads to
be used.

SensorDataIio structure is used to initialize a generic
SensorReader, which is created only when sensor read files
are found, and to create a concrete sensor, which takes
an ownership of the SensorReader.

A SensorReader must always be created on a polling thread,
which is further used by a sensor to poll data. Each new
sensor will have its own thread in order to avoid blocking of
each other.

As a temp solution to manage polling threads, which are not
passed to new sensors, a manager thread is used. It kills a
polling thread if a sensor cannot be created. In the future,
the manager thread will evolve to a manager class that will
manage finding new sensors attached to a system and notify a
provider about that. The provider will have its own cache in
order to avoid trying to find sensors each time after it
fails to find a requested sensor. Once the manager notifies
the provider about a new sensor, the provider updates its
cache and starts to process requests for that type of sensor.

Intent to Implement:
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TkfdVqYAYiE/xLGN2b1-AAAJ

The first patchset is a last reverted patch. The second one provides
a fix to reland the code.
reverted cl:
https://codereview.chromium.org/2370343002/

BUG=606766
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

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

[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/chrome/browser/about_flags.cc
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/BUILD.gn
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/BUILD.gn
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/linux/platform_sensor_utils_linux.cc
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/linux/platform_sensor_utils_linux.h
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/linux/sensor_data_linux.cc
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/linux/sensor_data_linux.h
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/linux/sensor_reader_unittest.cc
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/platform_sensor_linux.cc
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/platform_sensor_linux.h
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/platform_sensor_provider.cc
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/platform_sensor_provider_base.h
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/platform_sensor_provider_linux.cc
[add] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/platform_sensor_provider_linux.h
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/c0876ac8f8439dc4511f4172bc4856d2358e9f67/device/generic_sensor/sensor_provider_impl.h

Project Member Comment 51 by bugdroid1@chromium.org, Nov 8
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/62a49b3515112ea2ca6bbab6196f68717c52f94b

commit 62a49b3515112ea2ca6bbab6196f68717c52f94b
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Tue Nov 08 11:31:18 2016

[Sensors] Align sensor reading attribute implementation with the specification

This patch updates sensor reading implementation accordingly to specification [1] which says: "the reading attribute of two instances of the same Sensor interface associated with the same sensor hold the same SensorReading during a single event loop turn".

Besides, this patch also drops 'SensorReadingEvent' and 'SensorReadingEventInit' types which no longer exist in the specification.

[1] https://w3c.github.io/sensors/#sensor-reading

BUG=606766

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

[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/content/test/data/generic_sensor/ambient_light_sensor_test.html
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/bindings/modules/BUILD.gn
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[modify] https://crrev.com/62a49b3515112ea2ca6bbab6196f68717c52f94b/third_party/WebKit/Source/modules/sensor/SensorReading.h
[delete] https://crrev.com/3f0ee880ebc26f7ed7819c2d6e412d8645fd66ed/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
[delete] https://crrev.com/3f0ee880ebc26f7ed7819c2d6e412d8645fd66ed/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h
[delete] https://crrev.com/3f0ee880ebc26f7ed7819c2d6e412d8645fd66ed/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.idl
[delete] https://crrev.com/3f0ee880ebc26f7ed7819c2d6e412d8645fd66ed/third_party/WebKit/Source/modules/sensor/SensorReadingEventInit.idl

Project Member Comment 52 by bugdroid1@chromium.org, Nov 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6420f2fefc6438000fe55814cc3d18fe38096915

commit 6420f2fefc6438000fe55814cc3d18fe38096915
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Wed Nov 09 12:42:49 2016

[sensors] Reject test promise when callback throws an error

This CL improves test reports for ambient light sensor by wrapping
Sensor.on* callbacks that might throw an error. When error is thrown,
promise for async test is rejected and executed test would be marked
as 'FAIL'. Before this change, failing tests could timeout and block
consecutive test execution.

BUG=606766

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

[modify] https://crrev.com/6420f2fefc6438000fe55814cc3d18fe38096915/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/6420f2fefc6438000fe55814cc3d18fe38096915/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js

Labels: -M-54
Project Member Comment 54 by bugdroid1@chromium.org, Nov 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8fd4ba018ddfebcfc47966eea9ea3a75ed0b5fa0

commit 8fd4ba018ddfebcfc47966eea9ea3a75ed0b5fa0
Author: alexis.menard <alexis.menard@intel.com>
Date: Wed Nov 09 22:03:15 2016

[sensors] [mac] Fix ambient light sensor not updating its value when closing the lid with a monitor connected.

Right now we use IOServiceAddInterestNotification with kIOGeneralInterest
as a way to get value changes from the AppleLMUController whenever
the ambient light condition changes.

However when closing the lid rapidly and a monitor is connected (which
prevents the computer to go to sleep) we don't receive a notification
and callback from the controller the whole way (until the lid is fully
closed). It means that the latest value received in JavaScript is not what
would be expected : as a developer point of view, lid closed = dark = 0.0
as a lux value.

The patch now listen kIOBusyInterest as well because when closing
the lid the AppleLMUController sends busy events which we can use
to fetch the value of the sensor and report it back in JavaScript.

BUG=606766

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

[modify] https://crrev.com/8fd4ba018ddfebcfc47966eea9ea3a75ed0b5fa0/device/generic_sensor/platform_sensor_ambient_light_mac.cc
[modify] https://crrev.com/8fd4ba018ddfebcfc47966eea9ea3a75ed0b5fa0/device/generic_sensor/platform_sensor_ambient_light_mac.h

Cc: reil...@chromium.org
Project Member Comment 56 by bugdroid1@chromium.org, Nov 10
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1b9c618e9490fb05ad15612291ef6df37df6fe1

commit c1b9c618e9490fb05ad15612291ef6df37df6fe1
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Nov 10 15:09:01 2016

[Sensors] Add an UMA histogram for Generic Sensor function calls

All Sensor functions have a histogram value that is recorded when the function is called.

Specification: https://w3c.github.io/sensors/
BUG=606766

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

[modify] https://crrev.com/c1b9c618e9490fb05ad15612291ef6df37df6fe1/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/c1b9c618e9490fb05ad15612291ef6df37df6fe1/third_party/WebKit/Source/modules/sensor/Sensor.idl
[modify] https://crrev.com/c1b9c618e9490fb05ad15612291ef6df37df6fe1/tools/metrics/histograms/histograms.xml

Project Member Comment 57 by bugdroid1@chromium.org, Nov 11
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9d5b8269d088402d1d9c261d1c12585d81a4ac78

commit 9d5b8269d088402d1d9c261d1c12585d81a4ac78
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Nov 11 07:59:56 2016

[Sensors] Consider maximum supported frequency

This patch improves capping of the given sensor frequency hint, now it considers the actual sensor capabilities obtained from the platform (if available).
So now the behavior has changed in the following way:
frequency = min(given frequency, 60 Hz) -> frequency = min(given frequency, min(maximum supported frequency, 60 Hz))

BUG=606766

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

[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensor.java
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor.cc
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor.h
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor_android.cc
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor_android.h
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor_win.cc
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/platform_sensor_win.h
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/public/interfaces/sensor_provider.mojom
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/9d5b8269d088402d1d9c261d1c12585d81a4ac78/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Project Member Comment 59 by bugdroid1@chromium.org, Nov 14
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6305cf853f1e9e6fb1cd9afbf3f9483204e33be

commit d6305cf853f1e9e6fb1cd9afbf3f9483204e33be
Author: alexis.menard <alexis.menard@intel.com>
Date: Mon Nov 14 23:20:38 2016

[sensors] Improve the generic sensors current layout tests.

Move all the tests that are going to be common in a single file.
Each of the sensor type will call a function to get the generic
tests to run. Specific sensor test can still be added in their
respective html files.

BUG=606766

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

[modify] https://crrev.com/d6305cf853f1e9e6fb1cd9afbf3f9483204e33be/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[add] https://crrev.com/d6305cf853f1e9e6fb1cd9afbf3f9483204e33be/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js

Project Member Comment 60 by bugdroid1@chromium.org, Nov 23
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ef84cca9ddf9928a08967084030632d21b7fbff

commit 7ef84cca9ddf9928a08967084030632d21b7fbff
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Nov 23 08:22:35 2016

[Sensors] Improvements in fetching reading for sensors with continuous reporting mode

If a platform sensors has continuous reporting mode its updates are not send via IPC, so there is a timer on Blink side which periodically reads the sensor data from shared buffer.

Before this change every sensor instance had its own repeating timer, however in case of multiple sensor instances it could bloat the thread task queue with unneeded requests to read the sensor data from shared buffer.

This patch introduces only one repeating timer per 'SensorProxy' (i.e. per frame) which is shared between all sensor instances of the same type.

Another consequent change is that now the 'SensorProxy' class is inherited from 'PageVisibilityObserver' (and the 'Sensor' class is not any more) which makes suspend/resume code path more efficient.

BUG=606766

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

[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/Sensor.h
[delete] https://crrev.com/a3e6a48f576f8130788f731c8d8e6c7525118edf/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.cpp
[delete] https://crrev.com/a3e6a48f576f8130788f731c8d8e6c7525118edf/third_party/WebKit/Source/modules/sensor/SensorPollingStrategy.h
[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[add] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
[add] https://crrev.com/7ef84cca9ddf9928a08967084030632d21b7fbff/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Cc: wanming....@intel.com
Cc: maksim.s...@intel.com
Project Member Comment 63 by bugdroid1@chromium.org, Nov 30
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8825a7140545d858daa36defc294668a79ecf1bf

commit 8825a7140545d858daa36defc294668a79ecf1bf
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Wed Nov 30 09:01:34 2016

[sensors] Fix flakiness in generic sensors tests

This patch fixes flakiness for generic sensors layout tests by resetting
SensorProvider mock stub bindings at the end of the each layout test and
re-initializing it when needed in SensorProviderProxy.

Before this CL, if multiple sensor tests were executed by the same
content shell instance, Frame's mojo interface overrides were reset after
each test, yet SensorProviderProxy was not aware of it and kept using old
SensorProvider mojom proxy.

BUG=606766

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

[modify] https://crrev.com/8825a7140545d858daa36defc294668a79ecf1bf/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/8825a7140545d858daa36defc294668a79ecf1bf/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/8825a7140545d858daa36defc294668a79ecf1bf/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/8825a7140545d858daa36defc294668a79ecf1bf/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/8825a7140545d858daa36defc294668a79ecf1bf/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp

Project Member Comment 64 by bugdroid1@chromium.org, Nov 30
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/947057f3628e20376c783e30f9fcc03d86a8ee49

commit 947057f3628e20376c783e30f9fcc03d86a8ee49
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Nov 30 11:13:35 2016

[Sensors] Layouts test to check frequency hint

This patch introduces layout tests checking frequency hint for sensors having both 'onchange' and 'continuous' reporting.

BUG=606766

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

[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp
[modify] https://crrev.com/947057f3628e20376c783e30f9fcc03d86a8ee49/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp

Project Member Comment 65 by bugdroid1@chromium.org, Dec 1
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/26947f590d1526ea0cf3d485382da6dc1a068ec5

commit 26947f590d1526ea0cf3d485382da6dc1a068ec5
Author: alexis.menard <alexis.menard@intel.com>
Date: Thu Dec 01 01:14:58 2016

[sensors] [win] Fix ambient light not working properly on Windows 10.

The event listener was never called despite SetEventSink returning
success. Debbuging further it turns out that the event listener was
created in the sensor thread, however the listener was not set in
the sensor thread (from StartSensor()), this seems to confuse COM.

BUG=606766

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

[modify] https://crrev.com/26947f590d1526ea0cf3d485382da6dc1a068ec5/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
[modify] https://crrev.com/26947f590d1526ea0cf3d485382da6dc1a068ec5/device/generic_sensor/platform_sensor_reader_win.cc
[modify] https://crrev.com/26947f590d1526ea0cf3d485382da6dc1a068ec5/device/generic_sensor/platform_sensor_reader_win.h

Project Member Comment 66 by bugdroid1@chromium.org, Dec 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/061d113db7069c23fe84a0a9365965647ed97b51

commit 061d113db7069c23fe84a0a9365965647ed97b51
Author: maksim.sisov <maksim.sisov@intel.com>
Date: Fri Dec 09 16:04:21 2016

[sensors](CrOS/Linux) Implement Sensor device manager for sensors

This cl introduces a SensorDeviceManager for Linux and ChromeOS platforms.

Manager:
1) PlatformSensorProviderLinux owns a SensorDeviceManager that uses
DeviceMonitorLinux to enumerate iio devices and get removed/add udev
events. Once device is enumerated, added or removed, it is identified
and all the necessary information is put to SensorInfoLinux structure
and passed to the provider. If there is no such a device, it is added
to cache. In case of removal, manager checks if there was such a device
and updates it's cache accordingly + notifies the provider about a
removed device, which update own cache.
2) Requests: when a request for a sensor comes, it can be processed
immediately or asynchronously once service is up and running.

Reader:
1) There will be two strategies for a reader. At the moment
only polling read is supported.
2) The reader doesn't search for sensor files any more, those are passed
to it in SensorInfoLinux structure.

Unittests:
1) In order to make it possible to test the whole path, I've made
SensorDeviceManager's methods virtual, which allowed me to
mock and override them.
2) Unittests implement own udev methods that just read values from
files. If read is successful, the manager adds this type of sensor
associated with the files that have been read to it's cache and notifies
the provider.

BUG=606766

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

[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/BUILD.gn
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/BUILD.gn
[add] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/linux/platform_sensor_manager.cc
[add] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/linux/platform_sensor_manager.h
[delete] https://crrev.com/b0246be63c67f341421ee64196857479e7e2b9ef/device/generic_sensor/linux/platform_sensor_utils_linux.cc
[delete] https://crrev.com/b0246be63c67f341421ee64196857479e7e2b9ef/device/generic_sensor/linux/platform_sensor_utils_linux.h
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/linux/sensor_data_linux.cc
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/linux/sensor_data_linux.h
[delete] https://crrev.com/b0246be63c67f341421ee64196857479e7e2b9ef/device/generic_sensor/linux/sensor_reader_unittest.cc
[add] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_linux.cc
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_linux.h
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_provider.cc
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_provider_base.cc
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_provider_base.h
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_provider_linux.cc
[modify] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_provider_linux.h
[add] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_reader_linux.cc
[add] https://crrev.com/061d113db7069c23fe84a0a9365965647ed97b51/device/generic_sensor/platform_sensor_reader_linux.h

Project Member Comment 68 by bugdroid1@chromium.org, Dec 19
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb

commit 6b071fe7dc3bd64a2914eadd5c67b483d064a6cb
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Mon Dec 19 13:59:39 2016

[Sensors] Align sensor reading updates and 'onchange' notification with rAF.

For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption.

Before this change a timers were used and this could unnecessarily drain CPU and battery.

BUG= 668052 
BUG=606766

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

[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[add] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp
[add] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h
[delete] https://crrev.com/d9217bcdb39187bec28543abcc5ec82761c1e64c/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
[delete] https://crrev.com/d9217bcdb39187bec28543abcc5ec82761c1e64c/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Project Member Comment 69 by bugdroid1@chromium.org, Dec 19
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fbf954d48f20330a013b68c5f0eb32094ce29263

commit fbf954d48f20330a013b68c5f0eb32094ce29263
Author: wjmaclean <wjmaclean@chromium.org>
Date: Mon Dec 19 16:26:30 2016

Revert of [Sensors] Align sensor reading updates and 'onchange' notification with rAF. (patchset #6 id:140001 of https://codereview.chromium.org/2551223003/ )

Reason for revert:
Seems like a likely cause for failures on:

https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=sensor%2Faccelerometer.html&testType=webkit_tests

Original issue's description:
> [Sensors] Align sensor reading updates and 'onchange' notification with rAF.
>
> For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption.
>
> Before this change a timers were used and this could unnecessarily drain CPU and battery.
>
> BUG= 668052 
> BUG=606766
>
> Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb
> Cr-Commit-Position: refs/heads/master@{#439467}

TBR=reillyg@chromium.org,alexander.shalamov@intel.com,haraken@chromium.org,foolip@chromium.org,mikhail.pozdnyakov@intel.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 668052 

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

[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[delete] https://crrev.com/dc9f82823179751d15790d2347e1f0e83aaf4b13/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp
[delete] https://crrev.com/dc9f82823179751d15790d2347e1f0e83aaf4b13/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h
[add] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
[add] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Project Member Comment 70 by bugdroid1@chromium.org, Dec 21
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835

commit 5f2cde61f6ff4a764b9b1c7d74a24ef6de815835
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Dec 21 20:58:31 2016

[Sensors] Reland: Align sensor reading updates and 'onchange' notification with rAF.

For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption.

Before this change a timers were used and this could unnecessarily drain CPU and battery.

BUG= 668052 
BUG=606766

Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb
Cr-Commit-Position: refs/heads/master@{#439467}

patch from issue 2551223003 at patchset 140001 (http://crrev.com/2551223003#ps140001)

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

[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[add] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp
[add] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h
[delete] https://crrev.com/f9801783df3fe00bf8e78e26bc4ed898f9df2281/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
[delete] https://crrev.com/f9801783df3fe00bf8e78e26bc4ed898f9df2281/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Project Member Comment 71 by bugdroid1@chromium.org, Dec 21
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e2f7eddb1030e053847378b4202416c807fa298e

commit e2f7eddb1030e053847378b4202416c807fa298e
Author: hcarmona <hcarmona@chromium.org>
Date: Wed Dec 21 23:09:05 2016

Revert of [Sensors] Reland: Align sensor reading updates and 'onchange' notification with rAF. (patchset #4 id:60001 of https://codereview.chromium.org/2589283003/ )

Reason for revert:
This looks like a likely cause of these failures: https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linux%20Trusty%20Leak/builds/945

Original issue's description:
> [Sensors] Reland: Align sensor reading updates and 'onchange' notification with rAF.
>
> For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption.
>
> Before this change a timers were used and this could unnecessarily drain CPU and battery.
>
> BUG= 668052 
> BUG=606766
>
> Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb
> Cr-Commit-Position: refs/heads/master@{#439467}
>
> patch from issue 2551223003 at patchset 140001 (http://crrev.com/2551223003#ps140001)
>
> Committed: https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835
> Cr-Commit-Position: refs/heads/master@{#440208}

TBR=alexander.shalamov@intel.com,haraken@chromium.org,reillyg@chromium.org,mikhail.pozdnyakov@intel.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 668052 

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

[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[delete] https://crrev.com/ffc683508cd14f45a6fe8463224795a5c48c3c18/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp
[delete] https://crrev.com/ffc683508cd14f45a6fe8463224795a5c48c3c18/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h
[add] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
[add] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Project Member Comment 72 by bugdroid1@chromium.org, Dec 23
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257

commit a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Dec 23 18:58:20 2016

[Sensors] Reland: Reland: Align sensor reading updates and 'onchange' notification with rAF.

For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption.

Before this change a timers were used and this could unnecessarily drain CPU and battery.

BUG= 668052 
BUG=606766

Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb
Cr-Commit-Position: refs/heads/master@{#439467}

patch from issue 2551223003 at patchset 140001 (http://crrev.com/2551223003#ps140001)

Committed: https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835
Cr-Commit-Position: refs/heads/master@{#440208}

patch from issue 2589283003 at patchset 60001 (http://crrev.com/2589283003#ps60001)

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

[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[add] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp
[add] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h
[delete] https://crrev.com/caa1245b3c7c6e75f3e79139bf6d90eb2227d953/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
[delete] https://crrev.com/caa1245b3c7c6e75f3e79139bf6d90eb2227d953/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Blockedon: 680043
Project Member Comment 74 by bugdroid1@chromium.org, Jan 27
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c78e848fc18f203167cb53aedc0e3736bce149b1

commit c78e848fc18f203167cb53aedc0e3736bce149b1
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Jan 27 13:31:00 2017

[Sensors] Fix reading updates after page refresh

This patch fixes reading updates after page refresh. The route cause of the problem was that the outdated document instance was cached in SensorProxy.

BUG= 679243 
BUG=606766

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

[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp
[modify] https://crrev.com/c78e848fc18f203167cb53aedc0e3736bce149b1/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h

Project Member Comment 75 by bugdroid1@chromium.org, Feb 2
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/38085832fa9b018027dd0aa2068afef12e37777b

commit 38085832fa9b018027dd0aa2068afef12e37777b
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Feb 02 12:53:47 2017

[Sensors] Remove SensorReading interfaces

The SensorReading interface has been recently excluded from W3C Generic Sensor specification [1].
Now concrete sensor interfaces should themselves contain reading attributes.

Sensor layout and browser tests are updated accordingly.

BUG=606766

[1] https://w3c.github.io/sensors/

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

[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/content/test/data/generic_sensor/ambient_light_sensor_test.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/device/generic_sensor/public/cpp/sensor_reading.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Accelerometer.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AccelerometerReading.cpp
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AccelerometerReading.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AccelerometerReadingInit.idl
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Gyroscope.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Gyroscope.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/GyroscopeReading.cpp
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/GyroscopeReading.h
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/GyroscopeReading.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/GyroscopeReadingInit.idl
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Magnetometer.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Magnetometer.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/MagnetometerReading.h
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/MagnetometerReading.idl
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/MagnetometerReadingInit.idl
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/Sensor.idl
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/38085832fa9b018027dd0aa2068afef12e37777b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/SensorReading.cpp
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/SensorReading.h
[delete] https://crrev.com/90940ee0917f92316ed9a18cf6bb452668f7046f/third_party/WebKit/Source/modules/sensor/SensorReading.idl

Project Member Comment 76 by bugdroid1@chromium.org, Feb 2
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f5e04ad29b1ef9e8bf180191ef57120163faa0a1

commit f5e04ad29b1ef9e8bf180191ef57120163faa0a1
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Feb 02 18:36:42 2017

[Sensors] Stop throwing InvalidStateError exceptions

The updated Generic Sensor specification [1] does not contain instructions for throwing 'InvalidStateError' exceptions from start() and stop() methods.
This allows for example to call stop() method on already stopped sensor object (such call will be simply ignored).

BUG=606766

[1] https://w3c.github.io/sensors/

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

[modify] https://crrev.com/f5e04ad29b1ef9e8bf180191ef57120163faa0a1/third_party/WebKit/Source/modules/sensor/Sensor.cpp

Project Member Comment 78 by bugdroid1@chromium.org, Feb 7
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/255943ab0b52ece4966d4cc651ff0ace0aa800ed

commit 255943ab0b52ece4966d4cc651ff0ace0aa800ed
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Tue Feb 07 13:28:06 2017

[Sensors] Return 'NotReadableError' exception if failed to find a sensor

As described at https://w3c.github.io/sensors/#connect-to-sensor

BUG=606766

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

[modify] https://crrev.com/255943ab0b52ece4966d4cc651ff0ace0aa800ed/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/255943ab0b52ece4966d4cc651ff0ace0aa800ed/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp

Project Member Comment 79 by bugdroid1@chromium.org, Feb 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6848d8dc4042a49a4c614061a3fe466a29fa27c4

commit 6848d8dc4042a49a4c614061a3fe466a29fa27c4
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Feb 09 09:35:22 2017

[Sensors] start() and stop() methods do not throw

Instead, these methods should use "Handle Errors" operation (https://w3c.github.io/sensors/#handle-errors) for error handling consistency.

BUG=606766

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

[modify] https://crrev.com/6848d8dc4042a49a4c614061a3fe466a29fa27c4/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/6848d8dc4042a49a4c614061a3fe466a29fa27c4/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/6848d8dc4042a49a4c614061a3fe466a29fa27c4/third_party/WebKit/Source/modules/sensor/Sensor.idl

Project Member Comment 80 by bugdroid1@chromium.org, Feb 24
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/883ba43fb0d728741ba56dbd8ec355b942abe1fe

commit 883ba43fb0d728741ba56dbd8ec355b942abe1fe
Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Feb 24 15:25:41 2017

[Sensors] Clamp given sampling frequency to the minimum supported  one

The given frequency must be clamped to the minimum supported by the platform, as follows from https://github.com/w3c/sensors/issues/169

This CL only introduces generic code which provides the minimum supported frequency from platform layer to the Sensor JS bindings (layout tests are updated accordingly), platform-specific implementations are to be added in following patches.

BUG=606766

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

[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/device/generic_sensor/platform_sensor.cc
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/device/generic_sensor/platform_sensor.h
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/device/generic_sensor/public/interfaces/sensor_provider.mojom
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/883ba43fb0d728741ba56dbd8ec355b942abe1fe/third_party/WebKit/Source/modules/sensor/SensorProxy.h

Sign in to add a comment