Bug 1545909 - Part 1 of 2: Recheck whether to use appcache on the parent process on the redirected top-level loading channel, r=michal

Differential Revision: https://phabricator.services.mozilla.com/D61842

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Honza Bambas 2020-02-10 09:15:26 +00:00
Родитель b903fe63d9
Коммит 3dd48dc331
1 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -914,7 +914,22 @@ mozilla::ipc::IPCResult HttpChannelParent::RecvRedirect2Verify(
nsCOMPtr<nsIApplicationCacheChannel> appCacheChannel =
do_QueryInterface(newHttpChannel);
if (appCacheChannel) {
appCacheChannel->SetChooseApplicationCache(aChooseAppcache);
bool setChooseAppCache = false;
if (aChooseAppcache) {
nsCOMPtr<nsIURI> uri;
// Using GetURI because this is what DoAsyncOpen uses.
newHttpChannel->GetURI(getter_AddRefs(uri));
OriginAttributes attrs;
NS_GetOriginAttributes(newHttpChannel, attrs);
nsCOMPtr<nsIPrincipal> principal =
BasePrincipal::CreateContentPrincipal(uri, attrs);
setChooseAppCache = NS_ShouldCheckAppCache(principal);
}
appCacheChannel->SetChooseApplicationCache(setChooseAppCache);
}
nsCOMPtr<nsILoadInfo> newLoadInfo = newHttpChannel->LoadInfo();