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

Unified Diff: public/platform/modules/permissions/WebPermissionClient.h

Issue 1054663002: Implement Permission change observing in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: relax assert Created 5 years, 9 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: public/platform/modules/permissions/WebPermissionClient.h
diff --git a/public/platform/modules/permissions/WebPermissionClient.h b/public/platform/modules/permissions/WebPermissionClient.h
index 0fa1faf4c9c92aa938822fe9082bdee90ec2fd28..efc8811b81bb5f4f33b96c8a9b1edb567632bad7 100644
--- a/public/platform/modules/permissions/WebPermissionClient.h
+++ b/public/platform/modules/permissions/WebPermissionClient.h
@@ -13,6 +13,7 @@ namespace blink {
using WebPermissionQueryCallback = WebCallbacks<WebPermissionStatus, void>;
+class WebPermissionObserver;
class WebURL;
// This client is expected to do general permission handling. From simple
@@ -20,7 +21,17 @@ class WebURL;
class WebPermissionClient {
public:
// Query the permission status of a given origin for a specific permission.
- virtual void queryPermission(WebPermissionType, const WebURL&, WebPermissionQueryCallback*) = 0;
+ virtual void queryPermission(WebPermissionType, const WebURL&, WebPermissionQueryCallback*) { }
+
+ // Listen for permission changes for a given origin and inform the observer
+ // when they happen. The observer is not owned by the WebPermissionClient.
+ // The client should expect stopListening() to be called when the observer
+ // will be destroyed.
+ virtual void startListening(WebPermissionType, const WebURL&, WebPermissionObserver*) { }
+
+ // Stop listening to all the permission changes associated with the given
+ // observer.
+ virtual void stopListening(WebPermissionObserver*) { }
protected:
virtual ~WebPermissionClient() { }
« no previous file with comments | « Source/modules/permissions/Permissions.cpp ('k') | public/platform/modules/permissions/WebPermissionObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698