[FileReaderLoader] Always shrink m_rawData and cleanup m_decoder on error to save memory
[FileReaderLoader] Always shrink m_rawData and cleanup m_decoder on error to save memory

No change visible to web apps should happen.

1. Cleanup m_decoder on error.

Once any error occurs, m_decoder will never be used. Clearing it frees up memory.

2. Shrink m_rawData on didFinishLoading regardless of m_variableLength value.

Since,
- once didFinishLoading() is called, we won't receive new data any more.
- contents of m_rawData with index equal to or higher than m_bytesLoaded are
  never be read.
We should just release the unused are on didFinishLoading() call to save
memory.

m_rawData->byteLength() and m_bytesReceived may differ basically only when
the total length of the resource is unknown and m_variableLength is set, but
the above stands regardless of m_variableLength.

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@159298 bbb929c8-8fbe-4397-9dbb-9b2b20218538

primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs