Skip to content

Commit 58d36f7

Browse files
Bug 1835907, part 1 - Add has storage access bit and triggering window id to the LoadInfo - r=smaug,necko-reviewers,kershaw,pbz
In the Storage Access API's latest draft, a few items were added to the user-agent state. Relevant here, the source snapshot params gained two fields that are initialized from the sourceDocument during snapshotting source params while navigating: "has storage access" and "environment id". https://privacycg.github.io/storage-access/#ua-state These are used to identify self-initiated navigations that come from documents that have obtained storage access. Combined with a same-origin check, this determines if the destination document of the navigation should start with storage access. This is stricter than the current behavior, where if the permission is available, all documents start with storage access. Instead, now a document will only have storage access if it requests it explicitly or if a same-origin document that has storage access navigates itself to that document. This is seen as a security win. Security discussion of this change was here: privacycg/storage-access#113 Artur at Google wrote up a great summary here: https://docs.google.com/document/d/1AsrETl-7XvnZNbG81Zy9BcZfKbqACQYBSrjM3VsIpjY/edit# Differential Revision: https://phabricator.services.mozilla.com/D184821
1 parent 8349767 commit 58d36f7

13 files changed

+185
-6
lines changed

docshell/base/nsDocShell.cpp

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4014,6 +4014,13 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aErrorURI, nsIURI* aFailedURI,
40144014
loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
40154015
if (mBrowsingContext) {
40164016
loadState->SetTriggeringSandboxFlags(mBrowsingContext->GetSandboxFlags());
4017+
loadState->SetTriggeringWindowId(
4018+
mBrowsingContext->GetCurrentInnerWindowId());
4019+
nsPIDOMWindowInner* innerWin = mScriptGlobal->GetCurrentInnerWindow();
4020+
if (innerWin) {
4021+
loadState->SetTriggeringStorageAccess(
4022+
innerWin->HasStorageAccessPermissionGranted());
4023+
}
40174024
}
40184025
loadState->SetLoadType(LOAD_ERROR_PAGE);
40194026
loadState->SetFirstParty(true);
@@ -4200,6 +4207,8 @@ nsresult nsDocShell::ReloadDocument(nsDocShell* aDocShell, Document* aDocument,
42004207
nsIPrincipal* triggeringPrincipal = aDocument->NodePrincipal();
42014208
nsCOMPtr<nsIContentSecurityPolicy> csp = aDocument->GetCsp();
42024209
uint32_t triggeringSandboxFlags = aDocument->GetSandboxFlags();
4210+
uint64_t triggeringWindowId = aDocument->InnerWindowID();
4211+
bool triggeringStorageAccess = aDocument->HasStorageAccessPermissionGranted();
42034212

42044213
nsAutoString contentTypeHint;
42054214
aDocument->GetContentType(contentTypeHint);
@@ -4246,6 +4255,8 @@ nsresult nsDocShell::ReloadDocument(nsDocShell* aDocShell, Document* aDocument,
42464255
loadState->SetLoadReplace(loadReplace);
42474256
loadState->SetTriggeringPrincipal(triggeringPrincipal);
42484257
loadState->SetTriggeringSandboxFlags(triggeringSandboxFlags);
4258+
loadState->SetTriggeringWindowId(triggeringWindowId);
4259+
loadState->SetTriggeringStorageAccess(triggeringStorageAccess);
42494260
loadState->SetPrincipalToInherit(triggeringPrincipal);
42504261
loadState->SetCsp(csp);
42514262
loadState->SetInternalLoadFlags(flags);
@@ -5233,6 +5244,9 @@ nsDocShell::ForceRefreshURI(nsIURI* aURI, nsIPrincipal* aPrincipal,
52335244
loadState->SetHasValidUserGestureActivation(
52345245
doc->HasValidTransientUserGestureActivation());
52355246
loadState->SetTriggeringSandboxFlags(doc->GetSandboxFlags());
5247+
loadState->SetTriggeringWindowId(doc->InnerWindowID());
5248+
loadState->SetTriggeringStorageAccess(
5249+
doc->HasStorageAccessPermissionGranted());
52365250
}
52375251

52385252
loadState->SetPrincipalIsExplicit(true);
@@ -8574,6 +8588,9 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) {
85748588
loadState->SetTriggeringPrincipal(aLoadState->TriggeringPrincipal());
85758589
loadState->SetTriggeringSandboxFlags(
85768590
aLoadState->TriggeringSandboxFlags());
8591+
loadState->SetTriggeringWindowId(aLoadState->TriggeringWindowId());
8592+
loadState->SetTriggeringStorageAccess(
8593+
aLoadState->TriggeringStorageAccess());
85778594
loadState->SetCsp(aLoadState->Csp());
85788595
loadState->SetInheritPrincipal(aLoadState->HasInternalLoadFlags(
85798596
INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL));
@@ -10511,9 +10528,18 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
1051110528
}
1051210529
}
1051310530

