Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3027)

Unified Diff: device/wake_lock/public/interfaces/wake_lock_context.mojom

Issue 2867303003: Generalize the API of WakeLockContext mojo interface. (Closed)
Patch Set: Generalize the API of WakeLockContext mojo interface. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/wake_lock/public/interfaces/wake_lock_context.mojom
diff --git a/device/wake_lock/public/interfaces/wake_lock_context.mojom b/device/wake_lock/public/interfaces/wake_lock_context.mojom
index bb01e64b8bfd1839eac0726b374020babdce49e8..59a6d98c15d9c228f0da8cd02366645d59ef5412 100644
--- a/device/wake_lock/public/interfaces/wake_lock_context.mojom
+++ b/device/wake_lock/public/interfaces/wake_lock_context.mojom
@@ -6,8 +6,32 @@ module device.mojom;
import "device/wake_lock/public/interfaces/wake_lock_service.mojom";
+enum WakeLockType {
+ // Prevent the application from being suspended. On some platforms, apps may
+ // be suspended when they are not visible to the user. This type of block
+ // requests that the app continue to run in that case, and on all platforms
+ // prevents the system from sleeping.
+ // Example use cases: downloading a file, playing audio.
+ PreventAppSuspension = 0,
+
+ // Prevent the display from going to sleep. This also has the side effect of
+ // preventing the system from sleeping, but does not necessarily prevent the
+ // app from being suspended on some platforms if the user hides it.
+ // Example use case: playing video.
+ PreventDisplaySleep = 1,
+};
+
+enum WakeLockReason {
+ // Audio is being played.
+ ReasonAudioPlayback = 0,
+ // Video is being played.
+ ReasonVideoPlayback = 1,
+ // WakeLock for some other reason.
+ ReasonOther = 2,
+};
+
// Context in which WakeLockService instances operate.
interface WakeLockContext {
// Gets a WakeLockService within this context.
- GetWakeLock(WakeLockService& wake_lock);
+ GetWakeLock(WakeLockType type, WakeLockReason reason, string description, WakeLockService& wake_lock);
};
« no previous file with comments | « device/power_save_blocker/BUILD.gn ('k') | device/wake_lock/public/interfaces/wake_lock_context_provider.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698