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

Unified Diff: chrome/browser/push_messaging/push_messaging_service_impl.cc

Issue 2781413002: [Push API] Fix flaky PushEventNotificationWithoutEventWaitUntil (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
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/push_messaging/push_messaging_service_impl.cc
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc
index d90b5bd45f0c4340dfee977c126d8d401928e56a..9144cd5376fb74d6b36dcc1dd70379aff5c01690 100644
--- a/chrome/browser/push_messaging/push_messaging_service_impl.cc
+++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
@@ -395,15 +395,16 @@ void PushMessagingServiceImpl::DidHandleMessage(
// an iterator rather than by value, as the latter removes all entries.
in_flight_message_deliveries_.erase(in_flight_iterator);
- message_handled_closure.Run();
-
- if (push_messaging_service_observer_)
- push_messaging_service_observer_->OnMessageHandled();
-
#if BUILDFLAG(ENABLE_BACKGROUND)
+ // Reset before running callbacks below, so tests can verify keep-alive reset.
if (in_flight_message_deliveries_.empty())
in_flight_keep_alive_.reset();
#endif
+
+ message_handled_closure.Run();
+
+ if (push_messaging_service_observer_)
+ push_messaging_service_observer_->OnMessageHandled();
}
void PushMessagingServiceImpl::SetMessageCallbackForTesting(
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698