tree: 33fc2df68ab5bf144289f44fd651f1fdb79a57be [path history] [tgz]
  1. absolute_orientation_sensor.cc
  2. absolute_orientation_sensor.h
  3. absolute_orientation_sensor.idl
  4. accelerometer.cc
  5. accelerometer.h
  6. accelerometer.idl
  7. ambient_light_sensor.cc
  8. ambient_light_sensor.h
  9. ambient_light_sensor.idl
  10. BUILD.gn
  11. DEPS
  12. DIR_METADATA
  13. gravity_sensor.cc
  14. gravity_sensor.h
  15. gravity_sensor.idl
  16. gyroscope.cc
  17. gyroscope.h
  18. gyroscope.idl
  19. linear_acceleration_sensor.cc
  20. linear_acceleration_sensor.h
  21. linear_acceleration_sensor.idl
  22. magnetometer.cc
  23. magnetometer.h
  24. magnetometer.idl
  25. orientation_sensor.cc
  26. orientation_sensor.h
  27. orientation_sensor.idl
  28. OWNERS
  29. README.md
  30. relative_orientation_sensor.cc
  31. relative_orientation_sensor.h
  32. relative_orientation_sensor.idl
  33. sensor.cc
  34. sensor.h
  35. sensor.idl
  36. sensor_error_event.cc
  37. sensor_error_event.h
  38. sensor_error_event.idl
  39. sensor_error_event_init.idl
  40. sensor_inspector_agent.cc
  41. sensor_inspector_agent.h
  42. sensor_options.idl
  43. sensor_provider_proxy.cc
  44. sensor_provider_proxy.h
  45. sensor_proxy.cc
  46. sensor_proxy.h
  47. sensor_proxy_impl.cc
  48. sensor_proxy_impl.h
  49. sensor_proxy_inspector_impl.cc
  50. sensor_proxy_inspector_impl.h
  51. sensor_reading_remapper.cc
  52. sensor_reading_remapper.h
  53. sensor_test_utils.cc
  54. sensor_test_utils.h
  55. spatial_sensor_options.idl
third_party/blink/renderer/modules/sensor/README.md

Generic Sensor API

This directory contains the Blink part (including the JavaScript APIs exposed to users) of the Generic Sensor API.

The following concrete sensor interfaces are currently implemented:

  1. Ambient Light Sensor
  2. Accelerometer, Gravity Sensor and Linear Acceleration Sensor
  3. Gyroscope
  4. Magnetometer
  5. Absolute Orientation Sensor and Relative Orientation Sensor

Some of the interfaces above depend on the SensorExtraClasses runtime flag.

The platform-specific parts of the implementation are located in services/device/generic_sensor.

Testing

Sensors web tests are part of the web-platform-tests project and are located in multiple directories under web_tests/external/wpt. For example , web_tests/external/wpt/accelerometer. The sensor-agnostic parts of the tests are located in web_tests/external/wpt/generic-sensor.

Browser tests are located in content/browser/generic_sensor.

Overall architecture

The current design of the Chromium implementation of the Generic Sensor API is described in services/device/generic_sensor.