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

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

Issue 375663002: Leverage profile's http network session's HttpAuthCache to support proxy auth. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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 80fbc94ea8c073ceb6caa0408e0bbb8c84f9d6ba..ddd81737f81741b81c02456e8f183bc484106089 100644
--- a/google_apis/gcm/engine/connection_factory_impl.h
+++ b/google_apis/gcm/engine/connection_factory_impl.h
@@ -31,10 +31,15 @@ class GCM_EXPORT ConnectionFactoryImpl :
public ConnectionFactory,
public net::NetworkChangeNotifier::NetworkChangeObserver {
public:
+ // |http_network_session| is an optional network session to use as a source
+ // for proxy auth credentials (via its HttpAuthCache). |gcm_network_session|
+ // is the network session through which GCM connections should be made, and
+ // must not be the same as |http_network_session|.
ConnectionFactoryImpl(
const std::vector<GURL>& mcs_endpoints,
const net::BackoffEntry::Policy& backoff_policy,
- scoped_refptr<net::HttpNetworkSession> network_session,
+ const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
+ const scoped_refptr<net::HttpNetworkSession>& http_network_session,
net::NetLog* net_log,
GCMStatsRecorder* recorder);
virtual ~ConnectionFactoryImpl();
@@ -110,8 +115,13 @@ class GCM_EXPORT ConnectionFactoryImpl :
int ReconsiderProxyAfterError(int error);
void ReportSuccessfulProxyConnection();
+ // Closes the local socket if one is present, and resets connection handler.
void CloseSocket();
+ // Updates the GCM Network Session's HttpAuthCache with the HTTP Network
+ // Session's cache, if available.
+ void RebuildNetworkSessionAuthCache();
+
// 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.
@@ -123,8 +133,11 @@ class GCM_EXPORT ConnectionFactoryImpl :
const net::BackoffEntry::Policy backoff_policy_;
// ---- net:: components for establishing connections. ----
- // Network session for creating new connections.
- const scoped_refptr<net::HttpNetworkSession> network_session_;
+ // Network session for creating new GCM connections.
+ const scoped_refptr<net::HttpNetworkSession> gcm_network_session_;
+ // HTTP Network session. If set, is used for extracting proxy auth
+ // credentials. If not set, is ignored.
+ const scoped_refptr<net::HttpNetworkSession> http_network_session_;
// Net log to use in connection attempts.
net::BoundNetLog bound_net_log_;
// The current PAC request, if one exists. Owned by the proxy service.
« no previous file with comments | « components/gcm_driver/gcm_client_impl_unittest.cc ('k') | google_apis/gcm/engine/connection_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698