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

Unified Diff: google_apis/gcm/engine/connection_factory_impl.h

Issue 336473003: [GCM] Suppress connection attempts when there is no valid connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review 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
Index: google_apis/gcm/engine/connection_factory_impl.h
diff --git a/google_apis/gcm/engine/connection_factory_impl.h b/google_apis/gcm/engine/connection_factory_impl.h
index 31cecf688414bca0514d6a7c6bc3a22bcef79278..cd0c613fca725201ce4e0a4ff67da8f2ad22691e 100644
--- a/google_apis/gcm/engine/connection_factory_impl.h
+++ b/google_apis/gcm/engine/connection_factory_impl.h
@@ -29,8 +29,7 @@ class GCMStatsRecorder;
class GCM_EXPORT ConnectionFactoryImpl :
public ConnectionFactory,
- public net::NetworkChangeNotifier::ConnectionTypeObserver,
- public net::NetworkChangeNotifier::IPAddressObserver {
+ public net::NetworkChangeNotifier::NetworkChangeObserver {
public:
ConnectionFactoryImpl(
const std::vector<GURL>& mcs_endpoints,
@@ -53,10 +52,9 @@ class GCM_EXPORT ConnectionFactoryImpl :
virtual void SignalConnectionReset(ConnectionResetReason reason) OVERRIDE;
virtual void SetConnectionListener(ConnectionListener* listener) OVERRIDE;
- // NetworkChangeNotifier observer implementations.
- virtual void OnConnectionTypeChanged(
+ // NetworkChangeObserver implementation.
+ virtual void OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
- virtual void OnIPAddressChanged() OVERRIDE;
// Returns the server to which the factory is currently connected, or if
// a connection is currently pending, the server to which the next connection
@@ -149,6 +147,11 @@ class GCM_EXPORT ConnectionFactoryImpl :
// expiration.
bool waiting_for_backoff_;
+ // Whether the NetworkChangeNotifier has informed the client that there is
+ // no current connection. No connection attempts will be made until the
+ // client is informed of a valid connection type.
+ bool waiting_for_network_change_;
fgorski 2014/06/19 20:01:49 nit: I understand that name comes from OnNetworkCh
Nicolas Zea 2014/06/19 21:50:04 Well, we're waiting for the network to come back o
+
// Whether login successfully completed after the connection was established.
// If a connection reset happens while attempting to log in, the current
// backoff entry is reused (after incrementing with a new failure).

Powered by Google App Engine
This is Rietveld 408576698