mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1206958 - Use channel->asyncOpen2() in dom/xul/XULDocument.cpp (r=sicking)
This commit is contained in:
parent
430d12a198
commit
b946316b70
@ -2555,25 +2555,12 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic,
|
||||
if (aIsDynamic)
|
||||
mResolutionPhase = nsForwardReference::eStart;
|
||||
|
||||
// Chrome documents are allowed to load overlays from anywhere.
|
||||
// In all other cases, the overlay is only allowed to load if
|
||||
// the master document and prototype document have the same origin.
|
||||
|
||||
bool documentIsChrome = IsChromeURI(mDocumentURI);
|
||||
if (!documentIsChrome) {
|
||||
// Make sure we're allowed to load this overlay.
|
||||
rv = NodePrincipal()->CheckMayLoad(aURI, true, false);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aFailureFromContent = true;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
// Look in the prototype cache for the prototype document with
|
||||
// the specified overlay URI. Only use the cache if the containing
|
||||
// document is chrome otherwise it may not have a system principal and
|
||||
// the cached document will, see bug 565610.
|
||||
bool overlayIsChrome = IsChromeURI(aURI);
|
||||
bool documentIsChrome = IsChromeURI(mDocumentURI);
|
||||
mCurrentPrototype = overlayIsChrome && documentIsChrome ?
|
||||
nsXULPrototypeCache::GetInstance()->GetPrototype(aURI) : nullptr;
|
||||
|
||||
@ -2657,12 +2644,13 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic,
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
aURI,
|
||||
NodePrincipal(),
|
||||
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS |
|
||||
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
|
||||
nsIContentPolicy::TYPE_OTHER,
|
||||
group);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = channel->AsyncOpen(listener, nullptr);
|
||||
rv = channel->AsyncOpen2(listener);
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
|
Loading…
Reference in New Issue
Block a user