Bug 969868 - Use fallible allocations in some places in our plugin code; r=bsmedberg

It seems like the sizes for these data structures can be controlled from
Web content, and we are already prepared to deal with OOM conditions,
except that we are using infallible allocations by mistake.
This commit is contained in:
Ehsan Akhgari
2014-02-08 16:04:09 -05:00
parent fe97da9207
commit 3528280af3
2 changed files with 6 additions and 6 deletions

View File

@@ -657,7 +657,7 @@ PluginScriptableObjectChild::AnswerInvoke(PPluginIdentifierChild* aId,
return true;
}
nsAutoTArray<NPVariant, 10> convertedArgs;
AutoFallibleTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount)) {
@@ -727,7 +727,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(const InfallibleTArray<Variant>
return true;
}
nsAutoTArray<NPVariant, 10> convertedArgs;
AutoFallibleTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount)) {
@@ -979,7 +979,7 @@ PluginScriptableObjectChild::AnswerConstruct(const InfallibleTArray<Variant>& aA
return true;
}
nsAutoTArray<NPVariant, 10> convertedArgs;
AutoFallibleTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount)) {