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

Side by Side Diff: net/url_request/url_request_error_job.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_error_job.h ('k') | net/url_request/url_request_file_dir_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_error_job.h" 5 #include "net/url_request/url_request_error_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_context.h"
13 #include "net/url_request/url_request_status.h" 11 #include "net/url_request/url_request_status.h"
14 12
15 namespace net { 13 namespace net {
16 14
17 URLRequestErrorJob::URLRequestErrorJob(URLRequest* request, int error) 15 URLRequestErrorJob::URLRequestErrorJob(
18 : URLRequestJob(request, request->context()->network_delegate()), 16 URLRequest* request, NetworkDelegate* network_delegate, int error)
17 : URLRequestJob(request, network_delegate),
19 error_(error), 18 error_(error),
20 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {} 19 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {}
21 20
22 URLRequestErrorJob::~URLRequestErrorJob() {} 21 URLRequestErrorJob::~URLRequestErrorJob() {}
23 22
24 void URLRequestErrorJob::Start() { 23 void URLRequestErrorJob::Start() {
25 MessageLoop::current()->PostTask( 24 MessageLoop::current()->PostTask(
26 FROM_HERE, 25 FROM_HERE,
27 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr())); 26 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr()));
28 } 27 }
29 28
30 void URLRequestErrorJob::StartAsync() { 29 void URLRequestErrorJob::StartAsync() {
31 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_)); 30 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_));
32 } 31 }
33 32
34 } // namespace net 33 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_error_job.h ('k') | net/url_request/url_request_file_dir_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698