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/message_loop/message_loop.h"
10 #include "net/base/net_errors.h"
11 #include "net/url_request/url_request_status.h"
15 URLRequestErrorJob::URLRequestErrorJob(
16 URLRequest
* request
, NetworkDelegate
* network_delegate
, int error
)
17 : URLRequestJob(request
, network_delegate
),
19 weak_factory_(this) {}
21 URLRequestErrorJob::~URLRequestErrorJob() {}
23 void URLRequestErrorJob::Start() {
24 base::MessageLoop::current()->PostTask(
26 base::Bind(&URLRequestErrorJob::StartAsync
, weak_factory_
.GetWeakPtr()));
29 void URLRequestErrorJob::StartAsync() {
30 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED
, error_
));