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

Unified Diff: net/dns/dns_config_service_win.cc

Issue 169193002: Convert scoped_ptr_malloc -> scoped_ptr, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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/dns/dns_config_service_win.h ('k') | net/dns/dns_config_service_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_config_service_win.cc
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index 64b912db367cb4a958eec2e163cf52b8a35e0170..dcc91810d860d355339eb94e9128843ab44ab75d 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -113,16 +113,16 @@ class RegistryReader : public base::NonThreadSafe {
};
// Wrapper for GetAdaptersAddresses. Returns NULL if failed.
-scoped_ptr_malloc<IP_ADAPTER_ADDRESSES> ReadIpHelper(ULONG flags) {
+scoped_ptr<IP_ADAPTER_ADDRESSES, base::FreeDeleter> ReadIpHelper(ULONG flags) {
base::ThreadRestrictions::AssertIOAllowed();
- scoped_ptr_malloc<IP_ADAPTER_ADDRESSES> out;
+ scoped_ptr<IP_ADAPTER_ADDRESSES, base::FreeDeleter> out;
ULONG len = 15000; // As recommended by MSDN for GetAdaptersAddresses.
UINT rv = ERROR_BUFFER_OVERFLOW;
// Try up to three times.
for (unsigned tries = 0; (tries < 3) && (rv == ERROR_BUFFER_OVERFLOW);
tries++) {
- out.reset(reinterpret_cast<PIP_ADAPTER_ADDRESSES>(malloc(len)));
+ out.reset(static_cast<PIP_ADAPTER_ADDRESSES>(malloc(len)));
rv = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, out.get(), &len);
}
if (rv != NO_ERROR)
@@ -250,7 +250,7 @@ HostsParseWinResult AddLocalhostEntries(DnsHosts* hosts) {
if (have_ipv4 && have_ipv6)
return HOSTS_PARSE_WIN_OK;
- scoped_ptr_malloc<IP_ADAPTER_ADDRESSES> addresses =
+ scoped_ptr<IP_ADAPTER_ADDRESSES, base::FreeDeleter> addresses =
ReadIpHelper(GAA_FLAG_SKIP_ANYCAST |
GAA_FLAG_SKIP_DNS_SERVER |
GAA_FLAG_SKIP_MULTICAST |
« no previous file with comments | « net/dns/dns_config_service_win.h ('k') | net/dns/dns_config_service_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698