mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
34e62a0d9c
This is done using slightly different mechanisms for each of LoadInfo and nsDocShellLoadState, and will be used in the next part to validate document loads based on the RemoteType responsible for the load. For subresource loads, the TriggeringRemoteType is fairly straightforward - it is the process which created the channel. We can handle this by getting the current remote type when creating the channel, and then using the remote type of the sending process when receiving the LoadInfo over IPC to either replace the triggering remote type, or validate it. For document loads, the situation is a bit more complex, as there are at least 3 (potentially-)different processes responsible for different parts of the navigation: 1. The "Triggering Process" is the process which provided the URI to load. This is also the process which provides the Triggering Principal. This is the process being tracked in this patch. 2. The "Loading Process" is the process which actually creates the channel and starts the load. This may be the same as the triggering process, or may be a different process starting the navigation on behalf of the triggering process. In general this is the process hosting the current docshell, though it may be the parent process in the case of parent-initiated loads. 3. The "Final Process" is the process which receives the response and renders the final document. This isn't known at channel creation time, and is determined by the result principal and process isolation policy. This change uses a serializer and special field on nsDocShellLoadState to track the "Triggering Process" for the load, even as the load state is serialized between processes by tracking which loads were sent into which content processes, and matching them up when the parent process sees them again. The information is then copied into the LoadInfo before configuring the real channel, so it can be used for security checks. The "Triggering Process" is overridden to be the parent process for history loads, as history loads are often started in processes which wouldn't normally be able to navigate to those pages. This is OK thanks to the changes in part 1 which validate history loads against the real session history when SHIP is enabled. Differential Revision: https://phabricator.services.mozilla.com/D161198 |
||
---|---|---|
.. | ||
base | ||
build | ||
shistory | ||
test | ||
moz.build |