Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: content/test/net/url_request_failed_dns_job.cc

Issue 9704023: Replace URLRequestFailedDnsJob with URLRequestFailedJob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix weak ptr factory usage Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/net/url_request_failed_dns_job.h ('k') | content/test/net/url_request_failed_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/net/url_request_failed_dns_job.cc
===================================================================
--- content/test/net/url_request_failed_dns_job.cc (revision 126973)
+++ 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));
-}
« no previous file with comments | « content/test/net/url_request_failed_dns_job.h ('k') | content/test/net/url_request_failed_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698