| OLD | NEW |
| (Empty) | |
| 1 The network stack implements support for Content-Encodings using |
| 2 "source streams", which can be composed together and mutate all the incoming |
| 3 bytes from a URLRequestJob. Currently, the following streams are implemented: |
| 4 |
| 5 * gzip (handling "deflate" and "gzip" Content-Encodings) |
| 6 * sdch (handling "sdch" Content-Encoding) |
| 7 * brotli (handling "br" Content-Encoding) |
| 8 |
| 9 Source streams conceptually form a chain, with the URLRequestJob as both the |
| 10 beginning and end of the chain, meaning the URLRequestJob produces raw bytes at |
| 11 the end and consumes unencoded bytes at the beginning. For example, to support a |
| 12 hypothetical "Content-Encoding: bar,foo", streams would be arranged like so, |
| 13 with "X <-- Y" meaning "data flows from Y to X" or "X reads data from Y": |
| 14 |
| 15 URLRequestJob <-- BarSourceStream <-- FooSourceStream <-- URLRequestJob |
| 16 (URLRequestSourceStream) |
| 17 |
| 18 Here the URLRequestJob pulls filtered bytes from BarSourceStream, which pulls |
| 19 filtered bytes from FooSourceStream, which in turn pulls raw bytes from the |
| 20 URLRequestJob. |
| 21 |
| 22 All source streams conform to the following interface (named SourceStream in the |
| 23 tree): |
| 24 |
| 25 int Read(IOBuffer* dest_buffer, size_t buffer_size, |
| 26 const OnReadCompleteCallback& callback); |
| 27 |
| 28 This function can return either synchronously or asynchronously via the supplied |
| 29 callback. The source stream chain is "pull-based", in that data does not |
| 30 propagate through the chain until requested by the final consumer of the |
| 31 filtered data. |
| OLD | NEW |