mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1034999 - fix XUL cache and overlay system to ignore refs/hashes, r=smaug,mossop
This commit is contained in:
parent
b610351b77
commit
71fe07483f
@ -681,7 +681,11 @@ NS_IMETHODIMP
|
||||
nsChromeRegistryChrome::GetStyleOverlays(nsIURI *aChromeURL,
|
||||
nsISimpleEnumerator **aResult)
|
||||
{
|
||||
const nsCOMArray<nsIURI>* parray = mStyleHash.GetArray(aChromeURL);
|
||||
nsCOMPtr<nsIURI> chromeURLWithoutHash;
|
||||
if (aChromeURL) {
|
||||
aChromeURL->CloneIgnoringRef(getter_AddRefs(chromeURLWithoutHash));
|
||||
}
|
||||
const nsCOMArray<nsIURI>* parray = mStyleHash.GetArray(chromeURLWithoutHash);
|
||||
if (!parray)
|
||||
return NS_NewEmptyEnumerator(aResult);
|
||||
|
||||
@ -692,7 +696,11 @@ NS_IMETHODIMP
|
||||
nsChromeRegistryChrome::GetXULOverlays(nsIURI *aChromeURL,
|
||||
nsISimpleEnumerator **aResult)
|
||||
{
|
||||
const nsCOMArray<nsIURI>* parray = mOverlayHash.GetArray(aChromeURL);
|
||||
nsCOMPtr<nsIURI> chromeURLWithoutHash;
|
||||
if (aChromeURL) {
|
||||
aChromeURL->CloneIgnoringRef(getter_AddRefs(chromeURLWithoutHash));
|
||||
}
|
||||
const nsCOMArray<nsIURI>* parray = mOverlayHash.GetArray(chromeURLWithoutHash);
|
||||
if (!parray)
|
||||
return NS_NewEmptyEnumerator(aResult);
|
||||
|
||||
@ -895,7 +903,10 @@ nsChromeRegistryChrome::ManifestOverlay(ManifestProcessingContext& cx, int linen
|
||||
return;
|
||||
}
|
||||
|
||||
mOverlayHash.Add(baseuri, overlayuri);
|
||||
nsCOMPtr<nsIURI> baseuriWithoutHash;
|
||||
baseuri->CloneIgnoringRef(getter_AddRefs(baseuriWithoutHash));
|
||||
|
||||
mOverlayHash.Add(baseuriWithoutHash, overlayuri);
|
||||
}
|
||||
|
||||
void
|
||||
@ -920,7 +931,10 @@ nsChromeRegistryChrome::ManifestStyle(ManifestProcessingContext& cx, int lineno,
|
||||
return;
|
||||
}
|
||||
|
||||
mStyleHash.Add(baseuri, overlayuri);
|
||||
nsCOMPtr<nsIURI> baseuriWithoutHash;
|
||||
baseuri->CloneIgnoringRef(getter_AddRefs(baseuriWithoutHash));
|
||||
|
||||
mStyleHash.Add(baseuriWithoutHash, overlayuri);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -131,7 +131,13 @@ nsXULPrototypeCache::Observe(nsISupports* aSubject,
|
||||
nsXULPrototypeDocument*
|
||||
nsXULPrototypeCache::GetPrototype(nsIURI* aURI)
|
||||
{
|
||||
nsXULPrototypeDocument* protoDoc = mPrototypeTable.GetWeak(aURI);
|
||||
if (!aURI)
|
||||
return nullptr;
|
||||
|
||||
nsCOMPtr<nsIURI> uriWithoutRef;
|
||||
aURI->CloneIgnoringRef(getter_AddRefs(uriWithoutRef));
|
||||
|
||||
nsXULPrototypeDocument* protoDoc = mPrototypeTable.GetWeak(uriWithoutRef);
|
||||
if (protoDoc)
|
||||
return protoDoc;
|
||||
|
||||
@ -164,7 +170,13 @@ nsXULPrototypeCache::GetPrototype(nsIURI* aURI)
|
||||
nsresult
|
||||
nsXULPrototypeCache::PutPrototype(nsXULPrototypeDocument* aDocument)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri = aDocument->GetURI();
|
||||
if (!aDocument->GetURI()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
aDocument->GetURI()->CloneIgnoringRef(getter_AddRefs(uri));
|
||||
|
||||
// Put() releases any old value and addrefs the new one
|
||||
mPrototypeTable.Put(uri, aDocument);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user