Skip to content

adblock: Use a single cache directory

Moves the adblock/ subdirectory from the profile directory to the default cache directory. This makes all different kind of Epiphany instances (normal, incognito, webapps) share the same directory for storing compiled filters and their metadata.

Sharing the adblock/ subdirectory is desirable to avoid unneeded re-downloads of rule sets (e.g. currently opening a new incognito window creates a new profile directory, which does not have previosly downloaded filters), to make multiple WebKitNetworkProcess instances share files (they map the compiled files, so using the same ones reduces virtual memory pressure and enables more memory page sharing), and also the user experience is improved (no need to wait for rule sets to download whenever e.g. an incognito window is opened: the existing ones will be reused).

Using the same directory from multiple processes is possible: all the Epiphany instances use the same GSettings value for the list of rule sets (hence, all expect the same contents to be present, or will create the same files in the directory), and the part managed by WebKit (the adblock/compiled/ subdirectory) is safe to use from multiple processes (temporary files are used while compiling rule sets, then moved to their final location; reading is only done through memory mappings and the kernel will keep the backing data in the filesystem for removed files if needed).

Edited by Adrián Pérez de Castro

Merge request reports