| 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 // Filter performs filtering on data streams. Sample usage: | 5 // Filter performs filtering on data streams. Sample usage: |
| 6 // | 6 // |
| 7 // IStream* pre_filter_source; | 7 // IStream* pre_filter_source; |
| 8 // ... | 8 // ... |
| 9 // Filter* filter = Filter::Factory(filter_type, size); | 9 // Filter* filter = Filter::Factory(filter_type, size); |
| 10 // int pre_filter_data_len = filter->stream_buffer_size(); | 10 // int pre_filter_data_len = filter->stream_buffer_size(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Is data supplied from cache, or fresh across the net? | 65 // Is data supplied from cache, or fresh across the net? |
| 66 virtual bool IsCachedContent() const = 0; | 66 virtual bool IsCachedContent() const = 0; |
| 67 | 67 |
| 68 // Was this data flagged as a response to a request with an SDCH dictionary? | 68 // Was this data flagged as a response to a request with an SDCH dictionary? |
| 69 virtual bool IsSdchResponse() const = 0; | 69 virtual bool IsSdchResponse() const = 0; |
| 70 | 70 |
| 71 // How many bytes were read from the net or cache so far (and potentially | 71 // How many bytes were read from the net or cache so far (and potentially |
| 72 // pushed into a filter for processing)? | 72 // pushed into a filter for processing)? |
| 73 virtual int64 GetByteReadCount() const = 0; | 73 virtual int64 GetByteReadCount() const = 0; |
| 74 | 74 |
| 75 // What response code was received with the associated network transaction? |
| 76 // For example: 200 is ok. 4xx are error codes. etc. |
| 77 virtual int GetResponseCode() const = 0; |
| 78 |
| 75 // What is the desirable input buffer size for these filters? | 79 // What is the desirable input buffer size for these filters? |
| 76 // This value is currently supplied by the context, and is constant for all | 80 // This value is currently supplied by the context, and is constant for all |
| 77 // filters, even when they are part of a chain of filters. (i.e., we currently | 81 // filters, even when they are part of a chain of filters. (i.e., we currently |
| 78 // don't change the input buffer sizes for a linked chain of filters, and the | 82 // don't change the input buffer sizes for a linked chain of filters, and the |
| 79 // buffer size for input to all filters in a chain is this one constant). | 83 // buffer size for input to all filters in a chain is this one constant). |
| 80 virtual int GetInputStreamBufferSize() const = 0; | 84 virtual int GetInputStreamBufferSize() const = 0; |
| 81 }; | 85 }; |
| 82 | 86 |
| 83 //------------------------------------------------------------------------------ | 87 //------------------------------------------------------------------------------ |
| 84 class Filter { | 88 class Filter { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 238 |
| 235 // Context data from the owner of this filter. Some filters need additional | 239 // Context data from the owner of this filter. Some filters need additional |
| 236 // context information (mime type, etc.) to properly function, and they access | 240 // context information (mime type, etc.) to properly function, and they access |
| 237 // this data via this reference member. | 241 // this data via this reference member. |
| 238 const FilterContext& filter_context_; | 242 const FilterContext& filter_context_; |
| 239 | 243 |
| 240 DISALLOW_COPY_AND_ASSIGN(Filter); | 244 DISALLOW_COPY_AND_ASSIGN(Filter); |
| 241 }; | 245 }; |
| 242 | 246 |
| 243 #endif // NET_BASE_FILTER_H__ | 247 #endif // NET_BASE_FILTER_H__ |
| OLD | NEW |