| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
| 6 #ifndef NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_ | 6 #ifndef NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_ |
| 7 #define NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_ | 7 #define NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_ |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 FtpCtrlResponse(); | 22 FtpCtrlResponse(); |
| 23 ~FtpCtrlResponse(); | 23 ~FtpCtrlResponse(); |
| 24 | 24 |
| 25 int status_code; // Three-digit status code. | 25 int status_code; // Three-digit status code. |
| 26 std::vector<std::string> lines; // Response lines, without CRLFs. | 26 std::vector<std::string> lines; // Response lines, without CRLFs. |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 class NET_EXPORT_PRIVATE FtpCtrlResponseBuffer { | 29 class NET_EXPORT_PRIVATE FtpCtrlResponseBuffer { |
| 30 public: | 30 public: |
| 31 FtpCtrlResponseBuffer(const BoundNetLog& net_log); | 31 explicit FtpCtrlResponseBuffer(const BoundNetLog& net_log); |
| 32 ~FtpCtrlResponseBuffer(); | 32 ~FtpCtrlResponseBuffer(); |
| 33 | 33 |
| 34 // Called when data is received from the control socket. Returns error code. | 34 // Called when data is received from the control socket. Returns error code. |
| 35 int ConsumeData(const char* data, int data_length); | 35 int ConsumeData(const char* data, int data_length); |
| 36 | 36 |
| 37 bool ResponseAvailable() const { | 37 bool ResponseAvailable() const { |
| 38 return !responses_.empty(); | 38 return !responses_.empty(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Returns the next response. It is an error to call this function | 41 // Returns the next response. It is an error to call this function |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 std::queue<FtpCtrlResponse> responses_; | 92 std::queue<FtpCtrlResponse> responses_; |
| 93 | 93 |
| 94 BoundNetLog net_log_; | 94 BoundNetLog net_log_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(FtpCtrlResponseBuffer); | 96 DISALLOW_COPY_AND_ASSIGN(FtpCtrlResponseBuffer); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace net | 99 } // namespace net |
| 100 | 100 |
| 101 #endif // NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_ | 101 #endif // NET_FTP_FTP_CTRL_RESPONSE_BUFFER_H_ |
| OLD | NEW |