| Index: net/base/filter.h
|
| diff --git a/net/base/filter.h b/net/base/filter.h
|
| index c6004e9d754385c96e419dd5fffc9d76947e68bb..b4bc4a400b4273093ea0e1f126ea6c631c0929d3 100644
|
| --- a/net/base/filter.h
|
| +++ b/net/base/filter.h
|
| @@ -43,6 +43,7 @@ class GURL;
|
|
|
| namespace net {
|
| class IOBuffer;
|
| +class SdchFilterChainingTest;
|
| }
|
|
|
| //------------------------------------------------------------------------------
|
| @@ -94,13 +95,6 @@ class FilterContext {
|
| // For example: 200 is ok. 4xx are error codes. etc.
|
| virtual int GetResponseCode() const = 0;
|
|
|
| - // What is the desirable input buffer size for these filters?
|
| - // This value is currently supplied by the context, and is constant for all
|
| - // filters, even when they are part of a chain of filters. (i.e., we currently
|
| - // don't change the input buffer sizes for a linked chain of filters, and the
|
| - // buffer size for input to all filters in a chain is this one constant).
|
| - virtual int GetInputStreamBufferSize() const = 0;
|
| -
|
| // The following method forces the context to emit a specific set of
|
| // statistics as selected by the argument.
|
| virtual void RecordPacketStats(StatisticSelector statistic) const = 0;
|
| @@ -199,7 +193,11 @@ class Filter {
|
| std::vector<FilterType>* encoding_types);
|
|
|
| protected:
|
| - FRIEND_TEST_ALL_PREFIXES(SdchFilterTest, ContentTypeId);
|
| + FRIEND_TEST_ALL_PREFIXES(GZipUnitTest, DecodeWithSmallBuffer);
|
| + FRIEND_TEST_ALL_PREFIXES(GZipUnitTest, DecodeWithOneByteBuffer);
|
| + FRIEND_TEST_ALL_PREFIXES(GZipUnitTest,
|
| + DecodeWithOneByteInputAndOutputBuffer);
|
| + friend class net::SdchFilterChainingTest;
|
|
|
| explicit Filter(const FilterContext& filter_context);
|
|
|
| @@ -245,14 +243,13 @@ class Filter {
|
| const FilterContext& filter_context,
|
| Filter* filter_list);
|
|
|
| - // Allocates and initializes stream_buffer_ based on filter_context_.
|
| - // Establishes a buffer large enough to handle the amount specified in
|
| - // filter_context_.GetInputStreamBufferSize().
|
| - bool InitBuffer();
|
| -
|
| // Helper function to empty our output into the next filter's input.
|
| void PushDataIntoNextFilter();
|
|
|
| + // Resets the filter's internal buffer to the given size. Should only
|
| + // be called in unit tests, and only immediately after filter construction.
|
| + void ResetInputBufferForTest(int size);
|
| +
|
| // An optional filter to process output from this filter.
|
| scoped_ptr<Filter> next_filter_;
|
| // Remember what status or local filter last returned so we can better handle
|
|
|