| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Called to handle a certificate error. Returns OK if the error should be | 80 // Called to handle a certificate error. Returns OK if the error should be |
| 81 // ignored. Otherwise, stores the certificate in response_.ssl_info and | 81 // ignored. Otherwise, stores the certificate in response_.ssl_info and |
| 82 // returns the same error code. | 82 // returns the same error code. |
| 83 int HandleCertificateError(int error); | 83 int HandleCertificateError(int error); |
| 84 | 84 |
| 85 // Called to possibly recover from the given error. Sets next_state_ and | 85 // Called to possibly recover from the given error. Sets next_state_ and |
| 86 // returns OK if recovering from the error. Otherwise, the same error code | 86 // returns OK if recovering from the error. Otherwise, the same error code |
| 87 // is returned. | 87 // is returned. |
| 88 int HandleIOError(int error); | 88 int HandleIOError(int error); |
| 89 | 89 |
| 90 // Called when we reached EOF or got an error. If we should resend the |
| 91 // request, sets next_state_ and returns true. Otherwise, does nothing and |
| 92 // returns false. |
| 93 bool ShouldResendRequest(); |
| 94 |
| 90 // Return true if based on the bytes read so far, the start of the | 95 // Return true if based on the bytes read so far, the start of the |
| 91 // status line is known. This is used to distingish between HTTP/0.9 | 96 // status line is known. This is used to distingish between HTTP/0.9 |
| 92 // responses (which have no status line). | 97 // responses (which have no status line) and HTTP/1.x responses. |
| 93 bool has_found_status_line_start() const { | 98 bool has_found_status_line_start() const { |
| 94 return header_buf_http_offset_ != -1; | 99 return header_buf_http_offset_ != -1; |
| 95 } | 100 } |
| 96 | 101 |
| 97 CompletionCallbackImpl<HttpNetworkTransaction> io_callback_; | 102 CompletionCallbackImpl<HttpNetworkTransaction> io_callback_; |
| 98 CompletionCallback* user_callback_; | 103 CompletionCallback* user_callback_; |
| 99 | 104 |
| 100 scoped_refptr<HttpNetworkSession> session_; | 105 scoped_refptr<HttpNetworkSession> session_; |
| 101 | 106 |
| 102 const HttpRequestInfo* request_; | 107 const HttpRequestInfo* request_; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 STATE_READ_BODY_COMPLETE, | 179 STATE_READ_BODY_COMPLETE, |
| 175 STATE_NONE | 180 STATE_NONE |
| 176 }; | 181 }; |
| 177 State next_state_; | 182 State next_state_; |
| 178 }; | 183 }; |
| 179 | 184 |
| 180 } // namespace net | 185 } // namespace net |
| 181 | 186 |
| 182 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 187 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 183 | 188 |
| OLD | NEW |