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

Unified Diff: net/proxy/proxy_service.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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_script_fetcher_impl_unittest.cc ('k') | net/proxy/proxy_service_mojo.cc » ('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 5ed56d1fec306ef09de4666d43f47288f9be08f8..323edf1173e38ac8c049ee3f2223e98d172ac95c 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -236,9 +236,9 @@ class ProxyResolverFactoryForSystem : public MultiThreadedProxyResolverFactory {
std::unique_ptr<ProxyResolverFactory> CreateProxyResolverFactory() override {
#if defined(OS_WIN)
- return base::WrapUnique(new ProxyResolverFactoryWinHttp());
+ return base::MakeUnique<ProxyResolverFactoryWinHttp>();
#elif defined(OS_MACOSX)
- return base::WrapUnique(new ProxyResolverFactoryMac());
+ return base::MakeUnique<ProxyResolverFactoryMac>();
#else
NOTREACHED();
return NULL;
@@ -978,7 +978,7 @@ std::unique_ptr<ProxyService> ProxyService::CreateUsingSystemProxyResolver(
return base::WrapUnique(new ProxyService(
std::move(proxy_config_service),
- base::WrapUnique(new ProxyResolverFactoryForSystem(num_pac_threads)),
+ base::MakeUnique<ProxyResolverFactoryForSystem>(num_pac_threads),
net_log));
}
@@ -996,7 +996,7 @@ std::unique_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(
- base::WrapUnique(new ProxyConfigServiceFixed(pc)), 0, NULL);
+ base::MakeUnique<ProxyConfigServiceFixed>(pc), 0, NULL);
}
// static
@@ -1030,8 +1030,7 @@ std::unique_ptr<ProxyService> ProxyService::CreateFixedFromPacResult(
return base::WrapUnique(new ProxyService(
std::move(proxy_config_service),
- base::WrapUnique(new ProxyResolverFactoryForPacResult(pac_string)),
- NULL));
+ base::MakeUnique<ProxyResolverFactoryForPacResult>(pac_string), NULL));
}
int ProxyService::ResolveProxy(const GURL& raw_url,
@@ -1524,11 +1523,11 @@ ProxyService::CreateSystemProxyConfigService(
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner) {
#if defined(OS_WIN)
- return base::WrapUnique(new ProxyConfigServiceWin());
+ return base::MakeUnique<ProxyConfigServiceWin>();
#elif defined(OS_IOS)
- return base::WrapUnique(new ProxyConfigServiceIOS());
+ return base::MakeUnique<ProxyConfigServiceIOS>();
#elif defined(OS_MACOSX)
- return base::WrapUnique(new ProxyConfigServiceMac(io_task_runner));
+ return base::MakeUnique<ProxyConfigServiceMac>(io_task_runner);
#elif defined(OS_CHROMEOS)
LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in "
<< "profile_io_data.cc::CreateProxyConfigService and this should "
@@ -1553,12 +1552,12 @@ ProxyService::CreateSystemProxyConfigService(
return std::move(linux_config_service);
#elif defined(OS_ANDROID)
- return base::WrapUnique(new ProxyConfigServiceAndroid(
- io_task_runner, base::ThreadTaskRunnerHandle::Get()));
+ return base::MakeUnique<ProxyConfigServiceAndroid>(
+ io_task_runner, base::ThreadTaskRunnerHandle::Get());
#else
LOG(WARNING) << "Failed to choose a system proxy settings fetcher "
"for this platform.";
- return base::WrapUnique(new ProxyConfigServiceDirect());
+ return base::MakeUnique<ProxyConfigServiceDirect>();
#endif
}
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/proxy/proxy_service_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698