Update V8 to version 4.6.55.
[chromium-blink-merge.git] / net / url_request / url_request_error_job.cc
blobefbf4247d3122c86ec88ee450f5f51a1a418c11b
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"
7 #include "base/bind.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"
15 namespace net {
17 URLRequestErrorJob::URLRequestErrorJob(
18 URLRequest* request, NetworkDelegate* network_delegate, int error)
19 : URLRequestJob(request, network_delegate),
20 error_(error),
21 weak_factory_(this) {}
23 URLRequestErrorJob::~URLRequestErrorJob() {}
25 void URLRequestErrorJob::Start() {
26 base::ThreadTaskRunnerHandle::Get()->PostTask(
27 FROM_HERE,
28 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr()));
31 void URLRequestErrorJob::StartAsync() {
32 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_));
35 } // namespace net