AddRule(hostname, ADDRESS_FAMILY_IPV6, result);
}
- virtual int Resolve(const std::string& hostname,
- AddressFamily address_family,
- HostResolverFlags host_resolver_flags,
- AddressList* addrlist,
- int* os_error) OVERRIDE {
+ int Resolve(const std::string& hostname,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addrlist,
+ int* os_error) override {
base::AutoLock lock(lock_);
capture_list_.push_back(ResolveKey(hostname, address_family));
++num_requests_waiting_;
}
protected:
- virtual ~MockHostResolverProc() {}
+ ~MockHostResolverProc() override {}
private:
mutable base::Lock lock_;
int resolved_attempt_number() { return resolved_attempt_number_; }
// HostResolverProc methods.
- virtual int Resolve(const std::string& host,
- AddressFamily address_family,
- HostResolverFlags host_resolver_flags,
- AddressList* addrlist,
- int* os_error) OVERRIDE {
+ int Resolve(const std::string& host,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addrlist,
+ int* os_error) override {
bool wait_for_right_attempt_to_complete = true;
{
base::AutoLock auto_lock(lock_);
}
protected:
- virtual ~LookupAttemptHostResolverProc() {}
+ ~LookupAttemptHostResolverProc() override {}
private:
int attempt_number_to_resolve_;
protected:
// A Request::Handler which is a proxy to the HostResolverImplTest fixture.
struct Handler : public Request::Handler {
- virtual ~Handler() {}
+ ~Handler() override {}
// Proxy functions so that classes derived from Handler can access them.
Request* CreateRequest(const HostResolver::RequestInfo& info,
};
// testing::Test implementation:
- virtual void SetUp() OVERRIDE {
- CreateResolver();
- }
+ void SetUp() override { CreateResolver(); }
- virtual void TearDown() OVERRIDE {
+ void TearDown() override {
if (resolver_.get())
EXPECT_EQ(0u, resolver_->num_running_dispatcher_jobs_for_tests());
EXPECT_FALSE(proc_->HasBlockedRequests());
TEST_F(HostResolverImplTest, CancelWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ void Handle(Request* req) override {
// Port 80 is the first request that the callback will be invoked for.
// While we are executing within that callback, cancel the other requests
// in the job and start another request.
TEST_F(HostResolverImplTest, DeleteWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ void Handle(Request* req) override {
EXPECT_EQ("a", req->info().hostname());
EXPECT_EQ(80, req->info().port());
TEST_F(HostResolverImplTest, DeleteWithinAbortedCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ void Handle(Request* req) override {
EXPECT_EQ("a", req->info().hostname());
EXPECT_EQ(80, req->info().port());
TEST_F(HostResolverImplTest, StartWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ void Handle(Request* req) override {
if (req->index() == 0) {
// On completing the first request, start another request for "a".
// Since caching is disabled, this will result in another async request.
TEST_F(HostResolverImplTest, BypassCache) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ void Handle(Request* req) override {
if (req->index() == 0) {
// On completing the first request, start another request for "a".
// Since caching is enabled, this should complete synchronously.
// will not be aborted.
TEST_F(HostResolverImplTest, AbortOnlyExistingRequestsOnIPAddressChange) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ void Handle(Request* req) override {
// Start new request for a different hostname to ensure that the order
// of jobs in HostResolverImpl is not stable.
std::string hostname;
protected:
// testing::Test implementation:
- virtual void SetUp() OVERRIDE {
+ void SetUp() override {
AddDnsRule("nx", dns_protocol::kTypeA, MockDnsClientRule::FAIL, false);
AddDnsRule("nx", dns_protocol::kTypeAAAA, MockDnsClientRule::FAIL, false);
AddDnsRule("ok", dns_protocol::kTypeA, MockDnsClientRule::OK, false);
}
// HostResolverImplTest implementation:
- virtual void CreateResolverWithLimitsAndParams(
+ void CreateResolverWithLimitsAndParams(
size_t max_concurrent_resolves,
- const HostResolverImpl::ProcTaskParams& params) OVERRIDE {
+ const HostResolverImpl::ProcTaskParams& params) override {
HostResolverImpl::Options options = DefaultOptions();
options.max_concurrent_resolves = max_concurrent_resolves;
resolver_.reset(new HostResolverImpl(options, NULL));