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

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

Issue 206873006: [GCM] Add port 443 fallback logic and histograms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | google_apis/gcm/engine/connection_factory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 967c6c1ae46d0fc820ca02e51a82f4f8b4a297bb..28c29414de3be48ff7de2a5ff6e7ae19ed2d9373 100644
--- a/google_apis/gcm/engine/connection_factory_impl.h
+++ b/google_apis/gcm/engine/connection_factory_impl.h
@@ -32,7 +32,7 @@ class GCM_EXPORT ConnectionFactoryImpl :
public net::NetworkChangeNotifier::IPAddressObserver {
public:
ConnectionFactoryImpl(
- const GURL& mcs_endpoint,
+ const std::vector<GURL>& mcs_endpoints,
const net::BackoffEntry::Policy& backoff_policy,
scoped_refptr<net::HttpNetworkSession> network_session,
net::NetLog* net_log);
@@ -54,6 +54,11 @@ class GCM_EXPORT ConnectionFactoryImpl :
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
+ // attempt will be made.
+ GURL GetCurrentEndpoint() const;
+
protected:
// Implementation of Connect(..). If not in backoff, uses |login_request_|
// in attempting a connection/handshake. On connection/handshake failure, goes
@@ -89,8 +94,12 @@ class GCM_EXPORT ConnectionFactoryImpl :
void CloseSocket();
- // The MCS endpoint to make connections to.
- const GURL mcs_endpoint_;
+ // The MCS endpoints to make connections to, sorted in order of priority.
+ const std::vector<GURL> mcs_endpoints_;
+ // Index to the endpoint for which a connection should be attempted next.
+ size_t next_endpoint_;
+ // Index to the endpoint that was last successfully connected.
+ size_t last_successful_endpoint_;
// The backoff policy to use.
const net::BackoffEntry::Policy backoff_policy_;
« no previous file with comments | « no previous file | google_apis/gcm/engine/connection_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698