10514-
if (mLoadType != LOAD_ERROR_PAGE && context && context->IsInProcess() &&
10515-
context->HasValidTransientUserGestureActivation()) {
10516-
aLoadState->SetHasValidUserGestureActivation(true);
10531+
if (mLoadType != LOAD_ERROR_PAGE && context && context->IsInProcess()) {
10532+
if (context->HasValidTransientUserGestureActivation()) {
10533+
aLoadState->SetHasValidUserGestureActivation(true);
10534+
}
10535+
aLoadState->SetTriggeringWindowId(context->Id());
10536+
if (!aLoadState->TriggeringStorageAccess()) {
10537+
Document* contextDoc = context->GetExtantDoc();
10538+
if (contextDoc) {
10539+
aLoadState->SetTriggeringStorageAccess(
10540+
contextDoc->HasStorageAccessPermissionGranted());
10541+
}
10542+
}
1051710543
}
1051810544

1051910545
// in case this docshell load was triggered by a valid transient user gesture,
@@ -10523,6 +10549,9 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
1052310549
aLoadState->HasLoadFlags(LOAD_FLAGS_FROM_EXTERNAL)) {
1052410550
loadInfo->SetHasValidUserGestureActivation(true);
1052510551
}
10552+
10553+
loadInfo->SetTriggeringWindowId(aLoadState->TriggeringWindowId());
10554+
loadInfo->SetTriggeringStorageAccess(aLoadState->TriggeringStorageAccess());
1052610555
loadInfo->SetTriggeringSandboxFlags(aLoadState->TriggeringSandboxFlags());
1052710556
loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh());
1052810557

@@ -13040,8 +13069,13 @@ nsresult nsDocShell::OnLinkClickSync(nsIContent* aContent,
1304013069
}
1304113070
}
1304213071
uint32_t triggeringSandboxFlags = 0;
13072+
uint64_t triggeringWindowId = 0;
13073+
bool triggeringStorageAccess = false;
1304313074
if (mBrowsingContext) {
1304413075
triggeringSandboxFlags = aContent->OwnerDoc()->GetSandboxFlags();
13076+
triggeringWindowId = aContent->OwnerDoc()->InnerWindowID();
13077+
triggeringStorageAccess =
13078+
aContent->OwnerDoc()->HasStorageAccessPermissionGranted();
1304513079
}
1304613080

