| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef NET_FILTER_FILTER_SOURCE_STREAM_H_ | 5 #ifndef NET_FILTER_FILTER_SOURCE_STREAM_H_ |
| 6 #define NET_FILTER_FILTER_SOURCE_STREAM_H_ | 6 #define NET_FILTER_FILTER_SOURCE_STREAM_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 FilterSourceStream(SourceType type, std::unique_ptr<SourceStream> upstream); | 31 FilterSourceStream(SourceType type, std::unique_ptr<SourceStream> upstream); |
| 32 | 32 |
| 33 ~FilterSourceStream() override; | 33 ~FilterSourceStream() override; |
| 34 | 34 |
| 35 int Read(IOBuffer* read_buffer, | 35 int Read(IOBuffer* read_buffer, |
| 36 int read_buffer_size, | 36 int read_buffer_size, |
| 37 const CompletionCallback& callback) override; | 37 const CompletionCallback& callback) override; |
| 38 | 38 |
| 39 std::string Description() const override; | 39 std::string Description() const override; |
| 40 | 40 |
| 41 static void ReportContentDecodingFailed(SourceType type); |
| 42 |
| 41 private: | 43 private: |
| 42 enum State { | 44 enum State { |
| 43 STATE_NONE, | 45 STATE_NONE, |
| 44 // Reading data from |upstream_| into |input_buffer_|. | 46 // Reading data from |upstream_| into |input_buffer_|. |
| 45 STATE_READ_DATA, | 47 STATE_READ_DATA, |
| 46 // Reading data from |upstream_| completed. | 48 // Reading data from |upstream_| completed. |
| 47 STATE_READ_DATA_COMPLETE, | 49 STATE_READ_DATA_COMPLETE, |
| 48 // Filtering data contained in |input_buffer_|. | 50 // Filtering data contained in |input_buffer_|. |
| 49 STATE_FILTER_DATA, | 51 STATE_FILTER_DATA, |
| 50 // Filtering data contained in |input_buffer_| completed. | 52 // Filtering data contained in |input_buffer_| completed. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 112 |
| 111 // Reading from |upstream_| has returned 0 byte or an error code. | 113 // Reading from |upstream_| has returned 0 byte or an error code. |
| 112 bool upstream_end_reached_; | 114 bool upstream_end_reached_; |
| 113 | 115 |
| 114 DISALLOW_COPY_AND_ASSIGN(FilterSourceStream); | 116 DISALLOW_COPY_AND_ASSIGN(FilterSourceStream); |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 } // namespace net | 119 } // namespace net |
| 118 | 120 |
| 119 #endif // NET_FILTER_FILTER_SOURCE_STREAM_H_ | 121 #endif // NET_FILTER_FILTER_SOURCE_STREAM_H_ |
| OLD | NEW |