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/test/test_server.h" | 5 #include "net/test/test_server.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 default: | 184 default: |
185 NOTREACHED(); | 185 NOTREACHED(); |
186 } | 186 } |
187 return std::string(); | 187 return std::string(); |
188 } | 188 } |
189 | 189 |
190 bool TestServer::GetAddressList(AddressList* address_list) const { | 190 bool TestServer::GetAddressList(AddressList* address_list) const { |
191 DCHECK(address_list); | 191 DCHECK(address_list); |
192 | 192 |
193 scoped_ptr<HostResolver> resolver( | 193 scoped_ptr<HostResolver> resolver( |
194 CreateSystemHostResolver(HostResolver::kDefaultParallelism, NULL, NULL)); | 194 CreateSystemHostResolver(HostResolver::kDefaultParallelism, NULL)); |
195 HostResolver::RequestInfo info(host_port_pair_); | 195 HostResolver::RequestInfo info(host_port_pair_); |
196 int rv = resolver->Resolve(info, address_list, NULL, NULL, BoundNetLog()); | 196 int rv = resolver->Resolve(info, address_list, NULL, NULL, BoundNetLog()); |
197 if (rv != net::OK) { | 197 if (rv != net::OK) { |
198 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host(); | 198 LOG(ERROR) << "Failed to resolve hostname: " << host_port_pair_.host(); |
199 return false; | 199 return false; |
200 } | 200 } |
201 return true; | 201 return true; |
202 } | 202 } |
203 | 203 |
204 GURL TestServer::GetURL(const std::string& path) { | 204 GURL TestServer::GetURL(const std::string& path) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 return certificates_dir_.AppendASCII("ok_cert.pem"); | 303 return certificates_dir_.AppendASCII("ok_cert.pem"); |
304 case TYPE_HTTPS_EXPIRED_CERTIFICATE: | 304 case TYPE_HTTPS_EXPIRED_CERTIFICATE: |
305 return certificates_dir_.AppendASCII("expired_cert.pem"); | 305 return certificates_dir_.AppendASCII("expired_cert.pem"); |
306 default: | 306 default: |
307 NOTREACHED(); | 307 NOTREACHED(); |
308 } | 308 } |
309 return FilePath(); | 309 return FilePath(); |
310 } | 310 } |
311 | 311 |
312 } // namespace net | 312 } // namespace net |
OLD | NEW |