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 20 matching lines...) Expand all Loading... | |
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/gtest_prod_util.h" | 36 #include "base/gtest_prod_util.h" |
37 #include "base/memory/ref_counted.h" | 37 #include "base/memory/ref_counted.h" |
38 #include "base/memory/scoped_ptr.h" | 38 #include "base/memory/scoped_ptr.h" |
39 #include "base/time/time.h" | 39 #include "base/time/time.h" |
40 #include "net/base/net_export.h" | 40 #include "net/base/net_export.h" |
41 #include "net/base/sdch_manager.h" | |
Randy Smith (Not in Mondays)
2014/09/18 20:55:51
I don't see this used anywhere in this file; remov
baranovich
2014/09/19 12:42:44
My bad
baranovich
2014/09/30 13:16:52
Done.
| |
41 | 42 |
42 class GURL; | 43 class GURL; |
43 | 44 |
44 namespace net { | 45 namespace net { |
45 | 46 |
47 class BoundNetLog; | |
48 class IOBuffer; | |
46 class URLRequestContext; | 49 class URLRequestContext; |
47 class IOBuffer; | |
48 | 50 |
49 //------------------------------------------------------------------------------ | 51 //------------------------------------------------------------------------------ |
50 // Define an interface class that allows access to contextual information | 52 // Define an interface class that allows access to contextual information |
51 // supplied by the owner of this filter. In the case where there are a chain of | 53 // supplied by the owner of this filter. In the case where there are a chain of |
52 // filters, there is only one owner of all the chained filters, and that context | 54 // filters, there is only one owner of all the chained filters, and that context |
53 // is passed to the constructor of all those filters. To be clear, the context | 55 // is passed to the constructor of all those filters. To be clear, the context |
54 // does NOT reflect the position in a chain, or the fact that there are prior | 56 // does NOT reflect the position in a chain, or the fact that there are prior |
55 // or later filters in a chain. | 57 // or later filters in a chain. |
56 class NET_EXPORT_PRIVATE FilterContext { | 58 class NET_EXPORT_PRIVATE FilterContext { |
57 public: | 59 public: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 // What response code was received with the associated network transaction? | 100 // What response code was received with the associated network transaction? |
99 // For example: 200 is ok. 4xx are error codes. etc. | 101 // For example: 200 is ok. 4xx are error codes. etc. |
100 virtual int GetResponseCode() const = 0; | 102 virtual int GetResponseCode() const = 0; |
101 | 103 |
102 // The URLRequestContext associated with the request. | 104 // The URLRequestContext associated with the request. |
103 virtual const URLRequestContext* GetURLRequestContext() const = 0; | 105 virtual const URLRequestContext* GetURLRequestContext() const = 0; |
104 | 106 |
105 // The following method forces the context to emit a specific set of | 107 // The following method forces the context to emit a specific set of |
106 // statistics as selected by the argument. | 108 // statistics as selected by the argument. |
107 virtual void RecordPacketStats(StatisticSelector statistic) const = 0; | 109 virtual void RecordPacketStats(StatisticSelector statistic) const = 0; |
110 | |
111 // The BoundNetLog of the associated request. | |
112 virtual const BoundNetLog& GetNetLog() const = 0; | |
108 }; | 113 }; |
109 | 114 |
110 //------------------------------------------------------------------------------ | 115 //------------------------------------------------------------------------------ |
111 class NET_EXPORT_PRIVATE Filter { | 116 class NET_EXPORT_PRIVATE Filter { |
112 public: | 117 public: |
113 // Return values of function ReadFilteredData. | 118 // Return values of function ReadFilteredData. |
114 enum FilterStatus { | 119 enum FilterStatus { |
115 // Read filtered data successfully | 120 // Read filtered data successfully |
116 FILTER_OK, | 121 FILTER_OK, |
117 // Read filtered data successfully, and the data in the buffer has been | 122 // Read filtered data successfully, and the data in the buffer has been |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 // Remember what status or local filter last returned so we can better handle | 280 // Remember what status or local filter last returned so we can better handle |
276 // chained filters. | 281 // chained filters. |
277 FilterStatus last_status_; | 282 FilterStatus last_status_; |
278 | 283 |
279 DISALLOW_COPY_AND_ASSIGN(Filter); | 284 DISALLOW_COPY_AND_ASSIGN(Filter); |
280 }; | 285 }; |
281 | 286 |
282 } // namespace net | 287 } // namespace net |
283 | 288 |
284 #endif // NET_FILTER_FILTER_H__ | 289 #endif // NET_FILTER_FILTER_H__ |
OLD | NEW |