Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: net/docs/filter.md

Issue 2251853002: Add net::SourceStream and net::FilterSourceStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a method to allow filter to specify whether it is done Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/filter/filter_source_stream.h » ('j') | net/filter/filter_source_stream.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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". Data
14 always flows from upstream to downstream:
Randy Smith (Not in Mondays) 2016/08/31 19:22:44 nit, suggestion: I find the last sentence redundan
xunjieli 2016/09/01 21:26:59 Done.
15
16 URLRequestJob <-- BarSourceStream <-- FooSourceStream <-- URLRequestJob
17 (URLRequestSourceStream)
18
19 Here URLRequestJob pulls filtered bytes from its upstream, BarSourceStream,
20 which pulls filtered bytes from FooSourceStream, which in turn pulls raw bytes
21 from URLRequestJob. URLRequestSourceStream is the ultimate upstream, which
22 produces the raw data. Every stream in the chain owns its upstream. In this
23 case, the ultimate downstream, URLRequestJob, owns its upstream,
24 BarSourceStream, which in turn owns FooSourceStream. FooSourceStream owns its
25 upstream, URLRequestSourceStream.
26
27 All source streams conform to the following interface (named SourceStream in the
28 tree):
29
30 int Read(IOBuffer* dest_buffer, size_t buffer_size,
31 const OnReadCompleteCallback& callback);
32
33 This function can return either synchronously or asynchronously via the supplied
34 callback. The source stream chain is "pull-based", in that data does not
35 propagate through the chain until requested by the final consumer of the
36 filtered data.
OLDNEW
« no previous file with comments | « no previous file | net/filter/filter_source_stream.h » ('j') | net/filter/filter_source_stream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698