| Index: content/test/net/url_request_failed_dns_job.cc
|
| ===================================================================
|
| --- content/test/net/url_request_failed_dns_job.cc (revision 126703)
|
| +++ content/test/net/url_request_failed_dns_job.cc (working copy)
|
| @@ -1,47 +0,0 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "content/test/net/url_request_failed_dns_job.h"
|
| -
|
| -#include "base/bind.h"
|
| -#include "base/compiler_specific.h"
|
| -#include "base/message_loop.h"
|
| -#include "googleurl/src/gurl.h"
|
| -#include "net/base/net_errors.h"
|
| -#include "net/url_request/url_request.h"
|
| -#include "net/url_request/url_request_filter.h"
|
| -
|
| -const char URLRequestFailedDnsJob::kTestUrl[] =
|
| - "http://url.handled.by.fake.dns/";
|
| -
|
| -URLRequestFailedDnsJob::URLRequestFailedDnsJob(net::URLRequest* request)
|
| - : net::URLRequestJob(request),
|
| - ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {}
|
| -
|
| -URLRequestFailedDnsJob::~URLRequestFailedDnsJob() {}
|
| -
|
| -void URLRequestFailedDnsJob::Start() {
|
| - MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&URLRequestFailedDnsJob::StartAsync,
|
| - weak_factory_.GetWeakPtr()));
|
| -}
|
| -
|
| -// static
|
| -void URLRequestFailedDnsJob::AddUrlHandler() {
|
| - net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
|
| - filter->AddUrlHandler(GURL(kTestUrl),
|
| - &URLRequestFailedDnsJob::Factory);
|
| -}
|
| -
|
| -/*static */
|
| -net::URLRequestJob* URLRequestFailedDnsJob::Factory(net::URLRequest* request,
|
| - const std::string& scheme) {
|
| - return new URLRequestFailedDnsJob(request);
|
| -}
|
| -
|
| -void URLRequestFailedDnsJob::StartAsync() {
|
| - NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED,
|
| - net::ERR_NAME_NOT_RESOLVED));
|
| -}
|
|
|