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

Unified Diff: content/browser/notifications/platform_notification_context_impl.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/browser/notifications/platform_notification_context_impl.h
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
index 2a27522abb35ec30dbf47b7ba0b80531fd9a989b..1193cc6117fc6ae14fe9f0bb4aa8f7f06102361b 100644
--- a/content/browser/notifications/platform_notification_context_impl.h
+++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -101,7 +101,12 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
~PlatformNotificationContextImpl() override;
- void InitializeOnIO();
+ void DidGetNotificationsOnUI(
+ std::unique_ptr<std::set<std::string>> displayed_notifications,
+ bool supports_synchronization);
+ void InitializeOnIO(
+ std::unique_ptr<std::set<std::string>> displayed_notifications,
+ bool supports_synchronization);
void ShutdownOnIO();
void CreateServiceOnIO(
int render_process_id,
@@ -129,14 +134,22 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
const ReadResultCallback& callback);
// Updates the database (and the result callback) based on
- // |displayed_notifications|
- // if |sync_supported|. Called on the IO thread.
- void SynchronizeDisplayedNotificationsForServiceWorkerRegistration(
+ // |displayed_notifications| if |supports_synchronization|.
+ void SynchronizeDisplayedNotificationsForServiceWorkerRegistrationOnUI(
+ const GURL& origin,
+ int64_t service_worker_registration_id,
+ const ReadAllResultCallback& callback,
+ std::unique_ptr<std::set<std::string>> displayed_notifications,
+ bool supports_synchronization);
+
+ // Updates the database (and the result callback) based on
+ // |displayed_notifications| if |supports_synchronization|.
+ void SynchronizeDisplayedNotificationsForServiceWorkerRegistrationOnIO(
const GURL& origin,
int64_t service_worker_registration_id,
const ReadAllResultCallback& callback,
std::unique_ptr<std::set<std::string>> displayed_notifications,
- bool sync_supported);
+ bool supports_synchronization);
// Actually reads all notification data from the database. Must only be
// called on the |task_runner_| thread. |callback| will be invoked on the
@@ -146,7 +159,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
int64_t service_worker_registration_id,
const ReadAllResultCallback& callback,
std::unique_ptr<std::set<std::string>> displayed_notifications,
- bool synchronization_supported);
+ bool supports_synchronization);
// Actually writes the notification database to the database. Must only be
// called on the |task_runner_| thread. |callback| will be invoked on the

Powered by Google App Engine
This is Rietveld 408576698