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

Side by Side Diff: net/url_request/url_request_ftp_job.h

Issue 10537056: Replaced static URLRequestFtpJob factory with non-static protocol handler for FTP jobs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed ftp_auth_cache Created 8 years, 5 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
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 #ifndef NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "net/base/auth.h" 12 #include "net/base/auth.h"
13 #include "net/base/completion_callback.h" 13 #include "net/base/completion_callback.h"
14 #include "net/ftp/ftp_request_info.h" 14 #include "net/ftp/ftp_request_info.h"
15 #include "net/ftp/ftp_transaction.h" 15 #include "net/ftp/ftp_transaction.h"
16 #include "net/url_request/url_request_job.h" 16 #include "net/url_request/url_request_job.h"
17 17
18 namespace net { 18 namespace net {
19 19
20 class URLRequestContext; 20 class NetworkDelegate;
21 class FtpTransactionFactory;
22 class FtpAuthCache;
21 23
22 // A URLRequestJob subclass that is built on top of FtpTransaction. It 24 // A URLRequestJob subclass that is built on top of FtpTransaction. It
23 // provides an implementation for FTP. 25 // provides an implementation for FTP.
24 class URLRequestFtpJob : public URLRequestJob { 26 class URLRequestFtpJob : public URLRequestJob {
25 public: 27 public:
26 explicit URLRequestFtpJob(URLRequest* request); 28 URLRequestFtpJob(URLRequest* request,
29 NetworkDelegate* network_delegate,
30 FtpTransactionFactory* ftp_transaction_factory,
31 FtpAuthCache* ftp_auth_cache);
27 32
33 // TODO(shalev): get rid of this function in favor of FtpProtocolHandler.
28 static URLRequestJob* Factory(URLRequest* request, 34 static URLRequestJob* Factory(URLRequest* request,
29 const std::string& scheme); 35 const std::string& scheme);
30 36
31 // Overridden from URLRequestJob: 37 // Overridden from URLRequestJob:
32 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; 38 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
33 virtual HostPortPair GetSocketAddress() const OVERRIDE; 39 virtual HostPortPair GetSocketAddress() const OVERRIDE;
34 40
35 private: 41 private:
36 virtual ~URLRequestFtpJob(); 42 virtual ~URLRequestFtpJob();
37 43
(...skipping 24 matching lines...) Expand all
62 68
63 FtpRequestInfo request_info_; 69 FtpRequestInfo request_info_;
64 scoped_ptr<FtpTransaction> transaction_; 70 scoped_ptr<FtpTransaction> transaction_;
65 71
66 bool read_in_progress_; 72 bool read_in_progress_;
67 73
68 scoped_refptr<AuthData> server_auth_; 74 scoped_refptr<AuthData> server_auth_;
69 75
70 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; 76 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_;
71 77
78 FtpTransactionFactory* ftp_transaction_factory_;
79 FtpAuthCache* ftp_auth_cache_;
80
72 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); 81 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob);
73 }; 82 };
74 83
75 } // namespace net 84 } // namespace net
76 85
77 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ 86 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698