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

Unified Diff: content/public/browser/platform_notification_service.h

Issue 2749453002: Make GetDisplayedNotifications asynchronous. (Closed)
Patch Set: review Created 3 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: content/public/browser/platform_notification_service.h
diff --git a/content/public/browser/platform_notification_service.h b/content/public/browser/platform_notification_service.h
index c1ad9ecd12d03f138b9723274bd68626e4583cad..7689ff65699bc9a352cb49dafb2c792460910a17 100644
--- a/content/public/browser/platform_notification_service.h
+++ b/content/public/browser/platform_notification_service.h
@@ -33,6 +33,10 @@ class CONTENT_EXPORT PlatformNotificationService {
public:
virtual ~PlatformNotificationService() {}
+ using DisplayedNotificationsCallback =
+ base::Callback<void(std::unique_ptr<std::set<std::string>>,
+ bool /* supports synchronization */)>;
+
// Checks if |origin| has permission to display Web Notifications.
// This method must only be called on the UI thread.
virtual blink::mojom::PermissionStatus CheckPermissionOnUIThread(
@@ -78,12 +82,11 @@ class CONTENT_EXPORT PlatformNotificationService {
BrowserContext* browser_context,
const std::string& notification_id) = 0;
- // Writes the ids of all currently displaying notifications for the
- // given |browser_context| to |displayed_notifications|. Returns whether the
- // platform is able to provide such a set.
- virtual bool GetDisplayedNotifications(
+ // Retrieves the ids of all currently displaying notifications and
+ // posts |callback| with the result.
+ virtual void GetDisplayedNotifications(
BrowserContext* browser_context,
- std::set<std::string>* displayed_notifications) = 0;
+ const DisplayedNotificationsCallback& callback) = 0;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698