Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: net/base/filter.h

Issue 6516025: Remove GetInputStreamBufferSize() method from FilterContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed signed/unsigned error Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/filter.cc » ('j') | net/base/filter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filter.h
diff --git a/net/base/filter.h b/net/base/filter.h
index c6004e9d754385c96e419dd5fffc9d76947e68bb..b8788b8a2886a6a5b45cdb22475a947b0a23fae9 100644
--- a/net/base/filter.h
+++ b/net/base/filter.h
@@ -38,13 +38,10 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/time.h"
+#include "net/base/io_buffer.h"
class GURL;
-namespace net {
-class IOBuffer;
-}
-
//------------------------------------------------------------------------------
// Define an interface class that allows access to contextual information
// supplied by the owner of this filter. In the case where there are a chain of
@@ -94,13 +91,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;
@@ -184,6 +174,15 @@ class Filter {
// The function returns true if success, and false otherwise.
bool FlushStreamBuffer(int stream_data_len);
+#if defined(UNIT_TEST)
+ // 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) {
jar (doing other things) 2011/02/15 06:48:53 This strikes me as a bad or perilous interface for
jar (doing other things) 2011/02/25 18:37:24 I spoke with others on the Chrome team about this
adamk 2011/02/25 20:48:13 I'm happy to get rid of the UNIT_TEST nonsense and
jar (doing other things) 2011/02/26 01:36:52 Perhaps I chose the wrong words.... I was trying
+ stream_buffer_ = new net::IOBuffer(size);
+ stream_buffer_size_ = size;
+ }
+#endif
+
// Translate the text of a filter name (from Content-Encoding header) into a
// FilterType.
static FilterType ConvertEncodingToType(const std::string& filter_type);
@@ -245,11 +244,6 @@ 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();
« no previous file with comments | « no previous file | net/base/filter.cc » ('j') | net/base/filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698