| 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_GZIP_SOURCE_STREAM_H_ | 5 #ifndef NET_FILTER_GZIP_SOURCE_STREAM_H_ |
| 6 #define NET_FILTER_GZIP_SOURCE_STREAM_H_ | 6 #define NET_FILTER_GZIP_SOURCE_STREAM_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 GzipSourceStream(std::unique_ptr<SourceStream> previous, | 55 GzipSourceStream(std::unique_ptr<SourceStream> previous, |
| 56 SourceStream::SourceType type); | 56 SourceStream::SourceType type); |
| 57 | 57 |
| 58 // Returns true if initialization is successful, false otherwise. | 58 // Returns true if initialization is successful, false otherwise. |
| 59 // For instance, this method returns false if there is not enough memory or | 59 // For instance, this method returns false if there is not enough memory or |
| 60 // if there is a version mismatch. | 60 // if there is a version mismatch. |
| 61 bool Init(); | 61 bool Init(); |
| 62 | 62 |
| 63 // SourceStream implementation | 63 // SourceStream implementation |
| 64 std::string GetTypeAsString() const override; | 64 std::string GetTypeAsString() const override; |
| 65 void DumpMemoryStatsImpl( |
| 66 base::trace_event::MemoryAllocatorDump* dump) const override; |
| 65 int FilterData(IOBuffer* output_buffer, | 67 int FilterData(IOBuffer* output_buffer, |
| 66 int output_buffer_size, | 68 int output_buffer_size, |
| 67 IOBuffer* input_buffer, | 69 IOBuffer* input_buffer, |
| 68 int input_buffer_size, | 70 int input_buffer_size, |
| 69 int* consumed_bytes, | 71 int* consumed_bytes, |
| 70 bool upstream_end_reached) override; | 72 bool upstream_end_reached) override; |
| 71 | 73 |
| 72 // Inserts a zlib header to the data stream before calling zlib inflate. | 74 // Inserts a zlib header to the data stream before calling zlib inflate. |
| 73 // This is used to work around server bugs. The function returns true on | 75 // This is used to work around server bugs. The function returns true on |
| 74 // success. | 76 // success. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 97 | 99 |
| 98 // Tracks the state of the input stream. | 100 // Tracks the state of the input stream. |
| 99 InputState input_state_; | 101 InputState input_state_; |
| 100 | 102 |
| 101 DISALLOW_COPY_AND_ASSIGN(GzipSourceStream); | 103 DISALLOW_COPY_AND_ASSIGN(GzipSourceStream); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 } // namespace net | 106 } // namespace net |
| 105 | 107 |
| 106 #endif // NET_FILTER_GZIP_SOURCE_STREAM_H__ | 108 #endif // NET_FILTER_GZIP_SOURCE_STREAM_H__ |
| OLD | NEW |