Bug 1557793 part 1. Fix incorrect template arguments in AnimationPerformanceWarning. r=birtles

It looks like bug 1321412 changed the number of params but didn't update the
template parameter, and then bug 1364221 followed its example of not matching
the template parameter to the actual number of params.  As a result we're
passing an array with one garbage pointer to the callee, and it just happens
that the callee doesn't examine that pointer.  But that's about to change.

Differential Revision: https://phabricator.services.mozilla.com/D34234

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2019-06-09 22:00:41 +00:00
Родитель c0ca36e4fd
Коммит deea17a98e
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -16,6 +16,7 @@ nsresult AnimationPerformanceWarning::ToLocalizedStringWithIntParams(
nsAutoString strings[N];
const char16_t* charParams[N];
MOZ_DIAGNOSTIC_ASSERT(mParams->Length() == N);
for (size_t i = 0, n = mParams->Length(); i < n; i++) {
strings[i].AppendInt((*mParams)[i]);
charParams[i] = strings[i].get();
@ -34,13 +35,13 @@ bool AnimationPerformanceWarning::ToLocalizedString(
MOZ_ASSERT(mParams && mParams->Length() == 6,
"Parameter's length should be 6 for ContentTooLarge2");
return NS_SUCCEEDED(ToLocalizedStringWithIntParams<7>(
return NS_SUCCEEDED(ToLocalizedStringWithIntParams<6>(
"CompositorAnimationWarningContentTooLarge2", aLocalizedString));
case Type::ContentTooLargeArea:
MOZ_ASSERT(mParams && mParams->Length() == 2,
"Parameter's length should be 2 for ContentTooLargeArea");
return NS_SUCCEEDED(ToLocalizedStringWithIntParams<3>(
return NS_SUCCEEDED(ToLocalizedStringWithIntParams<2>(
"CompositorAnimationWarningContentTooLargeArea", aLocalizedString));
case Type::TransformBackfaceVisibilityHidden:
key = "CompositorAnimationWarningTransformBackfaceVisibilityHidden";