summaryrefslogtreecommitdiffstats
path: root/chrome/service/net
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 18:18:00 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 18:18:00 +0000
commitc3a420945071a54182d63de697be0a80f5dab0c0 (patch)
tree5b6a16e60c10411f0ed2a5171c8139e02e29d11a /chrome/service/net
parent1d20cdf4cb74b3a1b47c7bd62d3e3d17be4c6013 (diff)
downloadchromium_src-c3a420945071a54182d63de697be0a80f5dab0c0.zip
chromium_src-c3a420945071a54182d63de697be0a80f5dab0c0.tar.gz
chromium_src-c3a420945071a54182d63de697be0a80f5dab0c0.tar.bz2
Reland r74842
The bug was that the ProfilePolicyContext was getting initialized before the ProfileImplIOData::Handle was initialized. BUG=67237 TEST=none Review URL: http://codereview.chromium.org/6526029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/net')
-rw-r--r--chrome/service/net/service_url_request_context.cc54
-rw-r--r--chrome/service/net/service_url_request_context.h4
2 files changed, 28 insertions, 30 deletions
diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc
index e5d75cc..b09794e 100644
--- a/chrome/service/net/service_url_request_context.cc
+++ b/chrome/service/net/service_url_request_context.cc
@@ -105,9 +105,9 @@ std::string MakeUserAgentForServiceProcess() {
ServiceURLRequestContext::ServiceURLRequestContext(
const std::string& user_agent) : user_agent_(user_agent) {
- host_resolver_ =
+ set_host_resolver(
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
- NULL, NULL);
+ NULL, NULL));
DCHECK(g_service_process);
// TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a
// MessageLoopProxy* instead of MessageLoop*.
@@ -116,29 +116,30 @@ ServiceURLRequestContext::ServiceURLRequestContext(
net::ProxyService::CreateSystemProxyConfigService(
g_service_process->io_thread()->message_loop(),
g_service_process->file_thread()->message_loop());
- proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service, 0u, NULL);
- cert_verifier_ = new net::CertVerifier;
- dnsrr_resolver_ = new net::DnsRRResolver;
- ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_);
- ssl_config_service_ = new net::SSLConfigServiceDefaults;
- http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(
- host_resolver_);
+ set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver(
+ proxy_config_service, 0u, NULL));
+ set_cert_verifier(new net::CertVerifier);
+ set_dnsrr_resolver(new net::DnsRRResolver);
+ set_ftp_transaction_factory(new net::FtpNetworkLayer(host_resolver()));
+ set_ssl_config_service(new net::SSLConfigServiceDefaults);
+ set_http_auth_handler_factory(net::HttpAuthHandlerFactory::CreateDefault(
+ host_resolver()));
net::HttpNetworkSession::Params session_params;
- session_params.host_resolver = host_resolver_;
- session_params.cert_verifier = cert_verifier_;
- session_params.dnsrr_resolver = dnsrr_resolver_;
- session_params.proxy_service = proxy_service_;
- session_params.ssl_config_service = ssl_config_service_;
+ session_params.host_resolver = host_resolver();
+ session_params.cert_verifier = cert_verifier();
+ session_params.dnsrr_resolver = dnsrr_resolver();
+ session_params.proxy_service = proxy_service();
+ session_params.ssl_config_service = ssl_config_service();
scoped_refptr<net::HttpNetworkSession> network_session(
new net::HttpNetworkSession(session_params));
- http_transaction_factory_ = new net::HttpCache(
- network_session,
- net::HttpCache::DefaultBackend::InMemory(0));
+ set_http_transaction_factory(
+ new net::HttpCache(
+ network_session,
+ net::HttpCache::DefaultBackend::InMemory(0)));
// In-memory cookie store.
- cookie_store_ = new net::CookieMonster(NULL, NULL);
- accept_language_ = "en-us,fr";
- accept_charset_ = "iso-8859-1,*,utf-8";
+ set_cookie_store(new net::CookieMonster(NULL, NULL));
+ set_accept_language("en-us,fr");
+ set_accept_charset("iso-8859-1,*,utf-8");
}
const std::string& ServiceURLRequestContext::GetUserAgent(
@@ -150,11 +151,12 @@ const std::string& ServiceURLRequestContext::GetUserAgent(
}
ServiceURLRequestContext::~ServiceURLRequestContext() {
- delete ftp_transaction_factory_;
- delete http_transaction_factory_;
- delete http_auth_handler_factory_;
- delete cert_verifier_;
- delete dnsrr_resolver_;
+ delete ftp_transaction_factory();
+ delete http_transaction_factory();
+ delete http_auth_handler_factory();
+ delete cert_verifier();
+ delete dnsrr_resolver();
+ delete host_resolver();
}
ServiceURLRequestContextGetter::ServiceURLRequestContextGetter()
diff --git a/chrome/service/net/service_url_request_context.h b/chrome/service/net/service_url_request_context.h
index 47d5c23e..7ffda3c 100644
--- a/chrome/service/net/service_url_request_context.h
+++ b/chrome/service/net/service_url_request_context.h
@@ -32,9 +32,6 @@ class MessageLoopProxy;
class ServiceURLRequestContext : public net::URLRequestContext {
public:
explicit ServiceURLRequestContext(const std::string& user_agent);
- void set_cookie_policy(net::CookiePolicy* policy) {
- cookie_policy_ = policy;
- }
// Overridden from net::URLRequestContext:
virtual const std::string& GetUserAgent(const GURL& url) const;
@@ -68,4 +65,3 @@ class ServiceURLRequestContextGetter : public URLRequestContextGetter {
};
#endif // CHROME_SERVICE_NET_SERVICE_URL_REQUEST_CONTEXT_H_
-