REGRESSION: Text input value is truncated unexpectedly.

This is a regression by Blink r155803.

If new text input value ended with a leading surrogate character, and the
following memory area had a control character, the surrogate character was
unexpectedly removed.

We should not read memory outside of the input string in limitLength().

BUG=285997
TEST=automated.

Review URL: https://chromiumcodereview.appspot.com/23526022

git-svn-id: svn://svn.chromium.org/blink/trunk@157334 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make StringImpl ref counting count by 1 instead of 2

StringImpl incremented its ref count by 2 because the lower bit was used to
track if it was a static string. This meant that we only used half the available
range of ref counts and is not neccesary now that there's bitfields available.

This patch makes it count by 1 and adds a separate field to track static strings.

To avoid bloating the frequently called inline hasOneRef() and deref() I also
moved destruction into a method that only calls delete if the string is not
static.

R=abarth@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23684019

git-svn-id: svn://svn.chromium.org/blink/trunk@157335 bbb929c8-8fbe-4397-9dbb-9b2b20218538
API for ImageDecoder to support downsampling

Adding a new ImageDecoder::setMaxDecodedSize() API. The purpose of this
API is to restrict the size of output by the decoder. This is used for
low end devices where memory is limited.

This API is optionally supported by each image format. Decoder can
choose a size that fits into the specified limit.

Using this API the image will report the same size such that page layout
would not change but the bitmap decoded will be smaller.

Implemented for JPEG is included in this change.

BUG=276666

Review URL: https://chromiumcodereview.appspot.com/23455022

git-svn-id: svn://svn.chromium.org/blink/trunk@157336 bbb929c8-8fbe-4397-9dbb-9b2b20218538