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

Side by Side Diff: net/docs/life-of-a-url-request.md

Issue 1240653004: Update life-of-a-url-request.md: Replace IPCResourceLoaderBridge with RequestPeer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Life of a URLRequest 1 # Life of a URLRequest
2 2
3 This document is intended as an overview of the core layers of the network 3 This document is intended as an overview of the core layers of the network
4 stack, their basic responsibilities, how they fit together, and where some of 4 stack, their basic responsibilities, how they fit together, and where some of
5 the pain points are, without going into too much detail. Though it touches a 5 the pain points are, without going into too much detail. Though it touches a
6 bit on child processes and the content/loader stack, the focus is on net/ 6 bit on child processes and the content/loader stack, the focus is on net/
7 itself. 7 itself.
8 8
9 It's particularly targeted at people new to the Chrome network stack, but 9 It's particularly targeted at people new to the Chrome network stack, but
10 should also be useful for team members who may be experts at some parts of the 10 should also be useful for team members who may be experts at some parts of the
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 request, the response is uncompressed, no matching entry in the cache, and there 96 request, the response is uncompressed, no matching entry in the cache, and there
97 are no idle sockets connected to the server in the socket pool. 97 are no idle sockets connected to the server in the socket pool.
98 98
99 Continuing with a "simple" URLRequest, here's a bit more detail on how things 99 Continuing with a "simple" URLRequest, here's a bit more detail on how things
100 work. 100 work.
101 101
102 ### Request starts in a child process 102 ### Request starts in a child process
103 103
104 Summary: 104 Summary:
105 105
106 * ResourceDispatcher creates an IPCResourceLoaderBridge. 106 * A user (e.g. the WebURLLoaderImpl for Blink) asks ResourceDispatcher to start
107 * The IPCResourceLoaderBridge asks ResourceDispatcher to start the request. 107 the request.
108 * ResourceDispatcher sends an IPC to the ResourceDispatcherHost in the 108 * ResourceDispatcher sends an IPC to the ResourceDispatcherHost in the
109 browser process. 109 browser process.
110 110
111 Chrome has a single browser process, which handles network requests and tab 111 Chrome has a single browser process, which handles network requests and tab
112 management, among other things, and multiple child processes, which are 112 management, among other things, and multiple child processes, which are
113 generally sandboxed so can't send out network requests directly. There are 113 generally sandboxed so can't send out network requests directly. There are
114 multiple types of child processes (renderer, GPU, plugin, etc). The renderer 114 multiple types of child processes (renderer, GPU, plugin, etc). The renderer
115 processes are the ones that layout webpages and run HTML. 115 processes are the ones that layout webpages and run HTML.
116 116
117 Each child process has at most one ResourceDispatcher, which is responsible for 117 Each child process has at most one ResourceDispatcher, which is responsible for
118 all URL request-related communication with the browser process. When something 118 all URL request-related communication with the browser process. When something
119 in another process needs to issue a resource request, it calls into the 119 in another process needs to issue a resource request, it calls into the
120 ResourceDispatcher, which returns an IPCResourceLoaderBridge to the caller. 120 ResourceDispatcher to start a request. When started, the
mmenke 2015/07/17 12:29:34 Should mention that a RequestPeer is passed in to
tyoshino (SeeGerritForStatus) 2015/07/17 13:07:15 Done.
121 The caller uses the bridge to start a request. When started, the
122 ResourceDispatcher assigns the request a per-renderer ID, and then sends the 121 ResourceDispatcher assigns the request a per-renderer ID, and then sends the
123 ID, along with all information needed to issue the request, to the 122 ID, along with all information needed to issue the request, to the
124 ResourceDispatcherHost in the browser process. 123 ResourceDispatcherHost in the browser process.
125 124
126 ### ResourceDispatcherHost sets up the request in the browser process 125 ### ResourceDispatcherHost sets up the request in the browser process
127 126
128 Summary: 127 Summary:
129 128
130 * ResourceDispatcherHost uses the URLRequestContext to create the URLRequest. 129 * ResourceDispatcherHost uses the URLRequestContext to create the URLRequest.
131 * ResourceDispatcherHost creates a ResourceLoader and a chain of 130 * ResourceDispatcherHost creates a ResourceLoader and a chain of
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 response headers, and then passes them up through both the 235 response headers, and then passes them up through both the
237 HttpNetworkTransaction and HttpCache::Transaction to the URLRequestHttpJob. The 236 HttpNetworkTransaction and HttpCache::Transaction to the URLRequestHttpJob. The
238 URLRequestHttpJob saves any cookies, if needed, and then passes the headers up 237 URLRequestHttpJob saves any cookies, if needed, and then passes the headers up
239 to the URLRequest and on to the ResourceLoader. 238 to the URLRequest and on to the ResourceLoader.
240 239
241 The ResourceLoader passes them through the chain of ResourceHandlers, and then 240 The ResourceLoader passes them through the chain of ResourceHandlers, and then
242 they make their way to the AsyncResourceHandler. The AsyncResourceHandler uses 241 they make their way to the AsyncResourceHandler. The AsyncResourceHandler uses
243 the renderer process ID ("child ID") to figure out which process the request 242 the renderer process ID ("child ID") to figure out which process the request
244 was associated with, and then sends the headers along with the request ID to 243 was associated with, and then sends the headers along with the request ID to
245 that process's ResourceDispatcher. The ResourceDispatcher uses the ID to 244 that process's ResourceDispatcher. The ResourceDispatcher uses the ID to
246 figure out which IPCResourceLoaderBridge the headers should be sent to, which 245 figure out which RequestPeer the headers should be sent to, which
247 sends them on to whatever created the IPCResourceLoaderBridge in the first 246 sends them on to the RequestPeer.
248 place.
249 247
250 ### Response body is read 248 ### Response body is read
251 249
252 Summary: 250 Summary:
253 251
254 * AsyncResourceHandler allocates a 512k ring buffer of shared memory to read 252 * AsyncResourceHandler allocates a 512k ring buffer of shared memory to read
255 the body of the request. 253 the body of the request.
256 * AsyncResourceHandler tells the ResourceLoader to read the response body to 254 * AsyncResourceHandler tells the ResourceLoader to read the response body to
257 the buffer, 32kB at a time. 255 the buffer, 32kB at a time.
258 * AsyncResourceHandler informs the ResourceDispatcher of each read using 256 * AsyncResourceHandler informs the ResourceDispatcher of each read using
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 connection is established, the first usable connection goes to the highest 501 connection is established, the first usable connection goes to the highest
504 priority socket request. 502 priority socket request.
505 503
506 ## Non-HTTP Schemes 504 ## Non-HTTP Schemes
507 505
508 The URLRequestJobFactory has a ProtocolHander for each supported scheme. 506 The URLRequestJobFactory has a ProtocolHander for each supported scheme.
509 Non-HTTP URLRequests have their own ProtocolHandlers. Some are implemented in 507 Non-HTTP URLRequests have their own ProtocolHandlers. Some are implemented in
510 net/, (like FTP, file, and data, though the renderer handles some data URLs 508 net/, (like FTP, file, and data, though the renderer handles some data URLs
511 internally), and others are implemented in content/ or chrome (like blob, 509 internally), and others are implemented in content/ or chrome (like blob,
512 chrome, and chrome-extension). 510 chrome, and chrome-extension).
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698