-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sensors: Add virtual sensor commands to browser_protocol.pdl and CDP …
…implementation Design doc: https://docs.google.com/document/d/1JS2Wnyc9GiS_u1Ry3w4KsCyd51g8fm4RDEUcanZgzbM/edit?usp=sharing This adds a few types and 3 new commands to the Emulation domain: * getOverriddenSensorInformation(type: SensorType) -> { requestedSamplingFrequency: number } * setSensorOverrideEnabled(enabled: boolean, type: SensorType, optional metadata: SensorMetadata) * setSensorOverrideReadings(type: SensorType, reading: SensorReading) Together, they allow us to implement the create/get/update/remove virtual sensor WebDriver commands from the Automation section of the Generic Sensor spec (the ChromeDriver bits will come later). Most of the code has already been implemented elsewhere in content and services. The CDP bits involve exposing the virtual sensor operations from WebContentsSensorProviderProxy via an RAII object called ScopedVirtualSensorForDevTools: since the entry point to the virtual sensor operations is always CDP, this object is responsible for automatically creating and removing virtual sensors while WCSPP takes care of creating only one ScopedVirtualSensorForDevTools per sensor type. This way, each EmulationHandler instance has its own set of virtual sensors that are cleared when it is disabled, and other handlers that exist at the same time are unable to create, interact with or remove these virtual sensors. [The increase in binary size for Fuchsia cannot be avoided, it all comes mostly from the generated code for the new data in browser_protocol.pdl and the new code in content::protocol::EmulationHandler] Bug: 1278377 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: Ie891bea3f46ff90192ed860f8ffe5361c8485df7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4770864 Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com> Reviewed-by: Matt Reynolds <mattreynolds@chromium.org> Auto-Submit: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1211361}
- Loading branch information
Showing
26 changed files
with
1,132 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.