window.atob() returns wrong value when given a string container only white spaces

window.atob() returns wrong value when given a string container only white
spaces. The reason was that base64DecodeInternal() was calling Vector::grow()
before the loop but failed to call Vector::shrink() in case of early return.

R=
BUG=357332

Review URL: https://codereview.chromium.org/215833002

git-svn-id: svn://svn.chromium.org/blink/trunk@170264 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool base64Decode(const String& in, Vector<char>& out, CharacterMatchFunctionPtr shouldIgnoreCharacter, Base64DecodePolicy policy)
{
    if (in.isEmpty())
        return base64DecodeInternal<LChar>(0, 0, out, shouldIgnoreCharacter, policy);
    if (in.is8Bit())
        return base64DecodeInternal<LChar>(in.characters8(), in.length(), out, shouldIgnoreCharacter, policy);
    return base64DecodeInternal<UChar>(in.characters16(), in.length(), out, shouldIgnoreCharacter, policy);
}

bool base64Decode(const String& in, Vector<char>& out, CharacterMatchFunctionPtr shouldIgnoreCharacter, Base64DecodePolicy policy)
{
    if (in.isEmpty())
        return base64DecodeInternal<LChar>(0, 0, out, shouldIgnoreCharacter, policy);
    if (in.is8Bit())
        return base64DecodeInternal<LChar>(in.characters8(), in.length(), out, shouldIgnoreCharacter, policy);
    return base64DecodeInternal<UChar>(in.characters16(), in.length(), out, shouldIgnoreCharacter, policy);
}
