Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 12-Nov-2020 | - | ||||
BUILD.gn | H A D | 07-Nov-2020 | 5.4 KiB | 187 | 162 | |
OWNERS | H A D | 07-Nov-2020 | 168 | 5 | 4 | |
README(WakeLock).md | H A D | 07-Nov-2020 | 1.2 KiB | 25 | 20 | |
battery_monitor.mojom | H A D | 07-Nov-2020 | 617 | 16 | 12 | |
battery_status.mojom | H A D | 07-Nov-2020 | 335 | 13 | 10 | |
bluetooth_system.mojom | H A D | 07-Nov-2020 | 7.3 KiB | 202 | 176 | |
device_service.mojom | H A D | 07-Nov-2020 | 4.1 KiB | 106 | 79 | |
fingerprint.mojom | H A D | 07-Nov-2020 | 3.2 KiB | 93 | 73 | |
geolocation.mojom | H A D | 07-Nov-2020 | 1.2 KiB | 31 | 26 | |
geolocation_config.mojom | H A D | 07-Nov-2020 | 499 | 14 | 11 | |
geolocation_context.mojom | H A D | 07-Nov-2020 | 918 | 25 | 19 | |
geolocation_control.mojom | H A D | 07-Nov-2020 | 1.3 KiB | 25 | 22 | |
geoposition.mojom | H A D | 07-Nov-2020 | 2.3 KiB | 61 | 53 | |
hid.mojom | H A D | 07-Nov-2020 | 18 KiB | 418 | 365 | |
input_service.mojom | H A D | 07-Nov-2020 | 1.6 KiB | 60 | 49 | |
mtp_file_entry.mojom | H A D | 07-Nov-2020 | 949 | 34 | 30 | |
mtp_manager.mojom | H A D | 07-Nov-2020 | 2.7 KiB | 77 | 60 | |
mtp_storage_info.mojom | H A D | 07-Nov-2020 | 779 | 26 | 23 | |
nfc.mojom | H A D | 07-Nov-2020 | 5.4 KiB | 161 | 131 | |
nfc_provider.mojom | H A D | 07-Nov-2020 | 670 | 22 | 16 | |
power_monitor.mojom | H A D | 07-Nov-2020 | 676 | 23 | 17 | |
public_ip_address_geolocation_provider.mojom | H A D | 07-Nov-2020 | 742 | 19 | 15 | |
screen_orientation.mojom | H A D | 07-Nov-2020 | 923 | 24 | 19 | |
screen_orientation_lock_types.mojom | H A D | 07-Nov-2020 | 867 | 32 | 25 | |
sensor.mojom | H A D | 07-Nov-2020 | 3.7 KiB | 97 | 83 | |
sensor_provider.mojom | H A D | 07-Nov-2020 | 1.9 KiB | 60 | 46 | |
serial.mojom | H A D | 07-Nov-2020 | 4.3 KiB | 164 | 135 | |
time_zone_monitor.mojom | H A D | 07-Nov-2020 | 610 | 18 | 14 | |
usb_device.mojom | H A D | 07-Nov-2020 | 10.5 KiB | 324 | 279 | |
usb_enumeration_options.mojom | H A D | 07-Nov-2020 | 608 | 30 | 21 | |
usb_manager.mojom | H A D | 07-Nov-2020 | 2 KiB | 48 | 38 | |
usb_manager_client.mojom | H A D | 07-Nov-2020 | 483 | 16 | 11 | |
usb_manager_test.mojom | H A D | 07-Nov-2020 | 834 | 28 | 21 | |
vibration_manager.mojom | H A D | 07-Nov-2020 | 356 | 12 | 9 | |
wake_lock.mojom | H A D | 07-Nov-2020 | 2.9 KiB | 68 | 57 | |
wake_lock_context.mojom | H A D | 07-Nov-2020 | 522 | 17 | 13 | |
wake_lock_provider.mojom | H A D | 07-Nov-2020 | 1.8 KiB | 43 | 34 |
README(WakeLock).md
1WakeLock provides the ability to block the device / display from sleeping. 2 3On Android, the implementation is inherently coupled to the NativeView 4associated with the context of the requestor due to system APIs. To handle 5this coupling, the Wake Lock usage model on Android is as follows: 6 7(1) The embedder passes in a callback at Device Service construction that 8enables the Wake Lock implementation to map (embedder-specific) context IDs to 9NativeViews. 10(2) For a given embedder-specific context, a trusted client 11connects to the WakeLockProvider interface and gets a 12WakeLockContext instance that is associated with that context. 13(3) That trusted client then forwards requests to bind wake locks from 14untrusted clients that are made within that context, with the Wake Lock 15implementation using the callback from (1) as necessary to obtain the 16NativeView associated with that context. 17 18On other platforms, the usage model is similar but the callback is not 19necessary/employed. 20 21If the client does not have any context available (e.g., is not within the 22context of a WebContents), it can get a WakeLock that doesn't associate to any 23context (by GetWakeLockWithoutContext() in WakeLockProvider). However, note that 24the resulting Wake Lock will not have any effect on Android. 25