Fix memory leak on serializing neutered ArrayBuffer.

If the serialization of an ArrayBufferView's ArrayBuffer fails, unwind
the state stack completely before reporting an error to avoid leaking
a serializer state object.

To accommodate, split out the state stack overflow checking from the
dispatching on value types which was both performed by the main
serialization method. Now handled by

    Serializer::doSerialize()
    Serializer::doSerializeImpl()

respectively, with the former calling upon the latter if the stack
check passes.

R=dslomov@chromium.org
BUG=291240

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

git-svn-id: svn://svn.chromium.org/blink/trunk@161343 bbb929c8-8fbe-4397-9dbb-9b2b20218538
1 file changed
tree: 6681af9f177627736593e7dd644b7dc3748dede5
  1. third_party/