mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 1640135 - P2: add new setter; r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D77915
This commit is contained in:
parent
edb1e5a899
commit
fd2c048140
@ -160,6 +160,19 @@ void OriginAttributes::SetFirstPartyDomain(const bool aIsTopLevelDocument,
|
||||
mFirstPartyDomain = aDomain;
|
||||
}
|
||||
|
||||
void OriginAttributes::SetPartitionKey(nsIURI* aURI) {
|
||||
// TODO: implement this function
|
||||
MOZ_ASSERT(false);
|
||||
}
|
||||
|
||||
void OriginAttributes::SetPartitionKey(const nsACString& aDomain) {
|
||||
SetPartitionKey(NS_ConvertUTF8toUTF16(aDomain));
|
||||
}
|
||||
|
||||
void OriginAttributes::SetPartitionKey(const nsAString& aDomain) {
|
||||
mPartitionKey = aDomain;
|
||||
}
|
||||
|
||||
void OriginAttributes::CreateSuffix(nsACString& aStr) const {
|
||||
URLParams params;
|
||||
nsAutoString value;
|
||||
|
@ -32,6 +32,10 @@ class OriginAttributes : public dom::OriginAttributesDictionary {
|
||||
void SetFirstPartyDomain(const bool aIsTopLevelDocument,
|
||||
const nsAString& aDomain, bool aForced = false);
|
||||
|
||||
void SetPartitionKey(nsIURI* aURI);
|
||||
void SetPartitionKey(const nsACString& aDomain);
|
||||
void SetPartitionKey(const nsAString& aDomain);
|
||||
|
||||
enum {
|
||||
STRIP_FIRST_PARTY_DOMAIN = 0x01,
|
||||
STRIP_USER_CONTEXT_ID = 0x02,
|
||||
|
@ -47,11 +47,11 @@ bool ChooseOriginAttributes(nsIChannel* aChannel, OriginAttributes& aAttrs,
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString domain;
|
||||
Unused << cjs->GetFirstPartyDomain(domain);
|
||||
nsAutoString partitionKey;
|
||||
Unused << cjs->GetFirstPartyDomain(partitionKey);
|
||||
|
||||
if (!domain.IsEmpty()) {
|
||||
aAttrs.SetFirstPartyDomain(false, domain, true /* aForced */);
|
||||
if (!partitionKey.IsEmpty()) {
|
||||
aAttrs.SetPartitionKey(partitionKey);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ bool ChooseOriginAttributes(nsIChannel* aChannel, OriginAttributes& aAttrs,
|
||||
return false;
|
||||
}
|
||||
|
||||
aAttrs.SetFirstPartyDomain(false, principalURI, true /* aForced */);
|
||||
aAttrs.SetPartitionKey(principalURI);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user