url_request_failed_dns_job.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
1// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4// This class simulates what wininet does when a dns lookup fails. 5 6#ifndef CHROME_BROWSER_NET_URL_REQUEST_FAILED_DNS_JOB_H_ 7#define CHROME_BROWSER_NET_URL_REQUEST_FAILED_DNS_JOB_H_ 8 9#include "net/url_request/url_request_job.h" 10 11class URLRequestFailedDnsJob : public URLRequestJob { 12 public: 13 explicit URLRequestFailedDnsJob(URLRequest* request) 14 : URLRequestJob(request) { } 15 16 virtual void Start(); 17 18 static URLRequestJob* Factory(URLRequest* request, 19 const std::string& scheme); 20 21 // A test URL that can be used in UI tests. 22 static const char kTestUrl[]; 23 24 // Adds the testing URLs to the URLRequestFilter. 25 static void AddUrlHandler(); 26 27 private: 28 ~URLRequestFailedDnsJob() {} 29 30 // Simulate a DNS failure. 31 void StartAsync(); 32}; 33 34#endif // CHROME_BROWSER_NET_URL_REQUEST_FAILED_DNS_JOB_H_ 35