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

Unified Diff: content/test/mock_platform_notification_service.cc

Issue 2749453002: Make GetDisplayedNotifications asynchronous. (Closed)
Patch Set: - 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/test/mock_platform_notification_service.cc
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
index f1fa04a43f06c0b9fd7c66836f0b9e2550cbc739..aac4e62a0166997fb158adf96a23a821b1af1074 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -80,16 +80,21 @@ void MockPlatformNotificationService::ClosePersistentNotification(
persistent_notifications_.erase(notification_id);
}
-bool MockPlatformNotificationService::GetDisplayedNotifications(
+void MockPlatformNotificationService::GetDisplayedNotifications(
BrowserContext* browser_context,
- std::set<std::string>* displayed_notifications) {
+ const base::Callback<void(std::unique_ptr<std::set<std::string>>,
+ bool /* supports synchronization */)>& callback) {
Peter Beverloo 2017/03/15 18:07:51 dito
Miguel Garcia 2017/03/16 14:57:43 Done.
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(displayed_notifications);
+ std::unique_ptr<std::set<std::string>> displayed_notifications =
+ base::MakeUnique<std::set<std::string>>();
for (const auto& kv : persistent_notifications_)
displayed_notifications->insert(kv.first);
- return true;
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
Peter Beverloo 2017/03/15 18:07:51 nit: same, drop content::
Miguel Garcia 2017/03/16 14:57:43 Done.
+ base::Bind(callback, base::Passed(&displayed_notifications),
+ true /* supports synchronization */));
}
void MockPlatformNotificationService::SimulateClick(

Powered by Google App Engine
This is Rietveld 408576698