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 15 matching lines...) Loading... |
26 // | 26 // |
27 // The lifetime of a Filter instance is completely controlled by its caller. | 27 // The lifetime of a Filter instance is completely controlled by its caller. |
28 | 28 |
29 #ifndef NET_BASE_FILTER_H__ | 29 #ifndef NET_BASE_FILTER_H__ |
30 #define NET_BASE_FILTER_H__ | 30 #define NET_BASE_FILTER_H__ |
31 | 31 |
32 #include <string> | 32 #include <string> |
33 #include <vector> | 33 #include <vector> |
34 | 34 |
35 #include "base/basictypes.h" | 35 #include "base/basictypes.h" |
| 36 #include "base/ref_counted.h" |
36 #include "base/scoped_ptr.h" | 37 #include "base/scoped_ptr.h" |
37 #include "base/time.h" | 38 #include "base/time.h" |
38 #include "net/base/io_buffer.h" | |
39 #include "googleurl/src/gurl.h" | |
40 #include "testing/gtest/include/gtest/gtest_prod.h" | 39 #include "testing/gtest/include/gtest/gtest_prod.h" |
41 | 40 |
| 41 class GURL; |
| 42 |
| 43 namespace net { |
| 44 class IOBuffer; |
| 45 } |
| 46 |
42 //------------------------------------------------------------------------------ | 47 //------------------------------------------------------------------------------ |
43 // Define an interface class that allows access to contextual information | 48 // Define an interface class that allows access to contextual information |
44 // supplied by the owner of this filter. In the case where there are a chain of | 49 // supplied by the owner of this filter. In the case where there are a chain of |
45 // filters, there is only one owner of all the chained filters, and that context | 50 // filters, there is only one owner of all the chained filters, and that context |
46 // is passed to the constructor of all those filters. To be clear, the context | 51 // is passed to the constructor of all those filters. To be clear, the context |
47 // does NOT reflect the position in a chain, or the fact that there are prior | 52 // does NOT reflect the position in a chain, or the fact that there are prior |
48 // or later filters in a chain. | 53 // or later filters in a chain. |
49 class FilterContext { | 54 class FilterContext { |
50 public: | 55 public: |
51 // Enum to control what histograms are emitted near end-of-life of this | 56 // Enum to control what histograms are emitted near end-of-life of this |
(...skipping 203 matching lines...) Loading... |
255 | 260 |
256 // Context data from the owner of this filter. Some filters need additional | 261 // Context data from the owner of this filter. Some filters need additional |
257 // context information (mime type, etc.) to properly function, and they access | 262 // context information (mime type, etc.) to properly function, and they access |
258 // this data via this reference member. | 263 // this data via this reference member. |
259 const FilterContext& filter_context_; | 264 const FilterContext& filter_context_; |
260 | 265 |
261 DISALLOW_COPY_AND_ASSIGN(Filter); | 266 DISALLOW_COPY_AND_ASSIGN(Filter); |
262 }; | 267 }; |
263 | 268 |
264 #endif // NET_BASE_FILTER_H__ | 269 #endif // NET_BASE_FILTER_H__ |
OLD | NEW |