Fixing bug 412691. Remove unnecessary nsCOMPtr's from performance critical code paths. r+sr=jonas@sicking.cc

This commit is contained in:
jst%mozilla.org 2008-01-17 00:32:26 +00:00
Родитель b3520d3fa7
Коммит 660fe310b9
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -795,7 +795,8 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
#ifdef DEBUG_CAPS_CheckPropertyAccessImpl
printf("sameOrigin ");
#endif
nsCOMPtr<nsIPrincipal> objectPrincipal;
nsCOMPtr<nsIPrincipal> principalHolder;
nsIPrincipal *objectPrincipal;
if(aJSObject)
{
objectPrincipal = doGetObjectPrincipal(cx, aJSObject);
@ -805,8 +806,10 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
else if(aTargetURI)
{
if (NS_FAILED(GetCodebasePrincipal(
aTargetURI, getter_AddRefs(objectPrincipal))))
aTargetURI, getter_AddRefs(principalHolder))))
return NS_ERROR_FAILURE;
objectPrincipal = principalHolder;
}
else
{
@ -842,7 +845,7 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
if (NS_SUCCEEDED(rv) && classInfoData.IsContentNode())
{
// No access to anonymous content from the web! (bug 164086)
nsCOMPtr<nsIContent> content(do_QueryInterface(aObj));
nsIContent *content = static_cast<nsIContent*>(aObj);
NS_ASSERTION(content, "classinfo had CONTENT_NODE set but node did not"
"implement nsIContent! Fasten your seat belt.");
if (content->IsNativeAnonymous()) {