diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 02:18:55 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 02:18:55 +0000 |
commit | 6f63606a8e7134077491ed24e883ad57120eeba3 (patch) | |
tree | d5988c0a6b1c1256ec92d4603ccd6f70d68322b7 /components/gcm_driver | |
parent | 4f897ec9161aa170fbd8d71a3d2aa9b8fb5d9d88 (diff) | |
download | chromium_src-6f63606a8e7134077491ed24e883ad57120eeba3.zip chromium_src-6f63606a8e7134077491ed24e883ad57120eeba3.tar.gz chromium_src-6f63606a8e7134077491ed24e883ad57120eeba3.tar.bz2 |
Leverage profile's http network session HttpAuthCache to support proxy auth.
This allows the connect job to leverage any auth cache credentials the profile
has, including those the user gets prompted for as part of loading a page
while behind an authenticated proxy. GCM continues to use its own network
session for creating the connections, but at connection time the HttpAuthCache
is coped over from the profile's http network session (if available).
BUG=385748
Review URL: https://codereview.chromium.org/375663002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/gcm_driver')
-rw-r--r-- | components/gcm_driver/gcm_client_impl.cc | 10 | ||||
-rw-r--r-- | components/gcm_driver/gcm_client_impl.h | 3 | ||||
-rw-r--r-- | components/gcm_driver/gcm_client_impl_unittest.cc | 6 |
3 files changed, 14 insertions, 5 deletions
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc index 2000403..1af8dc5 100644 --- a/components/gcm_driver/gcm_client_impl.cc +++ b/components/gcm_driver/gcm_client_impl.cc @@ -24,6 +24,7 @@ #include "google_apis/gcm/protocol/checkin.pb.h" #include "google_apis/gcm/protocol/mcs.pb.h" #include "net/http/http_network_session.h" +#include "net/http/http_transaction_factory.h" #include "net/url_request/url_request_context.h" #include "url/gurl.h" @@ -236,13 +237,15 @@ scoped_ptr<MCSClient> GCMInternalsBuilder::BuildMCSClient( scoped_ptr<ConnectionFactory> GCMInternalsBuilder::BuildConnectionFactory( const std::vector<GURL>& 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) { return make_scoped_ptr<ConnectionFactory>( new ConnectionFactoryImpl(endpoints, backoff_policy, - network_session, + gcm_network_session, + http_network_session, net_log, recorder)); } @@ -371,6 +374,9 @@ void GCMClientImpl::InitializeMCSClient( endpoints, kDefaultBackoffPolicy, network_session_, + url_request_context_getter_->GetURLRequestContext() + ->http_transaction_factory() + ->GetSession(), net_log_.net_log(), &recorder_); connection_factory_->SetConnectionListener(this); diff --git a/components/gcm_driver/gcm_client_impl.h b/components/gcm_driver/gcm_client_impl.h index 920bd87..10d89b7 100644 --- a/components/gcm_driver/gcm_client_impl.h +++ b/components/gcm_driver/gcm_client_impl.h @@ -65,7 +65,8 @@ class GCMInternalsBuilder { virtual scoped_ptr<ConnectionFactory> BuildConnectionFactory( const std::vector<GURL>& 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); }; diff --git a/components/gcm_driver/gcm_client_impl_unittest.cc b/components/gcm_driver/gcm_client_impl_unittest.cc index dafe294..b477918 100644 --- a/components/gcm_driver/gcm_client_impl_unittest.cc +++ b/components/gcm_driver/gcm_client_impl_unittest.cc @@ -168,7 +168,8 @@ class FakeGCMInternalsBuilder : public GCMInternalsBuilder { virtual scoped_ptr<ConnectionFactory> BuildConnectionFactory( const std::vector<GURL>& 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) OVERRIDE; @@ -201,7 +202,8 @@ scoped_ptr<MCSClient> FakeGCMInternalsBuilder::BuildMCSClient( scoped_ptr<ConnectionFactory> FakeGCMInternalsBuilder::BuildConnectionFactory( const std::vector<GURL>& 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) { return make_scoped_ptr<ConnectionFactory>(new FakeConnectionFactory()); |