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

Side by Side Diff: net/dns/host_resolver_impl.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 unified diff | Download patch
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/dns/host_resolver_impl.h" 5 #include "net/dns/host_resolver_impl.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Winsock2.h> 8 #include <Winsock2.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <netdb.h> 10 #include <netdb.h>
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 2123
2124 std::unique_ptr<base::Value> HostResolverImpl::GetDnsConfigAsValue() const { 2124 std::unique_ptr<base::Value> HostResolverImpl::GetDnsConfigAsValue() const {
2125 // Check if async DNS is disabled. 2125 // Check if async DNS is disabled.
2126 if (!dns_client_.get()) 2126 if (!dns_client_.get())
2127 return nullptr; 2127 return nullptr;
2128 2128
2129 // Check if async DNS is enabled, but we currently have no configuration 2129 // Check if async DNS is enabled, but we currently have no configuration
2130 // for it. 2130 // for it.
2131 const DnsConfig* dns_config = dns_client_->GetConfig(); 2131 const DnsConfig* dns_config = dns_client_->GetConfig();
2132 if (!dns_config) 2132 if (!dns_config)
2133 return base::WrapUnique(new base::DictionaryValue()); 2133 return base::MakeUnique<base::DictionaryValue>();
2134 2134
2135 return dns_config->ToValue(); 2135 return dns_config->ToValue();
2136 } 2136 }
2137 2137
2138 int HostResolverImpl::ResolveStaleFromCache( 2138 int HostResolverImpl::ResolveStaleFromCache(
2139 const RequestInfo& info, 2139 const RequestInfo& info,
2140 AddressList* addresses, 2140 AddressList* addresses,
2141 HostCache::EntryStaleness* stale_info, 2141 HostCache::EntryStaleness* stale_info,
2142 const BoundNetLog& source_net_log) { 2142 const BoundNetLog& source_net_log) {
2143 DCHECK(CalledOnValidThread()); 2143 DCHECK(CalledOnValidThread());
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 if (job_) 2606 if (job_)
2607 job_->CancelRequest(this); 2607 job_->CancelRequest(this);
2608 } 2608 }
2609 2609
2610 void HostResolverImpl::RequestImpl::ChangeRequestPriority( 2610 void HostResolverImpl::RequestImpl::ChangeRequestPriority(
2611 RequestPriority priority) { 2611 RequestPriority priority) {
2612 job_->ChangeRequestPriority(this, priority); 2612 job_->ChangeRequestPriority(this, priority);
2613 } 2613 }
2614 2614
2615 } // namespace net 2615 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698