WebPDecoder: Detect truncated file at the time of parsing

We should fail when we have received all data, but WebPDemuxPartial()
hasn't reached the state WEBP_DEMUX_DONE.

Added a unit test for the same.

This is a fix for: https://code.google.com/p/webp/issues/detail?id=185

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165678 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use Traits in SelectorQuery to avoid a lot of code duplication

This CL introduces Traits to SelectorQuery to avoid a lot of code duplication
between the queryFirst / queryAll cases. The code was duplicated in r155068
because this code is hot and we wanted to get rid of the if(firstMatchOnly)
checks at runtime and stop using a Vector for the queryFirst() case.

By using Traits, we can avoid the duplication while maintaining performance.
The if(firstMatchOnly) checks are now optimized out by the compiler because
the condition is a static const variable. Also, we use a Vector for the
result only in the queryAll case, not in the queryFirst one.

This patch also drops the SingleNodeList class and handles the single traverse
root case separately to avoid causing regressions in QueryFirst() now that the
code is shared between QueryFirst() / QueryAll(). We also now use templates
to handle the different simple node list types so that isEmpty() / next() no
longer need to be virtual which is performance-positive.

Running the performance tests, I see the following results on Linux Desktop:
- Parser/query-selector-all-attribute-complex: +4%
- Parser/query-selector-all-attribute: +4%
- Parser/query-selector-all-deep: +4%
- Parser/query-selector-all-id-deep: +15%
- Parser/query-selector-all-id-last: +15%
- The rest is within noise, no major regression or improvement.

This CL is based on the following WebKit commit by <benjamin@webkit.org>:
http://trac.webkit.org/changeset/154370

R=esprehn, eseidel
BUG=336078

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove reference counting of WebHelperPluginImpl.

WebMediaPlayerClientImpl has a RefPtr<> to WebHelperPluginImpl, which is changed to OwnPtr<> to make clear the ownership of the plugin (and remove the reference counting). Also adds a customized destructor for OwnPtr<WebHelperPluginImpl> so that it gets cleaned up in the correct order.

BUG=336502
TEST=EncryptedMedia browser_tests succeed

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

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