зеркало из https://github.com/mozilla/gecko-dev.git
b9501927ed
This patch adds a task that is dispatched to the background thread when TRR is first enabled. This may mean during the TRRService initialization at startup or later when the pref is flipped. The task will call into rust_parse_etc_hosts which does the actual file opening and parsing. We pass the path to the file, that being either /etc/hosts or the Windows equivalent obtained by calling SHGetSpecialFolderPathA. The rust code opens the file and proceeds to read it line by line while accumulating all the hostnames in an array. Since these files can be quite large, on the order of several megabytes, we need to make sure we don't block shutdown doing this - so once more than 100 domains have accumulated in the array we call back into C++ code to add them to the exclusion list. The callback will return true if we should continue to parse the file or false otherwise. We also change the tests to use "excluded" rather than localhost when testing the excluded-domains prefs, since localhost is unually present in /etc/hosts and may interfere with the test. We also use an atomic sTRRServicePtr to make sure that we don't have a data race between the TRRService being freed and the callbacks of the parsing. Differential Revision: https://phabricator.services.mozilla.com/D90663 |
||
---|---|---|
.. | ||
browser | ||
crashtests | ||
fuzz | ||
gtest | ||
http3server | ||
http3serverDB | ||
httpserver | ||
mochitests | ||
perf | ||
reftest | ||
unit | ||
unit_ipc | ||
moz.build |