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

Unified Diff: content/shell/browser/layout_test/layout_test_notification_manager.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/shell/browser/layout_test/layout_test_notification_manager.cc
diff --git a/content/shell/browser/layout_test/layout_test_notification_manager.cc b/content/shell/browser/layout_test/layout_test_notification_manager.cc
index cfac368b75d264ebd9f7f0608687652ad95e0180..8f798a013e70216efe0300b0f53a78a576366a5d 100644
--- a/content/shell/browser/layout_test/layout_test_notification_manager.cc
+++ b/content/shell/browser/layout_test/layout_test_notification_manager.cc
@@ -83,14 +83,15 @@ void LayoutTestNotificationManager::ClosePersistentNotification(
persistent_notifications_.erase(notification_id);
}
-bool LayoutTestNotificationManager::GetDisplayedNotifications(
+void LayoutTestNotificationManager::GetDisplayedNotifications(
BrowserContext* browser_context,
- std::set<std::string>* displayed_notifications) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(displayed_notifications);
-
- // Notifications will never outlive the lifetime of running layout tests.
- return false;
+ const NotificationResultCallback& callback) {
+ std::unique_ptr<std::set<std::string>> displayedNotifications =
Peter Beverloo 2017/03/15 18:07:51 nit: displayed_notifications
Miguel Garcia 2017/03/16 14:57:43 Done.
+ base::MakeUnique<std::set<std::string>>();
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
Peter Beverloo 2017/03/15 18:07:51 nit: drop content:: from these, you are in that na
Miguel Garcia 2017/03/16 14:57:42 Done.
+ base::Bind(callback, base::Passed(&displayedNotifications),
+ false /* supports getting displayed notifications */));
}
void LayoutTestNotificationManager::SimulateClick(

Powered by Google App Engine
This is Rietveld 408576698