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()); |