| 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_HTTP_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 enum CompletionCause { | 137 enum CompletionCause { |
| 138 ABORTED, | 138 ABORTED, |
| 139 FINISHED | 139 FINISHED |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 typedef base::RefCountedData<bool> SharedBoolean; | 142 typedef base::RefCountedData<bool> SharedBoolean; |
| 143 | 143 |
| 144 class HttpFilterContext; | 144 class HttpFilterContext; |
| 145 class HttpTransactionDelegateImpl; |
| 145 | 146 |
| 146 virtual ~URLRequestHttpJob(); | 147 virtual ~URLRequestHttpJob(); |
| 147 | 148 |
| 148 void RecordTimer(); | 149 void RecordTimer(); |
| 149 void ResetTimer(); | 150 void ResetTimer(); |
| 150 | 151 |
| 151 virtual void UpdatePacketReadTimes() OVERRIDE; | 152 virtual void UpdatePacketReadTimes() OVERRIDE; |
| 152 void RecordPacketStats(FilterContext::StatisticSelector statistic) const; | 153 void RecordPacketStats(FilterContext::StatisticSelector statistic) const; |
| 153 | 154 |
| 154 void RecordCompressionHistograms(); | 155 void RecordCompressionHistograms(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 180 // the uncompressed size. If this is the case, we return true in order | 181 // the uncompressed size. If this is the case, we return true in order |
| 181 // to request to work around this non-adherence to the HTTP standard. | 182 // to request to work around this non-adherence to the HTTP standard. |
| 182 // |rv| is the standard return value of a read function indicating the number | 183 // |rv| is the standard return value of a read function indicating the number |
| 183 // of bytes read or, if negative, an error code. | 184 // of bytes read or, if negative, an error code. |
| 184 bool ShouldFixMismatchedContentLength(int rv) const; | 185 bool ShouldFixMismatchedContentLength(int rv) const; |
| 185 | 186 |
| 186 // Returns the effective response headers, considering that they may be | 187 // Returns the effective response headers, considering that they may be |
| 187 // overridden by |override_response_headers_|. | 188 // overridden by |override_response_headers_|. |
| 188 HttpResponseHeaders* GetResponseHeaders() const; | 189 HttpResponseHeaders* GetResponseHeaders() const; |
| 189 | 190 |
| 191 // Override of the private interface of URLRequestJob. |
| 192 virtual void OnDetachRequest() OVERRIDE; |
| 193 |
| 190 base::Time request_creation_time_; | 194 base::Time request_creation_time_; |
| 191 | 195 |
| 192 // Data used for statistics gathering. This data is only used for histograms | 196 // Data used for statistics gathering. This data is only used for histograms |
| 193 // and is not required. It is only gathered if packet_timing_enabled_ == true. | 197 // and is not required. It is only gathered if packet_timing_enabled_ == true. |
| 194 // | 198 // |
| 195 // TODO(jar): improve the quality of the gathered info by gathering most times | 199 // TODO(jar): improve the quality of the gathered info by gathering most times |
| 196 // at a lower point in the network stack, assuring we have actual packet | 200 // at a lower point in the network stack, assuring we have actual packet |
| 197 // boundaries, rather than approximations. Also note that input byte count | 201 // boundaries, rather than approximations. Also note that input byte count |
| 198 // as gathered here is post-SSL, and post-cache-fetch, and does not reflect | 202 // as gathered here is post-SSL, and post-cache-fetch, and does not reflect |
| 199 // true packet arrival times in such cases. | 203 // true packet arrival times in such cases. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 227 // layers of the network stack. | 231 // layers of the network stack. |
| 228 scoped_refptr<HttpResponseHeaders> override_response_headers_; | 232 scoped_refptr<HttpResponseHeaders> override_response_headers_; |
| 229 | 233 |
| 230 // Flag used to verify that |this| is not deleted while we are awaiting | 234 // Flag used to verify that |this| is not deleted while we are awaiting |
| 231 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. | 235 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. |
| 232 // True if we are waiting a callback and | 236 // True if we are waiting a callback and |
| 233 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, | 237 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, |
| 234 // to inform the NetworkDelegate that it may not call back. | 238 // to inform the NetworkDelegate that it may not call back. |
| 235 bool awaiting_callback_; | 239 bool awaiting_callback_; |
| 236 | 240 |
| 241 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_; |
| 242 |
| 237 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 243 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
| 238 }; | 244 }; |
| 239 | 245 |
| 240 } // namespace net | 246 } // namespace net |
| 241 | 247 |
| 242 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 248 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| OLD | NEW |