diff options
Diffstat (limited to 'net/base/mock_host_resolver.cc')
-rw-r--r-- | net/base/mock_host_resolver.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index a70c6aa..9c82f93 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -50,6 +50,8 @@ MockHostResolverBase::MockHostResolverBase(bool use_caching) Reset(NULL); } +MockHostResolverBase::~MockHostResolverBase() {} + int MockHostResolverBase::Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, @@ -258,6 +260,29 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, //----------------------------------------------------------------------------- +WaitingHostResolverProc::WaitingHostResolverProc(HostResolverProc* previous) + : HostResolverProc(previous), event_(false, false) {} + +void WaitingHostResolverProc::Signal() { + event_.Signal(); +} + +int WaitingHostResolverProc::Resolve(const std::string& host, + AddressFamily address_family, + HostResolverFlags host_resolver_flags, + AddressList* addrlist, + int* os_error) { + event_.Wait(); + return ResolveUsingPrevious(host, address_family, host_resolver_flags, + addrlist, os_error); +} + +WaitingHostResolverProc::~WaitingHostResolverProc() {} + +//----------------------------------------------------------------------------- + +ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc() {} + ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc( HostResolverProc* proc) { Init(proc); |