Bug 1616788 - Part 4: Set the hasStoragePermission when opening the channel in the parent process. r=dimi,baku

We do the pre-calculation of the storage permission in the parent
process when opening the channel.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim Huang 2020-03-30 14:10:40 +00:00
Родитель 25127e841e
Коммит 87f4ac4589
2 изменённых файлов: 7 добавлений и 0 удалений

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

@ -400,6 +400,9 @@ bool DocumentLoadListener::Open(
httpBaseChannel->SetTopWindowURI(topWindowURI);
}
Unused << loadInfo->SetHasStoragePermission(
AntiTrackingUtils::HasStoragePermissionInParent(mChannel));
nsCOMPtr<nsIIdentChannel> identChannel = do_QueryInterface(mChannel);
if (identChannel) {
Unused << identChannel->SetChannelId(aChannelId);

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

@ -55,6 +55,7 @@
#include "nsThreadUtils.h"
#include "GeckoProfiler.h"
#include "nsIConsoleService.h"
#include "mozilla/AntiTrackingUtils.h"
#include "mozilla/Attributes.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ContentBlocking.h"
@ -6481,6 +6482,9 @@ nsHttpChannel::AsyncOpen(nsIStreamListener* aListener) {
return NS_ERROR_NOT_AVAILABLE;
}
Unused << mLoadInfo->SetHasStoragePermission(
AntiTrackingUtils::HasStoragePermissionInParent(this));
static bool sRCWNInited = false;
if (!sRCWNInited) {
sRCWNInited = true;