mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1297300 - Add missing checks to GetSpec() calls in parser/. r=hsivonen.
--HG-- extra : rebase_source : 7d60e8d05180a84072ecd148ab5fe74c256acbd1
This commit is contained in:
parent
d7c5cd2ed2
commit
9554ec97fa
@ -286,7 +286,10 @@ nsHtml5StreamParser::SetViewSourceTitle(nsIURI* aURL)
|
||||
// UTF-8 for an ellipsis.
|
||||
mViewSourceTitle.AssignLiteral("data:\xE2\x80\xA6");
|
||||
} else {
|
||||
temp->GetSpec(mViewSourceTitle);
|
||||
nsresult rv = temp->GetSpec(mViewSourceTitle);
|
||||
if (NS_FAILED(rv)) {
|
||||
mViewSourceTitle.AssignLiteral("\xE2\x80\xA6");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -899,7 +899,8 @@ bool
|
||||
nsHtml5TreeOpExecutor::ShouldPreloadURI(nsIURI *aURI)
|
||||
{
|
||||
nsAutoCString spec;
|
||||
aURI->GetSpec(spec);
|
||||
nsresult rv = aURI->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
if (mPreloadedURLs.Contains(spec)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -911,7 +911,8 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
||||
}
|
||||
|
||||
nsAutoCString spec;
|
||||
uri->GetSpec(spec);
|
||||
rv = uri->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
viewSourceUrl.Append(spec);
|
||||
|
||||
@ -919,7 +920,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
||||
CopyUTF8toUTF16(viewSourceUrl, utf16);
|
||||
|
||||
node->SetAttr(kNameSpaceID_None, nsGkAtoms::href, utf16, true);
|
||||
return rv;
|
||||
return NS_OK;
|
||||
}
|
||||
case eTreeOpAddViewSourceBase: {
|
||||
char16_t* buffer = mTwo.unicharPtr;
|
||||
|
@ -160,6 +160,7 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
|
||||
|
||||
// Wrap things in a div or body for parsing, but it won't show up in
|
||||
// the fragment.
|
||||
nsresult rv = NS_OK;
|
||||
AutoTArray<nsString, 2> tagStack;
|
||||
nsAutoCString base, spec;
|
||||
if (aIsXML) {
|
||||
@ -167,7 +168,8 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
|
||||
if (aBaseURI) {
|
||||
base.AppendLiteral(XHTML_DIV_TAG);
|
||||
base.AppendLiteral(" xml:base=\"");
|
||||
aBaseURI->GetSpec(spec);
|
||||
rv = aBaseURI->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// nsEscapeHTML is good enough, because we only need to get
|
||||
// quotes, ampersands, and angle brackets
|
||||
char* escapedSpec = nsEscapeHTML(spec.get());
|
||||
@ -181,7 +183,6 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
|
||||
}
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIContent> fragment;
|
||||
if (aIsXML) {
|
||||
rv = nsContentUtils::ParseFragmentXML(aFragment,
|
||||
@ -201,7 +202,8 @@ nsParserUtils::ParseFragment(const nsAString& aFragment,
|
||||
true);
|
||||
// Now, set the base URI on all subtree roots.
|
||||
if (aBaseURI) {
|
||||
aBaseURI->GetSpec(spec);
|
||||
nsresult rv2 = aBaseURI->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv2, rv2);
|
||||
nsAutoString spec16;
|
||||
CopyUTF8toUTF16(spec, spec16);
|
||||
nsIContent* node = fragment->GetFirstChild();
|
||||
|
@ -805,7 +805,8 @@ nsExpatDriver::OpenInputStreamFromExternalDTD(const char16_t* aFPIStr,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoCString absURL;
|
||||
uri->GetSpec(absURL);
|
||||
rv = uri->GetSpec(absURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
CopyUTF8toUTF16(absURL, aAbsURL);
|
||||
|
||||
channel->SetContentType(NS_LITERAL_CSTRING("application/xml"));
|
||||
|
Loading…
Reference in New Issue
Block a user