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

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: Expose EventInProgress() to ConnectionFactoryImpl so that it can control whether EndConnectionAttem… 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 20117b60db11abe01941b47bf1a56d813cc71f7e..07c5947fcafeb4dd79d974accb24f72f46cb883d 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 (logging_in_)
- 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_.EventInProgress()) {
+ if (logging_in_)
Peter Beverloo 2017/01/12 16:03:27 note: this will need to merge with your reason ==
harkness 2017/01/16 12:20:37 Acknowledged.
+ event_tracker_.ConnectionLoginFailed();
+ event_tracker_.EndConnectionAttempt();
+ }
CloseSocket();
DCHECK(!IsEndpointReachable());

Powered by Google App Engine
This is Rietveld 408576698