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

Unified Diff: net/proxy/dhcp_proxy_script_fetcher_factory.cc

Issue 1273013004: Returning scoped_ptr<> instead of raw pointer in DhcpProxyScriptFetcherFactory::Create (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
Index: net/proxy/dhcp_proxy_script_fetcher_factory.cc
diff --git a/net/proxy/dhcp_proxy_script_fetcher_factory.cc b/net/proxy/dhcp_proxy_script_fetcher_factory.cc
index 01ede05b0934b78db1968915e4233b796898a462..43d037684418c6dc31b1d26d7f272a14c562732b 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_factory.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_factory.cc
@@ -18,18 +18,19 @@ DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory()
set_enabled(true);
}
-DhcpProxyScriptFetcher* DhcpProxyScriptFetcherFactory::Create(
+scoped_ptr<DhcpProxyScriptFetcher> DhcpProxyScriptFetcherFactory::Create(
URLRequestContext* context) {
if (!feature_enabled_) {
- return new DoNothingDhcpProxyScriptFetcher();
+ return scoped_ptr<DhcpProxyScriptFetcher>(
eroman 2015/08/21 20:03:12 I suggest using "make_scoped_ptr(new DoNothingDhcp
+ new DoNothingDhcpProxyScriptFetcher());
} else {
DCHECK(IsSupported());
- DhcpProxyScriptFetcher* ret = NULL;
+ scoped_ptr<DhcpProxyScriptFetcher> ret(nullptr);
eroman 2015/08/21 20:03:12 remove "nullptr". It certainly isn't wrong, howeve
#if defined(OS_WIN)
- ret = new DhcpProxyScriptFetcherWin(context);
+ ret.reset(new DhcpProxyScriptFetcherWin(context));
#endif
DCHECK(ret);
- return ret;
+ return ret.Pass();
}
}

Powered by Google App Engine
This is Rietveld 408576698