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

Unified Diff: net/http/http_network_layer.cc

Issue 7854: Defer the proxy service initialization to first time resolve is called.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | « net/http/http_network_layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_layer.cc
===================================================================
--- net/http/http_network_layer.cc (revision 3703)
+++ net/http/http_network_layer.cc (working copy)
@@ -46,18 +46,16 @@
HttpNetworkLayer::HttpNetworkLayer(const ProxyInfo* pi)
: suspended_(false) {
- ProxyResolver* proxy_resolver;
if (pi) {
- proxy_resolver = new ProxyResolverFixed(*pi);
+ proxy_resolver_.reset(new ProxyResolverFixed(*pi));
} else {
#if defined(OS_WIN)
- proxy_resolver = new ProxyResolverWinHttp();
+ proxy_resolver_.reset(new ProxyResolverWinHttp());
#else
NOTIMPLEMENTED();
- proxy_resolver = new ProxyResolverNull();
+ proxy_resolver_.reset(new ProxyResolverNull());
#endif
}
- session_ = new HttpNetworkSession(proxy_resolver);
}
HttpNetworkLayer::~HttpNetworkLayer() {
@@ -67,6 +65,9 @@
if (suspended_)
return NULL;
+ if (!session_)
+ session_ = new HttpNetworkSession(proxy_resolver_.release());
+
return new HttpNetworkTransaction(
session_, ClientSocketFactory::GetDefaultFactory());
}
@@ -82,7 +83,7 @@
void HttpNetworkLayer::Suspend(bool suspend) {
suspended_ = suspend;
- if (suspend)
+ if (suspend && session_)
session_->connection_pool()->CloseIdleSockets();
}
« no previous file with comments | « net/http/http_network_layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698