Bug 1639807 - Isolate image cache per first-party when privacy.partition.network_state is set to true - part 2 - Implementation, r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D76283
This commit is contained in:
@@ -170,6 +170,17 @@ nsCString ImageCacheKey::GetIsolationKey(Document* aDocument, nsIURI* aURI) {
|
||||
return EmptyCString();
|
||||
}
|
||||
|
||||
// Network-state isolation
|
||||
if (StaticPrefs::privacy_partition_network_state()) {
|
||||
OriginAttributes oa;
|
||||
StoragePrincipalHelper::GetOriginAttributesForNetworkState(aDocument, oa);
|
||||
|
||||
nsAutoCString suffix;
|
||||
oa.CreateSuffix(suffix);
|
||||
|
||||
return std::move(suffix);
|
||||
}
|
||||
|
||||
// If the window is 3rd party resource, let's see if first-party storage
|
||||
// access is granted for this image.
|
||||
if (nsContentUtils::IsThirdPartyWindowOrChannel(aDocument->GetInnerWindow(),
|
||||
|
||||
Reference in New Issue
Block a user