Bug 311827: Make GetAttr return a bool rather then an nsresult.

r/sr=bz


git-svn-id: svn://10.0.0.236/trunk@183185 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cvshook%sicking.cc
2005-10-28 11:25:24 +00:00
parent 2d2caede4d
commit b26f9f52fb
117 changed files with 894 additions and 1478 deletions

View File

@@ -569,9 +569,8 @@ nsObjectLoadingContent::ObjectURIChanged(const nsAString& aURI,
nsCOMPtr<nsIURI> baseURI = thisContent->GetBaseURI();
nsCOMPtr<nsIURI> codebaseURI;
nsAutoString codebase;
nsresult rv = thisContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::codebase,
codebase);
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
thisContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::codebase, codebase);
if (!codebase.IsEmpty()) {
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(codebaseURI),
codebase, doc, baseURI);
} else {
@@ -749,12 +748,15 @@ nsObjectLoadingContent::ObjectURIChanged(nsIURI* aURI,
// If the class ID specifies a supported plugin, or if we have no explicit URI
// but a type, immediately instantiate the plugin.
PRBool isSupportedClassID = PR_FALSE;
PRBool hasID = PR_FALSE;
if (GetCapabilities() & eSupportClassID) {
nsAutoString classid;
rv = thisContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::classid, classid);
thisContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::classid, classid);
nsCAutoString typeForID;
if (rv == NS_CONTENT_ATTR_HAS_VALUE)
if (!classid.IsEmpty()) {
hasID = PR_TRUE;
isSupportedClassID = NS_SUCCEEDED(TypeForClassID(classid, typeForID));
}
}
if (isSupportedClassID ||
(!aURI && !aTypeHint.IsEmpty() &&
@@ -777,7 +779,7 @@ nsObjectLoadingContent::ObjectURIChanged(nsIURI* aURI,
}
// If we get here, and we had a class ID, then it must have been unsupported.
// Fallback in that case.
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
if (hasID) {
mInstantiating = PR_FALSE;
rv = NS_ERROR_NOT_AVAILABLE;
return NS_OK;