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

Unified Diff: content/test/mock_platform_notification_service.cc

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
« no previous file with comments | « content/test/mock_platform_notification_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..47990a26fa89ce4a54846224f3b6c6161b350c74 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -80,16 +80,19 @@ void MockPlatformNotificationService::ClosePersistentNotification(
persistent_notifications_.erase(notification_id);
}
-bool MockPlatformNotificationService::GetDisplayedNotifications(
+void MockPlatformNotificationService::GetDisplayedNotifications(
BrowserContext* browser_context,
- std::set<std::string>* displayed_notifications) {
+ const DisplayedNotificationsCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(displayed_notifications);
+ auto displayed_notifications = base::MakeUnique<std::set<std::string>>();
for (const auto& kv : persistent_notifications_)
displayed_notifications->insert(kv.first);
- return true;
+ BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, base::Passed(&displayed_notifications),
+ true /* supports_synchronization */));
}
void MockPlatformNotificationService::SimulateClick(
« no previous file with comments | « content/test/mock_platform_notification_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698