diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-30 03:45:42 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-30 03:45:42 +0000 |
commit | 0a0c8eed06fc7c849c39ee7119661dd424164d7a (patch) | |
tree | 18db8b423c8c558244bfc44deb54e5a5403394c9 /google_apis | |
parent | 606bb3bbbd233bae020bcc8538fd0994e7eed468 (diff) | |
download | chromium_src-0a0c8eed06fc7c849c39ee7119661dd424164d7a.zip chromium_src-0a0c8eed06fc7c849c39ee7119661dd424164d7a.tar.gz chromium_src-0a0c8eed06fc7c849c39ee7119661dd424164d7a.tar.bz2 |
[GCM] Ignore network status when reconnecting again
It appears the network change notifications may not be enough to suppress
connection attemtps. Clients are getting stuck waiting for a notification,
despite being online. Ignore the network status for now until a better solution
can be created (this brings things back to their old behavior).
BUG=396687
Review URL: https://codereview.chromium.org/427113002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/gcm/engine/connection_factory_impl.cc | 9 | ||||
-rw-r--r-- | google_apis/gcm/engine/connection_factory_impl_unittest.cc | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/google_apis/gcm/engine/connection_factory_impl.cc b/google_apis/gcm/engine/connection_factory_impl.cc index f7cd669..cf90aed 100644 --- a/google_apis/gcm/engine/connection_factory_impl.cc +++ b/google_apis/gcm/engine/connection_factory_impl.cc @@ -190,8 +190,8 @@ void ConnectionFactoryImpl::SignalConnectionReset( CloseSocket(); DCHECK(!IsEndpointReachable()); - if (waiting_for_network_online_) - return; + // TODO(zea): if the network is offline, don't attempt to connect. + // See crbug.com/396687 // Network changes get special treatment as they can trigger a one-off canary // request that bypasses backoff (but does nothing if a connection is in @@ -245,6 +245,7 @@ void ConnectionFactoryImpl::OnNetworkChanged( waiting_for_network_online_ = true; // Will do nothing due to |waiting_for_network_online_ == true|. + // TODO(zea): make the above statement actually true. See crbug.com/396687 SignalConnectionReset(NETWORK_CHANGE); return; } @@ -278,8 +279,8 @@ void ConnectionFactoryImpl::ConnectImpl() { DCHECK(!IsEndpointReachable()); DCHECK(!socket_handle_.socket()); - if (waiting_for_network_online_) - return; + // TODO(zea): if the network is offline, don't attempt to connect. + // See crbug.com/396687 connecting_ = true; GURL current_endpoint = GetCurrentEndpoint(); diff --git a/google_apis/gcm/engine/connection_factory_impl_unittest.cc b/google_apis/gcm/engine/connection_factory_impl_unittest.cc index 310e831..51958ea 100644 --- a/google_apis/gcm/engine/connection_factory_impl_unittest.cc +++ b/google_apis/gcm/engine/connection_factory_impl_unittest.cc @@ -527,7 +527,8 @@ TEST_F(ConnectionFactoryImplTest, SignalResetRestoresBackoff) { // When the network is disconnected, close the socket and suppress further // connection attempts until the network returns. -TEST_F(ConnectionFactoryImplTest, SuppressConnectWhenNoNetwork) { +// Disabled while crbug.com/396687 is being investigated. +TEST_F(ConnectionFactoryImplTest, DISABLED_SuppressConnectWhenNoNetwork) { factory()->SetConnectResult(net::OK); factory()->Connect(); EXPECT_TRUE(factory()->NextRetryAttempt().is_null()); |