It looks like the primary difficulty here is with the magic in QuotaPolicyCookieStore and QuotaPolicyChannelIDStore. Curiously, neither of them seems to actually implement a quota. Instead, they both use SpecialStoragePolicy to track URLs that have been marked "session only" by an extension, and delete all added cookies/channel IDs for such sessions on shutdown.
They ignore entries that already existed on load.
Bizarrely, if extensions are enabled, we use ExtensionsSpecialStoragePolicy, otherwise, we use nullptr, but ExtensionsSpecialStoragePolicy just defers to the cookie settings object for the current profile (CookieSettings::IsCookieSessionOnly), so apparently we ignore the profile settings entirely when not built with extensions for no reason I can see, though it's possible interesting cookie settings only come from extensions, I suppose.
Anyhow, we have two options, if we want to keep current behavior: Implement CookieSettings::GetCookieSetting behavior in the network service, or have the browser process monitor all set/cleared cookies, and have it implement that behavior instead. Worth noting that the UI thread already monitors all cookies involved in each page load, so the second option may not be as bad as it sounds. Also worth noting, however, that other things in the network process need cookie settings (Most notably, the decision of whether we allow a cookie to be set in the first place or not), so we may have to move it over to the network service anyways.
Anyhow, sorting this all out will probably take a fair bit of effort.
Comment 1 by mmenke@chromium.org
, Aug 22 2017Blocking: 715695