1 // Copyright (c) 2012 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.
5 #include "net/url_request/url_request_error_job.h"
8 #include "base/compiler_specific.h"
9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h"
12 #include "net/base/net_errors.h"
13 #include "net/url_request/url_request_status.h"
17 URLRequestErrorJob::URLRequestErrorJob(
18 URLRequest
* request
, NetworkDelegate
* network_delegate
, int error
)
19 : URLRequestJob(request
, network_delegate
),
21 weak_factory_(this) {}
23 URLRequestErrorJob::~URLRequestErrorJob() {}
25 void URLRequestErrorJob::Start() {
26 base::ThreadTaskRunnerHandle::Get()->PostTask(
28 base::Bind(&URLRequestErrorJob::StartAsync
, weak_factory_
.GetWeakPtr()));
31 void URLRequestErrorJob::StartAsync() {
32 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED
, error_
));