зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1489363 - Replace some string.Append* with AppendLiteral. r=froydnj
Depends on D5224 Differential Revision: https://phabricator.services.mozilla.com/D5225 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
117e48720c
Коммит
32627430f6
|
@ -892,7 +892,7 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
|
|||
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID, cur.key);
|
||||
}
|
||||
|
||||
text.AppendASCII("\n* ");
|
||||
text.AppendLiteral("\n* ");
|
||||
text.Append(cur.info);
|
||||
}
|
||||
failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_REASON");
|
||||
|
|
|
@ -2279,7 +2279,7 @@ Console::ComposeAndStoreGroupName(JSContext* aCx,
|
|||
{
|
||||
for (uint32_t i = 0; i < aData.Length(); ++i) {
|
||||
if (i != 0) {
|
||||
aName.AppendASCII(" ");
|
||||
aName.AppendLiteral(" ");
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> value(aCx, aData[i]);
|
||||
|
|
|
@ -192,11 +192,11 @@ ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
|||
nsAutoCString name;
|
||||
name.AppendASCII(aName);
|
||||
if (aField.mTypeAtom) {
|
||||
name.AppendASCII(" event=");
|
||||
name.AppendLiteral(" event=");
|
||||
name.Append(nsAtomCString(aField.mTypeAtom));
|
||||
name.AppendASCII(" listenerType=");
|
||||
name.AppendLiteral(" listenerType=");
|
||||
name.AppendInt(aField.mListenerType);
|
||||
name.AppendASCII(" ");
|
||||
name.AppendLiteral(" ");
|
||||
}
|
||||
CycleCollectionNoteChild(aCallback, aField.mListener.GetISupports(), name.get(),
|
||||
aFlags);
|
||||
|
|
|
@ -929,7 +929,7 @@ nsCSPParser::sandboxFlagList(nsCSPDirective* aDir)
|
|||
|
||||
flags.Append(mCurToken);
|
||||
if (i != mCurDir.Length() - 1) {
|
||||
flags.AppendASCII(" ");
|
||||
flags.AppendLiteral(" ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -537,7 +537,7 @@ void
|
|||
nsCSPSchemeSrc::toString(nsAString& outStr) const
|
||||
{
|
||||
outStr.Append(mScheme);
|
||||
outStr.AppendASCII(":");
|
||||
outStr.AppendLiteral(":");
|
||||
}
|
||||
|
||||
/* ===== nsCSPHostSrc ======================== */
|
||||
|
@ -769,7 +769,7 @@ void
|
|||
nsCSPHostSrc::toString(nsAString& outStr) const
|
||||
{
|
||||
if (mGeneratedFromSelfKeyword) {
|
||||
outStr.AppendASCII("'self'");
|
||||
outStr.AppendLiteral("'self'");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -785,12 +785,12 @@ nsCSPHostSrc::toString(nsAString& outStr) const
|
|||
outStr.Append(mScheme);
|
||||
|
||||
// append host
|
||||
outStr.AppendASCII("://");
|
||||
outStr.AppendLiteral("://");
|
||||
outStr.Append(mHost);
|
||||
|
||||
// append port
|
||||
if (!mPort.IsEmpty()) {
|
||||
outStr.AppendASCII(":");
|
||||
outStr.AppendLiteral(":");
|
||||
outStr.Append(mPort);
|
||||
}
|
||||
|
||||
|
@ -928,7 +928,7 @@ nsCSPNonceSrc::toString(nsAString& outStr) const
|
|||
{
|
||||
outStr.Append(CSP_EnumToUTF16Keyword(CSP_NONCE));
|
||||
outStr.Append(mNonce);
|
||||
outStr.AppendASCII("'");
|
||||
outStr.AppendLiteral("'");
|
||||
}
|
||||
|
||||
/* ===== nsCSPHashSrc ===================== */
|
||||
|
@ -989,11 +989,11 @@ nsCSPHashSrc::visit(nsCSPSrcVisitor* aVisitor) const
|
|||
void
|
||||
nsCSPHashSrc::toString(nsAString& outStr) const
|
||||
{
|
||||
outStr.AppendASCII("'");
|
||||
outStr.AppendLiteral("'");
|
||||
outStr.Append(mAlgorithm);
|
||||
outStr.AppendASCII("-");
|
||||
outStr.AppendLiteral("-");
|
||||
outStr.Append(mHash);
|
||||
outStr.AppendASCII("'");
|
||||
outStr.AppendLiteral("'");
|
||||
}
|
||||
|
||||
/* ===== nsCSPReportURI ===================== */
|
||||
|
@ -1100,14 +1100,14 @@ nsCSPDirective::toString(nsAString& outStr) const
|
|||
{
|
||||
// Append directive name
|
||||
outStr.AppendASCII(CSP_CSPDirectiveToString(mDirective));
|
||||
outStr.AppendASCII(" ");
|
||||
outStr.AppendLiteral(" ");
|
||||
|
||||
// Append srcs
|
||||
uint32_t length = mSrcs.Length();
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
mSrcs[i]->toString(outStr);
|
||||
if (i != (length - 1)) {
|
||||
outStr.AppendASCII(" ");
|
||||
outStr.AppendLiteral(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1421,10 +1421,10 @@ nsRequireSRIForDirective::toString(nsAString &outStr) const
|
|||
nsIContentSecurityPolicy::REQUIRE_SRI_FOR));
|
||||
for (uint32_t i = 0; i < mTypes.Length(); i++) {
|
||||
if (mTypes[i] == nsIContentPolicy::TYPE_SCRIPT) {
|
||||
outStr.AppendASCII(" script");
|
||||
outStr.AppendLiteral(" script");
|
||||
}
|
||||
else if (mTypes[i] == nsIContentPolicy::TYPE_STYLESHEET) {
|
||||
outStr.AppendASCII(" style");
|
||||
outStr.AppendLiteral(" style");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1603,7 +1603,7 @@ nsCSPPolicy::toString(nsAString& outStr) const
|
|||
for (uint32_t i = 0; i < length; ++i) {
|
||||
mDirectives[i]->toString(outStr);
|
||||
if (i != (length - 1)) {
|
||||
outStr.AppendASCII("; ");
|
||||
outStr.AppendLiteral("; ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1662,7 +1662,7 @@ nsCSPPolicy::getDirectiveStringAndReportSampleForContentType(nsContentPolicyType
|
|||
return;
|
||||
}
|
||||
NS_ASSERTION(false, "Can not query directive string for contentType!");
|
||||
outDirective.AppendASCII("couldNotQueryViolatedDirective");
|
||||
outDirective.AppendLiteral("couldNotQueryViolatedDirective");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -2993,7 +2993,7 @@ NS_ShouldSecureUpgrade(nsIURI* aURI,
|
|||
nsAutoCString scheme;
|
||||
aURI->GetScheme(scheme);
|
||||
// append the additional 's' for security to the scheme :-)
|
||||
scheme.AppendASCII("s");
|
||||
scheme.AppendLiteral("s");
|
||||
NS_ConvertUTF8toUTF16 reportSpec(aURI->GetSpecOrDefault());
|
||||
NS_ConvertUTF8toUTF16 reportScheme(scheme);
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ getSiteKey(const nsACString& hostName, uint16_t port,
|
|||
/*out*/ nsACString& key)
|
||||
{
|
||||
key = hostName;
|
||||
key.AppendASCII(":");
|
||||
key.AppendLiteral(":");
|
||||
key.AppendInt(port);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,14 +34,14 @@ GetErrorName(nsresult rv, nsACString& name)
|
|||
: "NS_ERROR_GENERATE_FAILURE(");
|
||||
|
||||
if (isSecurityError) {
|
||||
name.AppendASCII("NS_ERROR_MODULE_SECURITY");
|
||||
name.AppendLiteral("NS_ERROR_MODULE_SECURITY");
|
||||
} else {
|
||||
// This should never happen given the assertion above, so we don't bother
|
||||
// trying to print a symbolic name for the module here.
|
||||
name.AppendInt(NS_ERROR_GET_MODULE(rv));
|
||||
}
|
||||
|
||||
name.AppendASCII(", ");
|
||||
name.AppendLiteral(", ");
|
||||
|
||||
const char * nsprName = nullptr;
|
||||
if (isSecurityError) {
|
||||
|
@ -60,7 +60,7 @@ GetErrorName(nsresult rv, nsACString& name)
|
|||
name.AppendInt(NS_ERROR_GET_CODE(rv));
|
||||
}
|
||||
|
||||
name.AppendASCII(")");
|
||||
name.AppendLiteral(")");
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче