DescriptionReport InvalidatorState correctly from GCMNetworkChannel
The problem:
Sync observes Invalidator state to decide whenever to use PreCommit GU
optimization, therefore INVALIDATIONS_ENABLED should be reported only
when it is certain that communication channel between client and
invalidations server works both ways.
SyncNetworkChannel::NotifyStateChange is currently used for two purposes:
- Notify observers of invalidations about InvalidatorState
- Nudge cacheinvalidations to send heartbeat on network status change.
Because of this dual purpose it is called with INVALIDATIONS_ENABLED when
network status changes. In this case sync is notified that invalidations
are enabled while there is no GCM connection established.
Solution:
- Separate two purposes into separate functions and call them appropriately
- Only set INVALIDATIONS_ENABLED when it is confirmed that both http and
gcm channels are working.
BUG=377911
R=rlarocque@chromium.org,zea@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278597
Patch Set 1 #Patch Set 2 : Rebase #
Total comments: 2
Patch Set 3 : Feedback #Patch Set 4 : Fix SyncNetworkChannelTest #Messages
Total messages: 8 (0 generated)
|