| OLD | NEW |
| 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/mock_host_resolver.h" | 5 #include "net/dns/mock_host_resolver.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 r->replacement.empty() ? host : r->replacement; | 362 r->replacement.empty() ? host : r->replacement; |
| 363 | 363 |
| 364 // Apply the resolving function to the remapped hostname. | 364 // Apply the resolving function to the remapped hostname. |
| 365 switch (r->resolver_type) { | 365 switch (r->resolver_type) { |
| 366 case Rule::kResolverTypeFail: | 366 case Rule::kResolverTypeFail: |
| 367 return ERR_NAME_NOT_RESOLVED; | 367 return ERR_NAME_NOT_RESOLVED; |
| 368 case Rule::kResolverTypeSystem: | 368 case Rule::kResolverTypeSystem: |
| 369 #if defined(OS_WIN) | 369 #if defined(OS_WIN) |
| 370 net::EnsureWinsockInit(); | 370 net::EnsureWinsockInit(); |
| 371 #endif | 371 #endif |
| 372 return SystemHostResolverProc(effective_host, | 372 return SystemHostResolverCall(effective_host, |
| 373 address_family, | 373 address_family, |
| 374 host_resolver_flags, | 374 host_resolver_flags, |
| 375 addrlist, os_error); | 375 addrlist, os_error); |
| 376 case Rule::kResolverTypeIPLiteral: | 376 case Rule::kResolverTypeIPLiteral: |
| 377 return ParseAddressList(effective_host, | 377 return ParseAddressList(effective_host, |
| 378 r->canonical_name, | 378 r->canonical_name, |
| 379 addrlist); | 379 addrlist); |
| 380 default: | 380 default: |
| 381 NOTREACHED(); | 381 NOTREACHED(); |
| 382 return ERR_UNEXPECTED; | 382 return ERR_UNEXPECTED; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 CHECK_EQ(old_proc, current_proc_); | 429 CHECK_EQ(old_proc, current_proc_); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { | 432 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { |
| 433 current_proc_ = proc; | 433 current_proc_ = proc; |
| 434 previous_proc_ = HostResolverProc::SetDefault(current_proc_); | 434 previous_proc_ = HostResolverProc::SetDefault(current_proc_); |
| 435 current_proc_->SetLastProc(previous_proc_); | 435 current_proc_->SetLastProc(previous_proc_); |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace net | 438 } // namespace net |
| OLD | NEW |