Skip to content

Commit

Permalink
Bug 1545909 - Part 1 of 2: Recheck whether to use appcache on the par…
Browse files Browse the repository at this point in the history
…ent process on the redirected top-level loading channel, r=michal

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
mayhemer committed Feb 10, 2020
1 parent b903fe6 commit 3dd48dc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion netwerk/protocol/http/HttpChannelParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3dd48dc

Please sign in to comment.