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

Unified Diff: components/invalidation/sync_system_resources.h

Issue 348503002: Report InvalidatorState correctly from GCMNetworkChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@GCM.ConnectionState
Patch Set: Fix SyncNetworkChannelTest Created 6 years, 6 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
« no previous file with comments | « components/invalidation/push_client_channel.cc ('k') | components/invalidation/sync_system_resources.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/invalidation/sync_system_resources.h
diff --git a/components/invalidation/sync_system_resources.h b/components/invalidation/sync_system_resources.h
index cbc0dc27b0e4d0889df2db673e3bdb53ad3d35a2..c0e8ec2cb9a6c2e50bbd5cad3e48f155dcb10549 100644
--- a/components/invalidation/sync_system_resources.h
+++ b/components/invalidation/sync_system_resources.h
@@ -143,8 +143,17 @@ class INVALIDATION_EXPORT_PRIVATE SyncNetworkChannel
int GetReceivedMessagesCount() const;
protected:
- // Subclass should notify about connection state through NotifyStateChange.
- void NotifyStateChange(InvalidatorState invalidator_state);
+ // Subclass should call NotifyNetworkStatusChange to notify about network
+ // changes. This triggers cacheinvalidation to try resending failed message
+ // ahead of schedule when client comes online or IP address changes.
+ void NotifyNetworkStatusChange(bool online);
+
+ // Subclass should notify about connection state through
+ // NotifyChannelStateChange. If communication doesn't work and it is possible
+ // that invalidations from server will not reach this client then channel
+ // should call this function with TRANSIENT_INVALIDATION_ERROR.
+ void NotifyChannelStateChange(InvalidatorState invalidator_state);
+
// Subclass should call DeliverIncomingMessage for message to reach
// invalidations library.
bool DeliverIncomingMessage(const std::string& message);
@@ -157,8 +166,8 @@ class INVALIDATION_EXPORT_PRIVATE SyncNetworkChannel
scoped_ptr<invalidation::MessageCallback> incoming_receiver_;
NetworkStatusReceiverList network_status_receivers_;
- // Last channel state for new network status receivers.
- InvalidatorState invalidator_state_;
+ // Last network status for new network status receivers.
+ bool last_network_status_;
int received_messages_count_;
« no previous file with comments | « components/invalidation/push_client_channel.cc ('k') | components/invalidation/sync_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698