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

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: NetworkDelegate fixed almost everywhere 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
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" 11 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_context.h" 12 #include "net/url_request/url_request_context.h"
mmenke 2012/08/21 15:28:49 Don't think these two are needed.
shalev 2012/08/22 20:34:10 Done.
13 #include "net/url_request/url_request_status.h" 13 #include "net/url_request/url_request_status.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 URLRequestErrorJob::URLRequestErrorJob(URLRequest* request, int error) 17 URLRequestErrorJob::URLRequestErrorJob(
18 : URLRequestJob(request, request->context()->network_delegate()), 18 URLRequest* request, NetworkDelegate* network_delegate, int error)
19 : URLRequestJob(request, network_delegate),
19 error_(error), 20 error_(error),
20 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {} 21 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {}
21 22
22 URLRequestErrorJob::~URLRequestErrorJob() {} 23 URLRequestErrorJob::~URLRequestErrorJob() {}
23 24
24 void URLRequestErrorJob::Start() { 25 void URLRequestErrorJob::Start() {
25 MessageLoop::current()->PostTask( 26 MessageLoop::current()->PostTask(
26 FROM_HERE, 27 FROM_HERE,
27 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr())); 28 base::Bind(&URLRequestErrorJob::StartAsync, weak_factory_.GetWeakPtr()));
28 } 29 }
29 30
30 void URLRequestErrorJob::StartAsync() { 31 void URLRequestErrorJob::StartAsync() {
31 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_)); 32 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error_));
32 } 33 }
33 34
34 } // namespace net 35 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698