Commit 55d2025a authored by Dominic Farolino's avatar Dominic Farolino Committed by Commit Bot

Elaborate on Network Service reconnection in README

https://crrev.com/c/2215523 added some more documentation about the
Network Service and how it can crash and recover. This CL aims to
elaborate on this a bit, explaining that if you have a URLLoaderFactory
that you made, it shouldn't just keep working perfectly after the
Network Service is restarted.

R=falken@chromium.org, kinuko@chromium.org, lingqi@chromium.org

Change-Id: I2f28746990eb21805f56862f635860f145088109
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218310
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774983}
parent 276b5692
...@@ -74,9 +74,20 @@ the `network::NetworkService` instance. ...@@ -74,9 +74,20 @@ the `network::NetworkService` instance.
# What happens if the network service crashes? # What happens if the network service crashes?
*In the out-of-process case*: If the network service crashes, it gets restarted *In the out-of-process case*: If the network service crashes, it gets restarted
in a new utility process. The goal is for the failure to be mostly recoverable: in a new utility process. The goal is for the failure to be mostly recoverable.
some in-flight requests may fail, but any tabs open will continue to function It is important to note that any URLLoaderFactories bound to the Network Service
and later requests will succeed. before it crashes become disconnected, and will no longer continue to work.
Therefore it is useful to establish reconnection logic if it is detected that
the URLLoaderFactory is no longer connected.
For example, a navigation request's URLLoaderFactory comes from
`StoragePartitionImpl::GetURLLoaderFactoryForBrowserProcessInternal` in the
browser process. This method has logic to detect if the URLLoaderFactory it
would normally return is disconnected. In that case, it creates a new one which
is used for all future navigation requests. Since most URLLoaderFactory users
use factories that are not created out-of-band, and are provided by some
service, reconnection logic is often implemented for free, and is usually not
something to worry about.
*In the in-process case*: If the network service crashes in this case, of *In the in-process case*: If the network service crashes in this case, of
course, the entire browser crashes. This is one reason for the goal to always course, the entire browser crashes. This is one reason for the goal to always
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment