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

Side by Side Diff: net/base/mapped_host_resolver.cc

Issue 8549004: base::Bind: Convert HostResolver::Resolve. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/mapped_host_resolver.h" 5 #include "net/base/mapped_host_resolver.h"
6 6
7 #include "base/string_tokenizer.h" 7 #include "base/string_tokenizer.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/base/host_port_pair.h" 9 #include "net/base/host_port_pair.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/base/net_util.h" 11 #include "net/base/net_util.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 MappedHostResolver::MappedHostResolver(HostResolver* impl) 15 MappedHostResolver::MappedHostResolver(HostResolver* impl)
16 : impl_(impl) { 16 : impl_(impl) {
17 } 17 }
18 18
19 MappedHostResolver::~MappedHostResolver() { 19 MappedHostResolver::~MappedHostResolver() {
20 } 20 }
21 21
22 int MappedHostResolver::Resolve(const RequestInfo& info, 22 int MappedHostResolver::Resolve(const RequestInfo& info,
23 AddressList* addresses, 23 AddressList* addresses,
24 OldCompletionCallback* callback, 24 const CompletionCallback& callback,
25 RequestHandle* out_req, 25 RequestHandle* out_req,
26 const BoundNetLog& net_log) { 26 const BoundNetLog& net_log) {
27 DCHECK(addresses); 27 DCHECK(addresses);
28 DCHECK(callback); 28 DCHECK_EQ(false, callback.is_null());
willchan no longer on Chromium 2011/11/14 16:45:12 I'm going to stop nitting this pattern now. Just p
29 // Modify the request before forwarding it to |impl_|. 29 // Modify the request before forwarding it to |impl_|.
30 RequestInfo modified_info = info; 30 RequestInfo modified_info = info;
31 HostPortPair host_port(info.host_port_pair()); 31 HostPortPair host_port(info.host_port_pair());
32 if (rules_.RewriteHost(&host_port)) 32 if (rules_.RewriteHost(&host_port))
33 modified_info.set_host_port_pair(host_port); 33 modified_info.set_host_port_pair(host_port);
34 return impl_->Resolve(modified_info, addresses, callback, out_req, net_log); 34 return impl_->Resolve(modified_info, addresses, callback, out_req, net_log);
35 } 35 }
36 36
37 int MappedHostResolver::ResolveFromCache(const RequestInfo& info, 37 int MappedHostResolver::ResolveFromCache(const RequestInfo& info,
38 AddressList* addresses, 38 AddressList* addresses,
(...skipping 16 matching lines...) Expand all
55 55
56 void MappedHostResolver::ProbeIPv6Support() { 56 void MappedHostResolver::ProbeIPv6Support() {
57 impl_->ProbeIPv6Support(); 57 impl_->ProbeIPv6Support();
58 } 58 }
59 59
60 HostCache* MappedHostResolver::GetHostCache() { 60 HostCache* MappedHostResolver::GetHostCache() {
61 return impl_->GetHostCache(); 61 return impl_->GetHostCache();
62 } 62 }
63 63
64 } // namespace net 64 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698