[GCM] Add heartbeat manager and reconnection logic due to heartbeat failure
commit079631dd15199a1463505b7c51570c27ba0e13c8
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 3 Jan 2014 00:53:34 +0000 (3 00:53 +0000)
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 3 Jan 2014 00:53:34 +0000 (3 00:53 +0000)
treeffca7f0f37754f3ed403ff3daff04ff5fef9031f
parentd3c6e6956c72c19d7d06021c87304728db1615be
[GCM] Add heartbeat manager and reconnection logic due to heartbeat failure

The heartbeat manager maintains the heartbeat timer, handles heartbeat
interval updates from the server, and automatically triggers connection resets
if the heartbeat isn't properly acknowledged in a timely manner.

Also fixes an issue in reconnection where the client socket handle doesn't deal
well with a connection reset due to passing ownership of the socket.

BUG=284553

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242848 0039d316-1c4b-4281-b951-d872f2087c98
14 files changed:
google_apis/gcm/engine/connection_factory_impl.cc
google_apis/gcm/engine/connection_handler.h
google_apis/gcm/engine/connection_handler_impl.cc
google_apis/gcm/engine/connection_handler_impl.h
google_apis/gcm/engine/connection_handler_impl_unittest.cc
google_apis/gcm/engine/fake_connection_factory.cc
google_apis/gcm/engine/fake_connection_handler.cc
google_apis/gcm/engine/fake_connection_handler.h
google_apis/gcm/engine/heartbeat_manager.cc [new file with mode: 0644]
google_apis/gcm/engine/heartbeat_manager.h [new file with mode: 0644]
google_apis/gcm/engine/heartbeat_manager_unittest.cc [new file with mode: 0644]
google_apis/gcm/engine/mcs_client.cc
google_apis/gcm/engine/mcs_client.h
google_apis/gcm/gcm.gyp