| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // FilterContext methods: | 200 // FilterContext methods: |
| 201 // These methods are not applicable to all connections. | 201 // These methods are not applicable to all connections. |
| 202 virtual bool GetMimeType(std::string* mime_type) const; | 202 virtual bool GetMimeType(std::string* mime_type) const; |
| 203 virtual bool GetURL(GURL* gurl) const; | 203 virtual bool GetURL(GURL* gurl) const; |
| 204 virtual base::Time GetRequestTime() const; | 204 virtual base::Time GetRequestTime() const; |
| 205 virtual bool IsDownload() const; | 205 virtual bool IsDownload() const; |
| 206 virtual bool IsSdchResponse() const; | 206 virtual bool IsSdchResponse() const; |
| 207 virtual bool IsCachedContent() const; | 207 virtual bool IsCachedContent() const; |
| 208 virtual int64 GetByteReadCount() const; | 208 virtual int64 GetByteReadCount() const; |
| 209 virtual int GetResponseCode() const; | 209 virtual int GetResponseCode() const; |
| 210 virtual int GetInputStreamBufferSize() const; | |
| 211 virtual void RecordPacketStats(StatisticSelector statistic) const; | 210 virtual void RecordPacketStats(StatisticSelector statistic) const; |
| 212 | 211 |
| 213 // Returns the socket address for the connection. | 212 // Returns the socket address for the connection. |
| 214 // See url_request.h for details. | 213 // See url_request.h for details. |
| 215 virtual HostPortPair GetSocketAddress() const; | 214 virtual HostPortPair GetSocketAddress() const; |
| 216 | 215 |
| 217 protected: | 216 protected: |
| 218 friend class base::RefCounted<URLRequestJob>; | 217 friend class base::RefCounted<URLRequestJob>; |
| 219 virtual ~URLRequestJob(); | 218 virtual ~URLRequestJob(); |
| 220 | 219 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 int prefilter_bytes_read_; | 296 int prefilter_bytes_read_; |
| 298 // The number of bytes read after passing through the filter. | 297 // The number of bytes read after passing through the filter. |
| 299 int postfilter_bytes_read_; | 298 int postfilter_bytes_read_; |
| 300 // True when (we believe) the content in this net::URLRequest was | 299 // True when (we believe) the content in this net::URLRequest was |
| 301 // compressible. | 300 // compressible. |
| 302 bool is_compressible_content_; | 301 bool is_compressible_content_; |
| 303 // True when the content in this net::URLRequest was compressed. | 302 // True when the content in this net::URLRequest was compressed. |
| 304 bool is_compressed_; | 303 bool is_compressed_; |
| 305 | 304 |
| 306 private: | 305 private: |
| 307 // Size of filter input buffers used by this class. | |
| 308 static const int kFilterBufSize; | |
| 309 | |
| 310 // When data filtering is enabled, this function is used to read data | 306 // When data filtering is enabled, this function is used to read data |
| 311 // for the filter. Returns true if raw data was read. Returns false if | 307 // for the filter. Returns true if raw data was read. Returns false if |
| 312 // an error occurred (or we are waiting for IO to complete). | 308 // an error occurred (or we are waiting for IO to complete). |
| 313 bool ReadRawDataForFilter(int *bytes_read); | 309 bool ReadRawDataForFilter(int *bytes_read); |
| 314 | 310 |
| 315 // Invokes ReadRawData and records bytes read if the read completes | 311 // Invokes ReadRawData and records bytes read if the read completes |
| 316 // synchronously. | 312 // synchronously. |
| 317 bool ReadRawDataHelper(net::IOBuffer* buf, int buf_size, int* bytes_read); | 313 bool ReadRawDataHelper(net::IOBuffer* buf, int buf_size, int* bytes_read); |
| 318 | 314 |
| 319 // Called in response to a redirect that was not canceled to follow the | 315 // Called in response to a redirect that was not canceled to follow the |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // The count of the number of packets, some of which may not have been timed. | 414 // The count of the number of packets, some of which may not have been timed. |
| 419 // We're ignoring overflow, as 1430 x 2^31 is a LOT of bytes. | 415 // We're ignoring overflow, as 1430 x 2^31 is a LOT of bytes. |
| 420 int observed_packet_count_; | 416 int observed_packet_count_; |
| 421 | 417 |
| 422 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 418 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
| 423 }; | 419 }; |
| 424 | 420 |
| 425 } // namespace net | 421 } // namespace net |
| 426 | 422 |
| 427 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 423 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
| OLD | NEW |