mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 19:33:18 +00:00
Bug 1626573 - P1 - BrowsingContext transmits BlobURL before loading an URI if URI is a BlobURL r=baku
Differential Revision: https://phabricator.services.mozilla.com/D69717
This commit is contained in:
parent
9f16aa281a
commit
a25b985890
@ -1423,6 +1423,8 @@ nsresult BrowsingContext::LoadURI(nsDocShellLoadState* aLoadState,
|
||||
}
|
||||
|
||||
if (ContentParent* cp = Canonical()->GetContentParent()) {
|
||||
cp->TransmitBlobDataIfBlobURL(aLoadState->URI(),
|
||||
aLoadState->TriggeringPrincipal());
|
||||
Unused << cp->SendLoadURI(this, aLoadState, aSetNavigating);
|
||||
}
|
||||
}
|
||||
|
@ -5503,6 +5503,18 @@ void ContentParent::TransmitBlobURLsForPrincipal(nsIPrincipal* aPrincipal) {
|
||||
}
|
||||
}
|
||||
|
||||
void ContentParent::TransmitBlobDataIfBlobURL(nsIURI* aURI,
|
||||
nsIPrincipal* aPrincipal) {
|
||||
MOZ_ASSERT(aURI);
|
||||
MOZ_ASSERT(aPrincipal);
|
||||
|
||||
if (!IsBlobURI(aURI)) {
|
||||
return;
|
||||
}
|
||||
|
||||
TransmitBlobURLsForPrincipal(aPrincipal);
|
||||
}
|
||||
|
||||
void ContentParent::EnsurePermissionsByKey(const nsCString& aKey,
|
||||
const nsCString& aOrigin) {
|
||||
// NOTE: Make sure to initialize the permission manager before updating the
|
||||
|
@ -623,6 +623,19 @@ class ContentParent final
|
||||
|
||||
nsresult TransmitPermissionsForPrincipal(nsIPrincipal* aPrincipal);
|
||||
|
||||
// This function is called in BrowsingContext immediately before IPC call to
|
||||
// load a URI. If aURI is a BlobURL, this method transmits all BlobURLs for
|
||||
// aPrincipal that were previously not transmitted. This allows for opening a
|
||||
// locally created BlobURL in a new tab.
|
||||
//
|
||||
// The reason all previously untransmitted Blobs are transmitted is that the
|
||||
// current BlobURL could contain html code, referring to another untransmitted
|
||||
// BlobURL.
|
||||
//
|
||||
// Should eventually be made obsolete by broader design changes that only
|
||||
// store BlobURLs in the parent process.
|
||||
void TransmitBlobDataIfBlobURL(nsIURI* aURI, nsIPrincipal* aPrincipal);
|
||||
|
||||
void OnCompositorDeviceReset() override;
|
||||
|
||||
static hal::ProcessPriority GetInitialProcessPriority(Element* aFrameElement);
|
||||
|
Loading…
Reference in New Issue
Block a user