summaryrefslogtreecommitdiffstats
path: root/components/invalidation/gcm_network_channel_delegate.h
diff options
context:
space:
mode:
authorpavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 01:27:56 +0000
committerpavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 01:27:56 +0000
commitdd507f56a61ec1479d5351708a6a1d00ce565f45 (patch)
treee6dd4788edc73d99a5c4142a12b096a086edb3b3 /components/invalidation/gcm_network_channel_delegate.h
parent688ad62a51b6bfeb99a6bae24312dc72461e8dee (diff)
downloadchromium_src-dd507f56a61ec1479d5351708a6a1d00ce565f45.zip
chromium_src-dd507f56a61ec1479d5351708a6a1d00ce565f45.tar.gz
chromium_src-dd507f56a61ec1479d5351708a6a1d00ce565f45.tar.bz2
Notify SyncNetworkChannel about GCM connection state
This change propagates GCM connection state from GCMInvalidationBridge to SyncNetworkChannel where based on this notification overall invalidations state is updated. This change still has issue that when GCM connection is down but HTTP request succeeds then status is updated to NOTIFICATIONS_ENABLED. Fixing this requires minor refactoring which I would like to pull into separate change. BUG=378536 R=rlarocque@chromium.org Review URL: https://codereview.chromium.org/334253006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/invalidation/gcm_network_channel_delegate.h')
-rw-r--r--components/invalidation/gcm_network_channel_delegate.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/invalidation/gcm_network_channel_delegate.h b/components/invalidation/gcm_network_channel_delegate.h
index fe997fe..3f89304 100644
--- a/components/invalidation/gcm_network_channel_delegate.h
+++ b/components/invalidation/gcm_network_channel_delegate.h
@@ -24,16 +24,23 @@ namespace syncer {
// thread and callbacks should be invoked there as well.
class GCMNetworkChannelDelegate {
public:
+ enum ConnectionState {
+ CONNECTION_STATE_OFFLINE,
+ CONNECTION_STATE_ONLINE
+ };
+
typedef base::Callback<void(const GoogleServiceAuthError& error,
const std::string& token)> RequestTokenCallback;
typedef base::Callback<void(const std::string& registration_id,
gcm::GCMClient::Result result)> RegisterCallback;
typedef base::Callback<void(const std::string& message,
const std::string& echo_token)> MessageCallback;
+ typedef base::Callback<void(ConnectionState connection_state)>
+ ConnectionStateCallback;
virtual ~GCMNetworkChannelDelegate() {}
- virtual void Initialize() = 0;
+ virtual void Initialize(ConnectionStateCallback callback) = 0;
// Request access token. Callback should be called either with access token or
// error code.
virtual void RequestToken(RequestTokenCallback callback) = 0;