OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // 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 <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Executes correct ProcessResponse + command_name function based on last | 94 // Executes correct ProcessResponse + command_name function based on last |
95 // issued command. Returns error code. | 95 // issued command. Returns error code. |
96 int ProcessCtrlResponse(); | 96 int ProcessCtrlResponse(); |
97 | 97 |
98 int SendFtpCommand(const std::string& command, Command cmd); | 98 int SendFtpCommand(const std::string& command, Command cmd); |
99 | 99 |
100 // Return the error class for given response code. You should validate the | 100 // Return the error class for given response code. You should validate the |
101 // code to be in range 100-599. | 101 // code to be in range 100-599. |
102 static ErrorClass GetErrorClass(int response_code); | 102 static ErrorClass GetErrorClass(int response_code); |
103 | 103 |
| 104 // Returns request path suitable to be included in an FTP command. |
| 105 std::string GetRequestPathForFtpCommand() const; |
| 106 |
104 // Runs the state transition loop. | 107 // Runs the state transition loop. |
105 int DoLoop(int result); | 108 int DoLoop(int result); |
106 | 109 |
107 // Each of these methods corresponds to a State value. Those with an input | 110 // Each of these methods corresponds to a State value. Those with an input |
108 // argument receive the result from the previous state. If a method returns | 111 // argument receive the result from the previous state. If a method returns |
109 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the | 112 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the |
110 // next state method as the result arg. | 113 // next state method as the result arg. |
111 int DoCtrlInit(); | 114 int DoCtrlInit(); |
112 int DoCtrlInitComplete(int result); | 115 int DoCtrlInitComplete(int result); |
113 int DoCtrlResolveHost(); | 116 int DoCtrlResolveHost(); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 STATE_DATA_READ, | 235 STATE_DATA_READ, |
233 STATE_DATA_READ_COMPLETE, | 236 STATE_DATA_READ_COMPLETE, |
234 STATE_NONE | 237 STATE_NONE |
235 }; | 238 }; |
236 State next_state_; | 239 State next_state_; |
237 }; | 240 }; |
238 | 241 |
239 } // namespace net | 242 } // namespace net |
240 | 243 |
241 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 244 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |