OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/net_util.h" | 9 #include "net/base/net_util.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 MappedHostResolver::MappedHostResolver(HostResolver* impl) | 13 MappedHostResolver::MappedHostResolver(HostResolver* impl) |
14 : impl_(impl) { | 14 : impl_(impl) { |
15 } | 15 } |
16 | 16 |
17 int MappedHostResolver::Resolve(const RequestInfo& info, | 17 int MappedHostResolver::Resolve(const RequestInfo& info, |
18 AddressList* addresses, | 18 AddressList* addresses, |
19 CompletionCallback* callback, | 19 CompletionCallback* callback, |
20 RequestHandle* out_req, | 20 RequestHandle* out_req, |
21 LoadLog* load_log) { | 21 const BoundNetLog& net_log) { |
22 // Modify the request before forwarding it to |impl_|. | 22 // Modify the request before forwarding it to |impl_|. |
23 RequestInfo modified_info = info; | 23 RequestInfo modified_info = info; |
24 RewriteRequest(&modified_info); | 24 RewriteRequest(&modified_info); |
25 return impl_->Resolve(modified_info, addresses, callback, out_req, load_log); | 25 return impl_->Resolve(modified_info, addresses, callback, out_req, net_log); |
26 } | 26 } |
27 | 27 |
28 void MappedHostResolver::CancelRequest(RequestHandle req) { | 28 void MappedHostResolver::CancelRequest(RequestHandle req) { |
29 impl_->CancelRequest(req); | 29 impl_->CancelRequest(req); |
30 } | 30 } |
31 | 31 |
32 void MappedHostResolver::AddObserver(Observer* observer) { | 32 void MappedHostResolver::AddObserver(Observer* observer) { |
33 impl_->AddObserver(observer); | 33 impl_->AddObserver(observer); |
34 } | 34 } |
35 | 35 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 map_rules_.clear(); | 106 map_rules_.clear(); |
107 | 107 |
108 StringTokenizer rules(rules_string, ","); | 108 StringTokenizer rules(rules_string, ","); |
109 while (rules.GetNext()) { | 109 while (rules.GetNext()) { |
110 bool ok = AddRuleFromString(rules.token()); | 110 bool ok = AddRuleFromString(rules.token()); |
111 LOG_IF(ERROR, !ok) << "Failed parsing rule: " << rules.token(); | 111 LOG_IF(ERROR, !ok) << "Failed parsing rule: " << rules.token(); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 } // namespace net | 115 } // namespace net |
OLD | NEW |