Improve partitionAlloc's resistance to fragmentation.

If we make a full partition page non-full, take steps to get it filled up
again because it is unlikely to become fully empty any time soon.
If we make a partition page empty, free it right away under more situations.

In the process, also apply some tidy-ups and simplifications. Pulling at this
thread led to stronger ASSERTs in the allocation slow path, and better unit
test coverage.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@159297 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[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: svn://svn.chromium.org/blink/trunk@159298 bbb929c8-8fbe-4397-9dbb-9b2b20218538