| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // What mime type was specified in the header for this data? | 96 // What mime type was specified in the header for this data? |
| 97 // Only makes senses for some types of contexts, and returns false | 97 // Only makes senses for some types of contexts, and returns false |
| 98 // when not applicable. | 98 // when not applicable. |
| 99 virtual bool GetMimeType(std::string* mime_type) const = 0; | 99 virtual bool GetMimeType(std::string* mime_type) const = 0; |
| 100 | 100 |
| 101 // What URL was used to access this data? | 101 // What URL was used to access this data? |
| 102 // Return false if gurl is not present. | 102 // Return false if gurl is not present. |
| 103 virtual bool GetURL(GURL* gurl) const = 0; | 103 virtual bool GetURL(GURL* gurl) const = 0; |
| 104 | 104 |
| 105 // What Content-Disposition header came with this data? | |
| 106 // Return false if no header was present. | |
| 107 virtual bool GetContentDisposition(std::string* disposition) const = 0; | |
| 108 | |
| 109 // When was this data requested from a server? | 105 // When was this data requested from a server? |
| 110 virtual base::Time GetRequestTime() const = 0; | 106 virtual base::Time GetRequestTime() const = 0; |
| 111 | 107 |
| 112 // Is data supplied from cache, or fresh across the net? | 108 // Is data supplied from cache, or fresh across the net? |
| 113 virtual bool IsCachedContent() const = 0; | 109 virtual bool IsCachedContent() const = 0; |
| 114 | 110 |
| 115 // Is this a download? | |
| 116 virtual bool IsDownload() const = 0; | |
| 117 | |
| 118 // Was this data flagged as a response to a request with an SDCH dictionary? | 111 // Was this data flagged as a response to a request with an SDCH dictionary? |
| 119 virtual SdchManager::DictionarySet* SdchDictionariesAdvertised() const = 0; | 112 virtual SdchManager::DictionarySet* SdchDictionariesAdvertised() const = 0; |
| 120 | 113 |
| 121 // How many bytes were read from the net or cache so far (and potentially | 114 // How many bytes were read from the net or cache so far (and potentially |
| 122 // pushed into a filter for processing)? | 115 // pushed into a filter for processing)? |
| 123 virtual int64 GetByteReadCount() const = 0; | 116 virtual int64 GetByteReadCount() const = 0; |
| 124 | 117 |
| 125 // What response code was received with the associated network transaction? | 118 // What response code was received with the associated network transaction? |
| 126 // For example: 200 is ok. 4xx are error codes. etc. | 119 // For example: 200 is ok. 4xx are error codes. etc. |
| 127 virtual int GetResponseCode() const = 0; | 120 virtual int GetResponseCode() const = 0; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 306 |
| 314 // The filter type this filter was constructed from. | 307 // The filter type this filter was constructed from. |
| 315 FilterType type_id_; | 308 FilterType type_id_; |
| 316 | 309 |
| 317 DISALLOW_COPY_AND_ASSIGN(Filter); | 310 DISALLOW_COPY_AND_ASSIGN(Filter); |
| 318 }; | 311 }; |
| 319 | 312 |
| 320 } // namespace net | 313 } // namespace net |
| 321 | 314 |
| 322 #endif // NET_FILTER_FILTER_H__ | 315 #endif // NET_FILTER_FILTER_H__ |
| OLD | NEW |