| OLD | NEW |
| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 * AsyncResourceHandler informs the ResourceDispatcher of each read using | 258 * AsyncResourceHandler informs the ResourceDispatcher of each read using |
| 259 cross-process IPCs. | 259 cross-process IPCs. |
| 260 * ResourceDispatcher tells the AsyncResourceHandler when it's done with the | 260 * ResourceDispatcher tells the AsyncResourceHandler when it's done with the |
| 261 data with each read, so it knows when parts of the buffer can be reused. | 261 data with each read, so it knows when parts of the buffer can be reused. |
| 262 | 262 |
| 263 Without waiting to hear back from the ResourceDispatcher, the ResourceLoader | 263 Without waiting to hear back from the ResourceDispatcher, the ResourceLoader |
| 264 tells its ResourceHandler chain to allocate memory to receive the response | 264 tells its ResourceHandler chain to allocate memory to receive the response |
| 265 body. The AsyncResourceHandler creates a 512KB ring buffer of shared memory, | 265 body. The AsyncResourceHandler creates a 512KB ring buffer of shared memory, |
| 266 and then passes the first 32KB of it to the ResourceLoader for the first read. | 266 and then passes the first 32KB of it to the ResourceLoader for the first read. |
| 267 The ResourceLoader then passes a 32KB body read request down through the | 267 The ResourceLoader then passes a 32KB body read request down through the |
| 268 URLRequest all the way down to the HttpResponseParser. Once some data is read, | 268 URLRequest all the way down to the HttpStreamParser. Once some data is read, |
| 269 possibly less than 32KB, the number of bytes read makes its way back to the | 269 possibly less than 32KB, the number of bytes read makes its way back to the |
| 270 AsyncResourceHandler, which passes the shared memory buffer and the offset and | 270 AsyncResourceHandler, which passes the shared memory buffer and the offset and |
| 271 amount of data read to the renderer process. | 271 amount of data read to the renderer process. |
| 272 | 272 |
| 273 The AsyncResourceHandler relies on ACKs from the renderer to prevent it from | 273 The AsyncResourceHandler relies on ACKs from the renderer to prevent it from |
| 274 overwriting data that the renderer has yet to consume. This process repeats | 274 overwriting data that the renderer has yet to consume. This process repeats |
| 275 until the response body is completely read. | 275 until the response body is completely read. |
| 276 | 276 |
| 277 ### URLRequest is destroyed | 277 ### URLRequest is destroyed |
| 278 | 278 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 connection is established, the first usable connection goes to the highest | 503 connection is established, the first usable connection goes to the highest |
| 504 priority socket request. | 504 priority socket request. |
| 505 | 505 |
| 506 ## Non-HTTP Schemes | 506 ## Non-HTTP Schemes |
| 507 | 507 |
| 508 The URLRequestJobFactory has a ProtocolHander for each supported scheme. | 508 The URLRequestJobFactory has a ProtocolHander for each supported scheme. |
| 509 Non-HTTP URLRequests have their own ProtocolHandlers. Some are implemented in | 509 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 | 510 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, | 511 internally), and others are implemented in content/ or chrome (like blob, |
| 512 chrome, and chrome-extension). | 512 chrome, and chrome-extension). |
| OLD | NEW |