Lots of random cleanups, mostly for native_theme_win.cc:
[chromium-blink-merge.git] / net / url_request / url_request_error_job.cc
blob0b2749bd93380b748c254b30fad193847bef9172
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/message_loop/message_loop.h"
10 #include "net/base/net_errors.h"
11 #include "net/url_request/url_request_status.h"
13 namespace net {
15 URLRequestErrorJob::URLRequestErrorJob(
16 URLRequest* request, NetworkDelegate* network_delegate, int error)
17 : URLRequestJob(request, network_delegate),
18 error_(error),
19 weak_factory_(this) {}
21 URLRequestErrorJob::~URLRequestErrorJob() {}
23 void URLRequestErrorJob::Start() {
24 base::MessageLoop::current()->PostTask(
25 FROM_HERE,
26 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr()));
29 void URLRequestErrorJob::StartAsync() {
30 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_));
33 } // namespace net