| 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_FTP_FTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
| 6 #define NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 6 #define NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 STATE_DATA_CONNECT, | 120 STATE_DATA_CONNECT, |
| 121 STATE_DATA_CONNECT_COMPLETE, | 121 STATE_DATA_CONNECT_COMPLETE, |
| 122 STATE_DATA_READ, | 122 STATE_DATA_READ, |
| 123 STATE_DATA_READ_COMPLETE, | 123 STATE_DATA_READ_COMPLETE, |
| 124 STATE_NONE | 124 STATE_NONE |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 // Resets the members of the transaction so it can be restarted. | 127 // Resets the members of the transaction so it can be restarted. |
| 128 void ResetStateForRestart(); | 128 void ResetStateForRestart(); |
| 129 | 129 |
| 130 // Resets the data connection after an error and switches to |next_state|. | 130 // Establishes the data connection and switches to |state_after_connect|. |
| 131 void ResetDataConnectionAfterError(State next_state); | 131 // |state_after_connect| should only be RETR or LIST. |
| 132 void EstablishDataConnection(State state_after_connect); |
| 132 | 133 |
| 133 void DoCallback(int result); | 134 void DoCallback(int result); |
| 134 void OnIOComplete(int result); | 135 void OnIOComplete(int result); |
| 135 | 136 |
| 136 // Executes correct ProcessResponse + command_name function based on last | 137 // Executes correct ProcessResponse + command_name function based on last |
| 137 // issued command. Returns error code. | 138 // issued command. Returns error code. |
| 138 int ProcessCtrlResponse(); | 139 int ProcessCtrlResponse(); |
| 139 | 140 |
| 140 int SendFtpCommand(const std::string& command, | 141 int SendFtpCommand(const std::string& command, |
| 141 const std::string& command_for_log, | 142 const std::string& command_for_log, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 State next_state_; | 257 State next_state_; |
| 257 | 258 |
| 258 // State to switch to after data connection is complete. | 259 // State to switch to after data connection is complete. |
| 259 State state_after_data_connect_complete_; | 260 State state_after_data_connect_complete_; |
| 260 }; | 261 }; |
| 261 | 262 |
| 262 } // namespace net | 263 } // namespace net |
| 263 | 264 |
| 264 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 265 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
| OLD | NEW |