Bug 1262359 (part 3) - Add a missing fallible nsTSubstring_CharT::Assign() variant. r=erahm.

--HG--
extra : rebase_source : 2f5ee5658cce8a193454bf4c182cd534b0e7e8a0
This commit is contained in:
Nicholas Nethercote 2016-04-06 17:23:19 +10:00
parent 35f4f94106
commit 02b5d3f103
2 changed files with 10 additions and 1 deletions

View File

@ -308,11 +308,17 @@ nsTSubstring_CharT::Assign(char_type aChar, const fallible_t&)
void
nsTSubstring_CharT::Assign(const char_type* aData)
{
if (!Assign(aData, size_type(-1), mozilla::fallible)) {
if (!Assign(aData, mozilla::fallible)) {
AllocFailed(char_traits::length(aData));
}
}
bool
nsTSubstring_CharT::Assign(const char_type* aData, const fallible_t&)
{
return Assign(aData, size_type(-1), mozilla::fallible);
}
void
nsTSubstring_CharT::Assign(const char_type* aData, size_type aLength)
{

View File

@ -365,6 +365,9 @@ public:
const fallible_t&);
void NS_FASTCALL Assign(const char_type* aData);
MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const char_type* aData,
const fallible_t&);
void NS_FASTCALL Assign(const char_type* aData, size_type aLength);
MOZ_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const char_type* aData,
size_type aLength,