Chromium Code Reviews| Index: device/wake_lock/public/interfaces/README.mojom |
| diff --git a/device/wake_lock/public/interfaces/README.mojom b/device/wake_lock/public/interfaces/README.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ee4679afd980744cd993487675179df9e3217a99 |
| --- /dev/null |
| +++ b/device/wake_lock/public/interfaces/README.mojom |
| @@ -0,0 +1,19 @@ |
| +Provides the ability to block the device / display from sleeping. |
|
Ken Rockot(use gerrit already)
2017/03/16 17:48:40
README.mojom?
dcheng
2017/03/17 06:55:26
Nit: should this be README.md?
blundell
2017/03/17 12:28:21
Who is README.mojom? My name is README.md.
blundell
2017/03/17 12:28:21
Who is README.mojom? My name is README.md.
|
| + |
| +On Android, the implementation is inherently coupled to the NativeView |
| +associated with the context of the requestor due to system APIs. To handle |
| +this coupling, the Wake Lock usage model on Android is as follows: |
| + |
| +(1) The embedder passes in a callback at Device Service construction that |
| +enables the Wake Lock implementation to map (embedder-specific) context IDs to |
| +NativeViews. |
| +(2) For a given embedder-specific context, a trusted client |
| +connects to the WakeLockContextProvider interface and gets a |
| +WakeLockContext instance that is associated with that context. |
| +(3) That trusted client then forwards requests to bind wake locks from |
| +untrusted clients that are made within that context, with the Wake Lock |
| +implementation using the callback from (1) as necessary to obtain the |
| +NativeView associated with that context. |
| + |
| +On other platforms, the usage model is similar but the callback is not |
| +necessary/employed. |