Optimization for scheme comparison of URIs. See bug 66577 for details. r=darin, sr=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@85797 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -484,11 +484,12 @@ nsScriptSecurityManager::CheckLoadURIFromScript(JSContext *cx,
|
||||
|
||||
// See if we're attempting to load a file: URI. If so, let a
|
||||
// UniversalFileRead capability trump the above check.
|
||||
nsXPIDLCString scheme;
|
||||
if (NS_FAILED(aURI->GetScheme(getter_Copies(scheme))))
|
||||
PRBool isFile = PR_FALSE;
|
||||
PRBool isRes = PR_FALSE;
|
||||
if (NS_FAILED(aURI->SchemeIs(nsIURI::FILE, &isFile)) ||
|
||||
NS_FAILED(aURI->SchemeIs(nsIURI::RESOURCE, &isRes)))
|
||||
return NS_ERROR_FAILURE;
|
||||
if (nsCRT::strcasecmp(scheme, "file") == 0 ||
|
||||
nsCRT::strcasecmp(scheme, "resource") == 0)
|
||||
if (isFile || isRes)
|
||||
{
|
||||
PRBool enabled;
|
||||
if (NS_FAILED(IsCapabilityEnabled("UniversalFileRead", &enabled)))
|
||||
|
||||
Reference in New Issue
Block a user