Bug 1018829. r=sstamm

This commit is contained in:
Makoto Kato 2014-06-03 15:02:19 +09:00
parent c3e45e648c
commit 08e2229907
2 changed files with 6 additions and 3 deletions

View File

@ -696,7 +696,8 @@ nsCSPParser::sourceList(nsTArray<nsCSPBaseSrc*>& outSrcs)
}
// Otherwise, we ignore 'none' and report a warning
else {
const char16_t* params[] = { NS_ConvertUTF8toUTF16(CSP_EnumToKeyword(CSP_NONE)).get() };
NS_ConvertUTF8toUTF16 unicodeNone(CSP_EnumToKeyword(CSP_NONE));
const char16_t* params[] = { unicodeNone.get() };
logWarningErrorToConsole(nsIScriptError::warningFlag, "ignoringUnknownOption",
params, ArrayLength(params));
}
@ -887,7 +888,8 @@ nsCSPParser::parseContentSecurityPolicy(const nsAString& aPolicyString,
nsAutoCString prePath;
nsresult rv = aSelfURI->GetPrePath(prePath);
NS_ENSURE_SUCCESS(rv, policy);
const char16_t* params[] = { NS_ConvertUTF8toUTF16(prePath).get() };
NS_ConvertUTF8toUTF16 unicodePrePath(prePath);
const char16_t* params[] = { unicodePrePath.get() };
parser.logWarningErrorToConsole(nsIScriptError::warningFlag, "reportURInotInReportOnlyHeader",
params, ArrayLength(params));
}

View File

@ -367,7 +367,8 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
// to enforce the load policy if it redirects again, so we stop it now.
nsAutoCString newUriSpec;
rv = newUri->GetSpec(newUriSpec);
const char16_t *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() };
NS_ConvertUTF8toUTF16 unicodeSpec(newUriSpec);
const char16_t *formatParams[] = { unicodeSpec.get() };
if (NS_SUCCEEDED(rv)) {
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("Redirect Error"), nullptr,