Chromium Code Reviews| 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 { | |
|
mmenke
2016/10/06 18:54:27
optional: Could just forward declare this here, m
asanka
2016/10/06 19:59:42
Done.
| |
| 54 public: | |
| 55 AuthState state; // whether we need, have, or gave up on authentication. | |
|
mmenke
2016/10/06 18:54:27
While you're here, should capitalize Whether
asanka
2016/10/06 19:59:43
Done.
| |
| 56 AuthCredentials credentials; // The credentials to use for auth. | |
| 57 | |
| 58 AuthData(); | |
| 59 ~AuthData(); | |
| 60 }; | |
| 61 | |
| 52 void OnResolveProxyComplete(int result); | 62 void OnResolveProxyComplete(int result); |
| 53 | 63 |
| 54 void StartFtpTransaction(); | 64 void StartFtpTransaction(); |
| 55 void StartHttpTransaction(); | 65 void StartHttpTransaction(); |
| 56 | 66 |
| 57 void OnStartCompleted(int result); | 67 void OnStartCompleted(int result); |
| 58 void OnStartCompletedAsync(int result); | 68 void OnStartCompletedAsync(int result); |
| 59 void OnReadCompleted(int result); | 69 void OnReadCompleted(int result); |
| 60 | 70 |
| 61 void RestartTransactionWithAuth(); | 71 void RestartTransactionWithAuth(); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 82 | 92 |
| 83 FtpRequestInfo ftp_request_info_; | 93 FtpRequestInfo ftp_request_info_; |
| 84 std::unique_ptr<FtpTransaction> ftp_transaction_; | 94 std::unique_ptr<FtpTransaction> ftp_transaction_; |
| 85 | 95 |
| 86 HttpRequestInfo http_request_info_; | 96 HttpRequestInfo http_request_info_; |
| 87 std::unique_ptr<HttpTransaction> http_transaction_; | 97 std::unique_ptr<HttpTransaction> http_transaction_; |
| 88 const HttpResponseInfo* http_response_info_; | 98 const HttpResponseInfo* http_response_info_; |
| 89 | 99 |
| 90 bool read_in_progress_; | 100 bool read_in_progress_; |
| 91 | 101 |
| 92 scoped_refptr<AuthData> auth_data_; | 102 std::unique_ptr<AuthData> auth_data_; |
| 93 | 103 |
| 94 FtpTransactionFactory* ftp_transaction_factory_; | 104 FtpTransactionFactory* ftp_transaction_factory_; |
| 95 FtpAuthCache* ftp_auth_cache_; | 105 FtpAuthCache* ftp_auth_cache_; |
| 96 | 106 |
| 97 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; | 107 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; |
| 98 | 108 |
| 99 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); | 109 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); |
| 100 }; | 110 }; |
| 101 | 111 |
| 102 } // namespace net | 112 } // namespace net |
| 103 | 113 |
| 104 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 114 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| OLD | NEW |