зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1646570 - Remove using GetInProcessScriptableTop in ImageCacheKey::GetIsolationKey r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D93355
This commit is contained in:
Родитель
15d07d6c5b
Коммит
4cbccb42f6
|
@ -152,15 +152,11 @@ nsCString ImageCacheKey::GetIsolationKey(Document* aDocument, nsIURI* aURI) {
|
|||
// unique image cache per the top-level document eTLD+1.
|
||||
if (!ContentBlocking::ApproximateAllowAccessForWithoutChannel(
|
||||
aDocument->GetInnerWindow(), aURI)) {
|
||||
nsPIDOMWindowOuter* top =
|
||||
aDocument->GetInnerWindow()->GetInProcessScriptableTop();
|
||||
nsPIDOMWindowInner* topInner = top ? top->GetCurrentInnerWindow() : nullptr;
|
||||
if (!topInner) {
|
||||
return aDocument
|
||||
->GetBaseDomain(); // because we don't have anything better!
|
||||
}
|
||||
return topInner->GetExtantDoc() ? topInner->GetExtantDoc()->GetBaseDomain()
|
||||
: ""_ns;
|
||||
// If we are here, the image is a 3rd-party resource loaded by a first-party
|
||||
// context. We can just use the document's base domain as the key because it
|
||||
// should be the same as the top-level document's base domain.
|
||||
return aDocument
|
||||
->GetBaseDomain(); // because we don't have anything better!
|
||||
}
|
||||
|
||||
return ""_ns;
|
||||
|
|
Загрузка…
Ссылка в новой задаче