| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string16.h" | 11 #include "base/string16.h" |
| 12 #include "base/task.h" | 12 #include "base/task.h" |
| 13 #include "net/base/auth.h" | 13 #include "net/base/auth.h" |
| 14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 15 #include "net/ftp/ftp_request_info.h" | 15 #include "net/ftp/ftp_request_info.h" |
| 16 #include "net/ftp/ftp_transaction.h" | 16 #include "net/ftp/ftp_transaction.h" |
| 17 #include "net/url_request/url_request_job.h" | 17 #include "net/url_request/url_request_job.h" |
| 18 | 18 |
| 19 class URLRequestContext; | 19 class URLRequestContext; |
| 20 | 20 |
| 21 // A URLRequestJob subclass that is built on top of FtpTransaction. It | 21 // A net::URLRequestJob subclass that is built on top of FtpTransaction. It |
| 22 // provides an implementation for FTP. | 22 // provides an implementation for FTP. |
| 23 class URLRequestFtpJob : public URLRequestJob { | 23 class URLRequestFtpJob : public net::URLRequestJob { |
| 24 public: | 24 public: |
| 25 | 25 |
| 26 explicit URLRequestFtpJob(net::URLRequest* request); | 26 explicit URLRequestFtpJob(net::URLRequest* request); |
| 27 | 27 |
| 28 static URLRequestJob* Factory(net::URLRequest* request, | 28 static net::URLRequestJob* Factory(net::URLRequest* request, |
| 29 const std::string& scheme); | 29 const std::string& scheme); |
| 30 | 30 |
| 31 // URLRequestJob methods: | 31 // net::URLRequestJob methods: |
| 32 virtual bool GetMimeType(std::string* mime_type) const; | 32 virtual bool GetMimeType(std::string* mime_type) const; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 virtual ~URLRequestFtpJob(); | 35 virtual ~URLRequestFtpJob(); |
| 36 | 36 |
| 37 // URLRequestJob methods: | 37 // net::URLRequestJob methods: |
| 38 virtual void Start(); | 38 virtual void Start(); |
| 39 virtual void Kill(); | 39 virtual void Kill(); |
| 40 virtual net::LoadState GetLoadState() const; | 40 virtual net::LoadState GetLoadState() const; |
| 41 virtual bool NeedsAuth(); | 41 virtual bool NeedsAuth(); |
| 42 virtual void GetAuthChallengeInfo( | 42 virtual void GetAuthChallengeInfo( |
| 43 scoped_refptr<net::AuthChallengeInfo>* auth_info); | 43 scoped_refptr<net::AuthChallengeInfo>* auth_info); |
| 44 virtual void SetAuth(const string16& username, | 44 virtual void SetAuth(const string16& username, |
| 45 const string16& password); | 45 const string16& password); |
| 46 virtual void CancelAuth(); | 46 virtual void CancelAuth(); |
| 47 | 47 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 71 // Keep a reference to the url request context to be sure it's not deleted | 71 // Keep a reference to the url request context to be sure it's not deleted |
| 72 // before us. | 72 // before us. |
| 73 scoped_refptr<URLRequestContext> context_; | 73 scoped_refptr<URLRequestContext> context_; |
| 74 | 74 |
| 75 ScopedRunnableMethodFactory<URLRequestFtpJob> method_factory_; | 75 ScopedRunnableMethodFactory<URLRequestFtpJob> method_factory_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); | 77 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 80 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| OLD | NEW |