1304713081
uint32_t flags = INTERNAL_LOAD_FLAGS_NONE;
@@ -13149,6 +13183,8 @@ nsresult nsDocShell::OnLinkClickSync(nsIContent* aContent,
1314913183
RefPtr<WindowContext> context = mBrowsingContext->GetCurrentWindowContext();
1315013184

1315113185
aLoadState->SetTriggeringSandboxFlags(triggeringSandboxFlags);
13186+
aLoadState->SetTriggeringWindowId(triggeringWindowId);
13187+
aLoadState->SetTriggeringStorageAccess(triggeringStorageAccess);
1315213188
aLoadState->SetReferrerInfo(referrerInfo);
1315313189
aLoadState->SetInternalLoadFlags(flags);
1315413190
aLoadState->SetTypeHint(NS_ConvertUTF16toUTF8(typeHint));

docshell/base/nsDocShellLoadState.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ nsDocShellLoadState::nsDocShellLoadState(
8686
mPrincipalToInherit = aLoadState.PrincipalToInherit();
8787
mPartitionedPrincipalToInherit = aLoadState.PartitionedPrincipalToInherit();
8888
mTriggeringSandboxFlags = aLoadState.TriggeringSandboxFlags();
89+
mTriggeringWindowId = aLoadState.TriggeringWindowId();
90+
mTriggeringStorageAccess = aLoadState.TriggeringStorageAccess();
8991
mTriggeringRemoteType = aLoadState.TriggeringRemoteType();
9092
mCsp = aLoadState.Csp();
9193
mOriginalURIString = aLoadState.OriginalURIString();
@@ -150,6 +152,8 @@ nsDocShellLoadState::nsDocShellLoadState(const nsDocShellLoadState& aOther)
150152
mResultPrincipalURIIsSome(aOther.mResultPrincipalURIIsSome),
151153
mTriggeringPrincipal(aOther.mTriggeringPrincipal),
152154
mTriggeringSandboxFlags(aOther.mTriggeringSandboxFlags),
155+
mTriggeringWindowId(aOther.mTriggeringWindowId),
156+
mTriggeringStorageAccess(aOther.mTriggeringStorageAccess),
153157
mCsp(aOther.mCsp),
154158
mKeepResultPrincipalURIIfSet(aOther.mKeepResultPrincipalURIIfSet),
155159
mLoadReplace(aOther.mLoadReplace),
@@ -204,6 +208,8 @@ nsDocShellLoadState::nsDocShellLoadState(nsIURI* aURI, uint64_t aLoadIdentifier)
204208
: mURI(aURI),
205209
mResultPrincipalURIIsSome(false),
206210
mTriggeringSandboxFlags(0),
211+
mTriggeringWindowId(0),
212+
mTriggeringStorageAccess(false),
207213
mKeepResultPrincipalURIIfSet(false),
208214
mLoadReplace(false),
209215
mInheritPrincipal(false),
@@ -443,6 +449,9 @@ nsresult nsDocShellLoadState::CreateFromLoadURIOptions(
443449
loadState->SetHasValidUserGestureActivation(
444450
aLoadURIOptions.mHasValidUserGestureActivation);
445451
loadState->SetTriggeringSandboxFlags(aLoadURIOptions.mTriggeringSandboxFlags);
452+
loadState->SetTriggeringWindowId(aLoadURIOptions.mTriggeringWindowId);
453+
loadState->SetTriggeringStorageAccess(
454+
aLoadURIOptions.mTriggeringStorageAccess);
446455
loadState->SetPostDataStream(postData);
447456
loadState->SetHeadersStream(aLoadURIOptions.mHeaders);
448457
loadState->SetBaseURI(aLoadURIOptions.mBaseURI);
@@ -562,6 +571,23 @@ uint32_t nsDocShellLoadState::TriggeringSandboxFlags() const {
562571
return mTriggeringSandboxFlags;
563572
}
564573

574+
void nsDocShellLoadState::SetTriggeringWindowId(uint64_t aTriggeringWindowId) {
575+
mTriggeringWindowId = aTriggeringWindowId;
576+
}
577+
578+
uint64_t nsDocShellLoadState::TriggeringWindowId() const {
579+
return mTriggeringWindowId;
580+
}
581+
582+
void nsDocShellLoadState::SetTriggeringStorageAccess(
583+
bool aTriggeringStorageAccess) {
584+
mTriggeringStorageAccess = aTriggeringStorageAccess;
585+
}
586+
587+
bool nsDocShellLoadState::TriggeringStorageAccess() const {
588+
return mTriggeringStorageAccess;
589+
}
590+
565591
bool nsDocShellLoadState::InheritPrincipal() const { return mInheritPrincipal; }
566592

567593
void nsDocShellLoadState::SetInheritPrincipal(bool aInheritPrincipal) {
@@ -1253,6 +1279,8 @@ DocShellLoadStateInit nsDocShellLoadState::Serialize(
12531279
loadState.PrincipalToInherit() = mPrincipalToInherit;
12541280
loadState.PartitionedPrincipalToInherit() = mPartitionedPrincipalToInherit;
12551281
loadState.TriggeringSandboxFlags() = mTriggeringSandboxFlags;
1282+
loadState.TriggeringWindowId() = mTriggeringWindowId;
1283+
loadState.TriggeringStorageAccess() = mTriggeringStorageAccess;
12561284
loadState.TriggeringRemoteType() = mTriggeringRemoteType;
12571285
loadState.Csp() = mCsp;
12581286
loadState.OriginalURIString() = mOriginalURIString;

docshell/base/nsDocShellLoadState.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ class nsDocShellLoadState final {
113113

114114
void SetTriggeringSandboxFlags(uint32_t aTriggeringSandboxFlags);
115115

116+
uint64_t TriggeringWindowId() const;
117+
118+
void SetTriggeringWindowId(uint64_t aTriggeringWindowId);
119+
120+
bool TriggeringStorageAccess() const;
121+
122+
void SetTriggeringStorageAccess(bool aTriggeringStorageAccess);
123+
116124
nsIContentSecurityPolicy* Csp() const;
117125

118126
void SetCsp(nsIContentSecurityPolicy* aCsp);
@@ -413,6 +421,12 @@ class nsDocShellLoadState final {
413421
// SandboxFlags of the document that started the load.
414422
uint32_t mTriggeringSandboxFlags;
415423

424+
// The window ID and current "has storage access" value of the entity
425+
// triggering the load. This allows the identification of self-initiated
426+
// same-origin navigations that should propogate unpartitioned storage access.
427+
uint64_t mTriggeringWindowId;
428+
bool mTriggeringStorageAccess;
429+
416430
// The CSP of the load, that is, the CSP of the entity responsible for causing
417431
// the load to occur. Most likely this is the CSP of the document that started
418432
// the load. In case the entity starting the load did not use a CSP, then mCsp

dom/ipc/DOMTypes.ipdlh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ struct DocShellLoadStateInit
200200
// The TriggineringSandboxFlags are the SandboxFlags of the entity
201201
// responsible for causing the load to occur.
202202
uint32_t TriggeringSandboxFlags;
203+
uint64_t TriggeringWindowId;
204+
bool TriggeringStorageAccess;
203205
int32_t? CancelContentJSEpoch;
204206

205207
bool ResultPrincipalURIIsSome;

dom/webidl/LoadURIOptions.webidl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ dictionary LoadURIOptions {
7575
*/
7676
unsigned long triggeringSandboxFlags = 0;
7777

78+
/**
79+
* The window id and storage access status of the window of the
80+
* context that triggered the load. This is used to allow self-initiated
81+
* same-origin navigations to propagate their "has storage access" bit
82+
* to the next Document.
83+
*/
84+
unsigned long long triggeringWindowId = 0;
85+
boolean triggeringStorageAccess = false;
86+
7887
/**
7988
* The RemoteType of the entity that's responsible for the load. Defaults to
8089
* the current process.

ipc/glue/BackgroundUtils.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ nsresult LoadInfoToLoadInfoArgs(nsILoadInfo* aLoadInfo,
546546
topLevelPrincipalInfo, optionalResultPrincipalURI, triggeringRemoteType,
547547
aLoadInfo->GetSandboxedNullPrincipalID(), aLoadInfo->GetSecurityFlags(),
548548
aLoadInfo->GetSandboxFlags(), aLoadInfo->GetTriggeringSandboxFlags(),
549+
aLoadInfo->GetTriggeringWindowId(),
550+
aLoadInfo->GetTriggeringStorageAccess(),
549551
aLoadInfo->InternalContentPolicyType(),
550552
static_cast<uint32_t>(aLoadInfo->GetTainting()),
551553
aLoadInfo->GetBlockAllMixedContent(),
@@ -829,7 +831,8 @@ nsresult LoadInfoArgsToLoadInfo(const LoadInfoArgs& loadInfoArgs,
829831
triggeringRemoteType, loadInfoArgs.sandboxedNullPrincipalID(), clientInfo,
830832
reservedClientInfo, initialClientInfo, controller,
831833
loadInfoArgs.securityFlags(), loadInfoArgs.sandboxFlags(),
832-
loadInfoArgs.triggeringSandboxFlags(), loadInfoArgs.contentPolicyType(),
834+
loadInfoArgs.triggeringSandboxFlags(), loadInfoArgs.triggeringWindowId(),
835+
loadInfoArgs.triggeringStorageAccess(), loadInfoArgs.contentPolicyType(),
833836
static_cast<LoadTainting>(loadInfoArgs.tainting()),
834837
loadInfoArgs.blockAllMixedContent(),
835838
loadInfoArgs.upgradeInsecureRequests(),
@@ -928,6 +931,8 @@ void LoadInfoToParentLoadInfoForwarder(
928931
aLoadInfo->GetAllowDeprecatedSystemRequests(),
929932
aLoadInfo->GetIsInDevToolsContext(), aLoadInfo->GetParserCreatedScript(),
930933
aLoadInfo->GetTriggeringSandboxFlags(),
934+
aLoadInfo->GetTriggeringWindowId(),
935+
aLoadInfo->GetTriggeringStorageAccess(),
931936
aLoadInfo->GetServiceWorkerTaintingSynthesized(),
932937
aLoadInfo->GetDocumentHasUserInteracted(),
933938
aLoadInfo->GetAllowListFutureDocumentsCreatedFromThisRedirectChain(),
@@ -971,6 +976,13 @@ nsresult MergeParentLoadInfoForwarder(
971976
aForwarderArgs.triggeringSandboxFlags());
972977
NS_ENSURE_SUCCESS(rv, rv);
973978

979+
rv = aLoadInfo->SetTriggeringWindowId(aForwarderArgs.triggeringWindowId());
980+
NS_ENSURE_SUCCESS(rv, rv);
981+
982+
rv = aLoadInfo->SetTriggeringStorageAccess(
983+
aForwarderArgs.triggeringStorageAccess());
984+
NS_ENSURE_SUCCESS(rv, rv);
985+
974986
rv = aLoadInfo->SetHasValidUserGestureActivation(
975987
aForwarderArgs.hasValidUserGestureActivation());
976988
NS_ENSURE_SUCCESS(rv, rv);

netwerk/base/LoadInfo.cpp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
576576
mSecurityFlags(rhs.mSecurityFlags),
577577
mSandboxFlags(rhs.mSandboxFlags),
578578
mTriggeringSandboxFlags(rhs.mTriggeringSandboxFlags),
579+
mTriggeringWindowId(rhs.mTriggeringWindowId),
580+
mTriggeringStorageAccess(rhs.mTriggeringStorageAccess),
579581
mInternalContentPolicyType(rhs.mInternalContentPolicyType),
580582
mTainting(rhs.mTainting),
581583
mBlockAllMixedContent(rhs.mBlockAllMixedContent),
@@ -651,7 +653,8 @@ LoadInfo::LoadInfo(
651653
const Maybe<ClientInfo>& aInitialClientInfo,
652654
const Maybe<ServiceWorkerDescriptor>& aController,
653655
nsSecurityFlags aSecurityFlags, uint32_t aSandboxFlags,
654-
uint32_t aTriggeringSandboxFlags, nsContentPolicyType aContentPolicyType,
656+
uint32_t aTriggeringSandboxFlags, uint64_t aTriggeringWindowId,
657+
bool aTriggeringStorageAccess, nsContentPolicyType aContentPolicyType,
655658
LoadTainting aTainting, bool aBlockAllMixedContent,
656659
bool aUpgradeInsecureRequests, bool aBrowserUpgradeInsecureRequests,
657660
bool aBrowserDidUpgradeInsecureRequests,
@@ -699,6 +702,8 @@ LoadInfo::LoadInfo(
699702
mSecurityFlags(aSecurityFlags),
700703
mSandboxFlags(aSandboxFlags),
701704
mTriggeringSandboxFlags(aTriggeringSandboxFlags),
705+
mTriggeringWindowId(aTriggeringWindowId),
706+
mTriggeringStorageAccess(aTriggeringStorageAccess),
702707
mInternalContentPolicyType(aContentPolicyType),
703708
mTainting(aTainting),
704709
mBlockAllMixedContent(aBlockAllMixedContent),
@@ -975,6 +980,30 @@ LoadInfo::SetTriggeringSandboxFlags(uint32_t aFlags) {
975980
return NS_OK;
976981
}
977982

983+
NS_IMETHODIMP
984+
LoadInfo::GetTriggeringWindowId(uint64_t* aResult) {
985+
*aResult = mTriggeringWindowId;
986+
return NS_OK;
987+
}
988+
989+
NS_IMETHODIMP
990+
LoadInfo::SetTriggeringWindowId(uint64_t aFlags) {
991+
mTriggeringWindowId = aFlags;
992+
return NS_OK;
993+
}
994+
995+
NS_IMETHODIMP
996+
LoadInfo::GetTriggeringStorageAccess(bool* aResult) {
997+
*aResult = mTriggeringStorageAccess;
998+
return NS_OK;
999+
}
1000+
1001+
NS_IMETHODIMP
1002+
LoadInfo::SetTriggeringStorageAccess(bool aFlags) {
1003+
mTriggeringStorageAccess = aFlags;
1004+
return NS_OK;
1005+
}
1006+
9781007
NS_IMETHODIMP
9791008
LoadInfo::GetSecurityMode(uint32_t* aFlags) {
9801009
*aFlags = (mSecurityFlags &

netwerk/base/LoadInfo.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ class LoadInfo final : public nsILoadInfo {
212212
const Maybe<mozilla::dom::ClientInfo>& aInitialClientInfo,
213213
const Maybe<mozilla::dom::ServiceWorkerDescriptor>& aController,
214214
nsSecurityFlags aSecurityFlags, uint32_t aSandboxFlags,
215-
uint32_t aTriggeringSandboxFlags, nsContentPolicyType aContentPolicyType,
215+
uint32_t aTriggeringSandboxFlags, uint64_t aTriggeringWindowId,
216+
bool aTriggeringStorageAccess, nsContentPolicyType aContentPolicyType,
216217
LoadTainting aTainting, bool aBlockAllMixedContent,
217218
bool aUpgradeInsecureRequests, bool aBrowserUpgradeInsecureRequests,
218219
bool aBrowserDidUpgradeInsecureRequests,
@@ -306,6 +307,8 @@ class LoadInfo final : public nsILoadInfo {
306307
nsSecurityFlags mSecurityFlags;
307308
uint32_t mSandboxFlags;
308309
uint32_t mTriggeringSandboxFlags = 0;
310+
uint64_t mTriggeringWindowId = 0;
311+
bool mTriggeringStorageAccess = false;
309312
nsContentPolicyType mInternalContentPolicyType;
310313
LoadTainting mTainting = LoadTainting::Basic;
311314
bool mBlockAllMixedContent = false;

netwerk/base/TRRLoadInfo.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,24 @@ TRRLoadInfo::SetTriggeringSandboxFlags(uint32_t aResult) {
114114
return NS_ERROR_NOT_IMPLEMENTED;
115115
}
116116

117+
NS_IMETHODIMP
118+
TRRLoadInfo::GetTriggeringWindowId(uint64_t* aResult) {
119+
return NS_ERROR_NOT_IMPLEMENTED;
120+
}
121+
NS_IMETHODIMP
122+
TRRLoadInfo::SetTriggeringWindowId(uint64_t aResult) {
123+
return NS_ERROR_NOT_IMPLEMENTED;
124+
}
125+
126+
NS_IMETHODIMP
127+
TRRLoadInfo::GetTriggeringStorageAccess(bool* aResult) {
128+
return NS_ERROR_NOT_IMPLEMENTED;
129+
}
130+
NS_IMETHODIMP
131+
TRRLoadInfo::SetTriggeringStorageAccess(bool aResult) {
132+
return NS_ERROR_NOT_IMPLEMENTED;
133+
}
134+
117135
NS_IMETHODIMP
118136
TRRLoadInfo::GetSecurityMode(uint32_t* aFlags) {
119137
return NS_ERROR_NOT_IMPLEMENTED;

netwerk/base/nsILoadInfo.idl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,16 @@ interface nsILoadInfo : nsISupports
432432
*/
433433
[infallible] attribute unsigned long triggeringSandboxFlags;
434434

435+
436+
/**
437+
* The window id and storage access status of the window of the
438+
* context that triggered the load. This is used to allow self-initiated
439+
* same-origin navigations to propogate their "has storage access" bit
440+
* to the next Document.
441+
*/
442+
[infallible] attribute unsigned long long triggeringWindowId;
443+
[infallible] attribute boolean triggeringStorageAccess;
444+
435445
/**
436446
* Allows to query only the security mode bits from above.
437447
*/

0 commit comments

Comments
 (0)