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

Unified Diff: third_party/WebKit/public/platform/modules/permissions/permission.mojom

Issue 2573573002: Switch PermissionStatus events to an observer model. (Closed)
Patch Set: Remove call to registerPreFinalizer(). Created 4 years 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: third_party/WebKit/public/platform/modules/permissions/permission.mojom
diff --git a/third_party/WebKit/public/platform/modules/permissions/permission.mojom b/third_party/WebKit/public/platform/modules/permissions/permission.mojom
index ef429379f97c3836ee0ef8b504482fcac89ff004..93b870ae0a9429c11a8fc927881834cd1b3c790b 100644
--- a/third_party/WebKit/public/platform/modules/permissions/permission.mojom
+++ b/third_party/WebKit/public/platform/modules/permissions/permission.mojom
@@ -35,6 +35,11 @@ struct PermissionDescriptor {
PermissionDescriptorExtension? extension;
};
+// Interface a client can implement to observe permission changes.
+interface PermissionObserver {
+ OnPermissionStatusChange(PermissionStatus status);
+};
+
// The Permission service provides permission handling capabilities by exposing
// methods to check, request, and revoke permissions. It also allows a client to
// start listening to permission changes.
@@ -49,13 +54,8 @@ interface PermissionService {
=> (array<PermissionStatus> statuses);
RevokePermission(PermissionDescriptor permission, url.mojom.Origin origin)
=> (PermissionStatus status);
-
- // Runs the callback next time there is a permission status change for the
- // given { permission, origin }. Callers of this method will have to call it
- // again if they want to keep listening to the changes. To prevent race
- // conditions, the caller must pass the last known value.
- GetNextPermissionChange(PermissionDescriptor permission,
- url.mojom.Origin origin,
- PermissionStatus last_known_status)
- => (PermissionStatus status);
+ AddPermissionObserver(PermissionDescriptor permission,
mlamouri (slow - plz ping) 2016/12/19 13:37:45 It would be good to add a comment. You should be a
Reilly Grant (use Gerrit) 2016/12/19 22:23:59 Done.
+ url.mojom.Origin origin,
+ PermissionStatus last_known_status,
+ PermissionObserver observer);
};

Powered by Google App Engine
This is Rietveld 408576698