| OLD | NEW |
| 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 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "net/base/auth.h" | 13 #include "net/base/auth.h" |
| 13 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
| 14 #include "net/ftp/ftp_request_info.h" | 15 #include "net/ftp/ftp_request_info.h" |
| 15 #include "net/ftp/ftp_transaction.h" | 16 #include "net/ftp/ftp_transaction.h" |
| 16 #include "net/http/http_request_info.h" | 17 #include "net/http/http_request_info.h" |
| 17 #include "net/http/http_transaction.h" | 18 #include "net/http/http_transaction.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 bool GetMimeType(std::string* mime_type) const override; | 43 bool GetMimeType(std::string* mime_type) const override; |
| 43 void GetResponseInfo(HttpResponseInfo* info) override; | 44 void GetResponseInfo(HttpResponseInfo* info) override; |
| 44 HostPortPair GetSocketAddress() const override; | 45 HostPortPair GetSocketAddress() const override; |
| 45 void SetPriority(RequestPriority priority) override; | 46 void SetPriority(RequestPriority priority) override; |
| 46 void Start() override; | 47 void Start() override; |
| 47 void Kill() override; | 48 void Kill() override; |
| 48 | 49 |
| 49 RequestPriority priority() const { return priority_; } | 50 RequestPriority priority() const { return priority_; } |
| 50 | 51 |
| 51 private: | 52 private: |
| 53 class AuthData; |
| 54 |
| 52 void OnResolveProxyComplete(int result); | 55 void OnResolveProxyComplete(int result); |
| 53 | 56 |
| 54 void StartFtpTransaction(); | 57 void StartFtpTransaction(); |
| 55 void StartHttpTransaction(); | 58 void StartHttpTransaction(); |
| 56 | 59 |
| 57 void OnStartCompleted(int result); | 60 void OnStartCompleted(int result); |
| 58 void OnStartCompletedAsync(int result); | 61 void OnStartCompletedAsync(int result); |
| 59 void OnReadCompleted(int result); | 62 void OnReadCompleted(int result); |
| 60 | 63 |
| 61 void RestartTransactionWithAuth(); | 64 void RestartTransactionWithAuth(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 82 | 85 |
| 83 FtpRequestInfo ftp_request_info_; | 86 FtpRequestInfo ftp_request_info_; |
| 84 std::unique_ptr<FtpTransaction> ftp_transaction_; | 87 std::unique_ptr<FtpTransaction> ftp_transaction_; |
| 85 | 88 |
| 86 HttpRequestInfo http_request_info_; | 89 HttpRequestInfo http_request_info_; |
| 87 std::unique_ptr<HttpTransaction> http_transaction_; | 90 std::unique_ptr<HttpTransaction> http_transaction_; |
| 88 const HttpResponseInfo* http_response_info_; | 91 const HttpResponseInfo* http_response_info_; |
| 89 | 92 |
| 90 bool read_in_progress_; | 93 bool read_in_progress_; |
| 91 | 94 |
| 92 scoped_refptr<AuthData> auth_data_; | 95 std::unique_ptr<AuthData> auth_data_; |
| 93 | 96 |
| 94 FtpTransactionFactory* ftp_transaction_factory_; | 97 FtpTransactionFactory* ftp_transaction_factory_; |
| 95 FtpAuthCache* ftp_auth_cache_; | 98 FtpAuthCache* ftp_auth_cache_; |
| 96 | 99 |
| 97 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; | 100 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; |
| 98 | 101 |
| 99 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); | 102 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); |
| 100 }; | 103 }; |
| 101 | 104 |
| 102 } // namespace net | 105 } // namespace net |
| 103 | 106 |
| 104 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 107 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| OLD | NEW |