[GCM] Fix crash during connection races
commit3ca5141f50f9bb9367f1969e904900fecd9aa49e
authorzea <zea@chromium.org>
Thu, 5 Mar 2015 02:58:39 +0000 (4 18:58 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Mar 2015 02:59:44 +0000 (5 02:59 +0000)
tree94de8bdfb3529cef7e44d53b647a81de44f4e32b
parentbd907bb661972284eab39dd75fcf5dcd5eb54868
[GCM] Fix crash during connection races

If a connection attempt is triggered while a connection is open, but not
active (for example due to a socket error), make sure the old connection
is closed before reattempting to connect.

BUG=462319

Review URL: https://codereview.chromium.org/980433003

Cr-Commit-Position: refs/heads/master@{#319201}
google_apis/gcm/engine/connection_factory_impl.cc
google_apis/gcm/engine/connection_factory_impl_unittest.cc
google_apis/gcm/engine/fake_connection_handler.cc
google_apis/gcm/engine/fake_connection_handler.h