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

Unified Diff: google_apis/gcm/engine/connection_factory_impl.cc

Issue 2628733004: Update ConnectionEventTracker to check if there is an in progress attempt. (Closed)
Patch Set: Rebase and fix nits Created 3 years, 11 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: google_apis/gcm/engine/connection_factory_impl.cc
diff --git a/google_apis/gcm/engine/connection_factory_impl.cc b/google_apis/gcm/engine/connection_factory_impl.cc
index 2d459f20d2f88159ba18e8bef48e0c9084197177..1eba5809ed8c061013837e3305ddae210900dc90 100644
--- a/google_apis/gcm/engine/connection_factory_impl.cc
+++ b/google_apis/gcm/engine/connection_factory_impl.cc
@@ -209,9 +209,14 @@ void ConnectionFactoryImpl::SignalConnectionReset(
// connection.
}
- if (reason == LOGIN_FAILURE)
- event_tracker_.ConnectionLoginFailed();
- event_tracker_.EndConnectionAttempt();
+ // SignalConnectionReset can be called at any time without regard to whether
+ // a connection attempt is currently in progress. Only notify the event
+ // tracker if there is an event in progress.
+ if (event_tracker_.IsEventInProgress()) {
+ if (reason == LOGIN_FAILURE)
+ event_tracker_.ConnectionLoginFailed();
+ event_tracker_.EndConnectionAttempt();
+ }
CloseSocket();
DCHECK(!IsEndpointReachable());
« no previous file with comments | « google_apis/gcm/engine/connection_event_tracker.cc ('k') | google_apis/gcm/engine/connection_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698