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

Unified Diff: net/proxy/proxy_service.cc

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Sync'd to revision p349162. Created 5 years, 3 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/proxy/proxy_service.h ('k') | net/proxy/proxy_service_mojo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 28f0bd804aab8b201ba8808475c02cdbd4ed8974..7a004486deb1a38491f753f90e91ae9c5e263b7f 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -935,7 +935,7 @@ ProxyService::ProxyService(ProxyConfigService* config_service,
}
// static
-ProxyService* ProxyService::CreateUsingSystemProxyResolver(
+scoped_ptr<ProxyService> ProxyService::CreateUsingSystemProxyResolver(
ProxyConfigService* proxy_config_service,
size_t num_pac_threads,
NetLog* net_log) {
@@ -949,23 +949,23 @@ ProxyService* ProxyService::CreateUsingSystemProxyResolver(
if (num_pac_threads == 0)
num_pac_threads = kDefaultNumPacThreads;
- return new ProxyService(
+ return make_scoped_ptr(new ProxyService(
proxy_config_service,
make_scoped_ptr(new ProxyResolverFactoryForSystem(num_pac_threads)),
- net_log);
+ net_log));
}
// static
-ProxyService* ProxyService::CreateWithoutProxyResolver(
+scoped_ptr<ProxyService> ProxyService::CreateWithoutProxyResolver(
ProxyConfigService* proxy_config_service,
NetLog* net_log) {
- return new ProxyService(
+ return make_scoped_ptr(new ProxyService(
proxy_config_service,
- make_scoped_ptr(new ProxyResolverFactoryForNullResolver), net_log);
+ make_scoped_ptr(new ProxyResolverFactoryForNullResolver), net_log));
}
// static
-ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
+scoped_ptr<ProxyService> ProxyService::CreateFixed(const ProxyConfig& pc) {
// TODO(eroman): This isn't quite right, won't work if |pc| specifies
// a PAC script.
return CreateUsingSystemProxyResolver(new ProxyConfigServiceFixed(pc),
@@ -973,36 +973,35 @@ ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
}
// static
-ProxyService* ProxyService::CreateFixed(const std::string& proxy) {
+scoped_ptr<ProxyService> ProxyService::CreateFixed(const std::string& proxy) {
ProxyConfig proxy_config;
proxy_config.proxy_rules().ParseFromString(proxy);
return ProxyService::CreateFixed(proxy_config);
}
// static
-ProxyService* ProxyService::CreateDirect() {
+scoped_ptr<ProxyService> ProxyService::CreateDirect() {
return CreateDirectWithNetLog(NULL);
}
-ProxyService* ProxyService::CreateDirectWithNetLog(NetLog* net_log) {
+scoped_ptr<ProxyService> ProxyService::CreateDirectWithNetLog(NetLog* net_log) {
// Use direct connections.
- return new ProxyService(
+ return make_scoped_ptr(new ProxyService(
new ProxyConfigServiceDirect,
- make_scoped_ptr(new ProxyResolverFactoryForNullResolver), net_log);
+ make_scoped_ptr(new ProxyResolverFactoryForNullResolver), net_log));
}
// static
-ProxyService* ProxyService::CreateFixedFromPacResult(
+scoped_ptr<ProxyService> ProxyService::CreateFixedFromPacResult(
const std::string& pac_string) {
-
// We need the settings to contain an "automatic" setting, otherwise the
// ProxyResolver dependency we give it will never be used.
scoped_ptr<ProxyConfigService> proxy_config_service(
new ProxyConfigServiceFixed(ProxyConfig::CreateAutoDetect()));
- return new ProxyService(
+ return make_scoped_ptr(new ProxyService(
proxy_config_service.release(),
- make_scoped_ptr(new ProxyResolverFactoryForPacResult(pac_string)), NULL);
+ make_scoped_ptr(new ProxyResolverFactoryForPacResult(pac_string)), NULL));
}
int ProxyService::ResolveProxy(const GURL& raw_url,
« no previous file with comments | « net/proxy/proxy_service.h ('k') | net/proxy/proxy_service_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698