Remove FrameLoader::m_needsClear

Based on when it is reset and checked, its only purpose is to prevent
clearing a nonexistent document during frame initialization.

BUG=none

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156491 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a new field static_use to Angle variable info.

BUG=249018
TEST=build ok

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156492 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix a crash in impl side painting for image decoding

When image data is reciving very slowly there is a rare case that an
ImageDecoder is created twice and inserted into ImageDecodingStore.
This condition triggers a crash.

The following sequence is causing the problem:
1. ImageFrameGenerator tries to resume decoding, resulted an empty
   frame.
2. A little more data is received.
3. ImageFrameGenerator creates a new decoder and tries to insert it to
   cache.

This fix is to decode only once instead of resume decoding and then
decode again with a new decoder.

BUG=275421

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156494 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Apply ScriptPreprocessor to Web page scripts only.

Move ScriptPreprocessor from ScriptDebugServer to PageScriptDebugServer.
Evaluate preprocessor in isolatedWorld.
Preprocess event listeners and <script> elements before entering V8.
Use InspectorInstrumentation to inline fast path if debugger is not attached.
Preprocess eval source in V8 beforeCompile event.

Add Debugger.getScriptCompilationTypeInfo() to extract the
V8 compilation script info, to seperate eval scripts from
e.g. devtools command line evaluations.

Report exceptions in the ScriptPreprocessor compilation.
Add new test-cases for these error paths.

BUG=226293

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156495 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make sure the Document is always detached before it's too late.

During a navigation, FrameLoader::clear() typically detaches the
Document before DocumentLoader::createWriterFor() replaces the
DOMWindow and cancels all pending navigations.

However, synchronous navigations during a pagehide event can cause
FrameLoader::clear() to be re-entered, causing it to skip the detach.
This wasn't a problem before r151960, since the Frame::setDocument()
call would detach the Document if it was still attached.

Now, we manually check if the original Document is still attached
before replacing the DOMWindow. If it's still attached, then we
detach it anyway. As a bonus, this fix revealed an older bug where
AXObjectCache's timer can fire for destroyed Documents. To fix that,
FrameLoader::clear() uses prepareForDestruction() instead of detach().

BUG=261836, 268642

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156496 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Do IDBKey to V8 value conversions lazily.

This CL tackles IDBCursor.key and IDBCursor.primaryKey; 
which are likely to be ignored in many cursor iteration 
scenarios. The existing [CachedAttribute] code generation 
IDL attribute is used, but an "is the value dirty?" method 
is exposed.

A microbenchmark (iterate a cursor over 500k items in a 
store) shows an 16% performance increase.

BUG=273211
R=haraken@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156497 bbb929c8-8fbe-4397-9dbb-9b2b20218538
WebCrypto: Check for HmacKeyParams when seeing if a Key can be used for an Algorithm.

The testing of HMAC equivalance was broken by r156343, since keys made by generateKey() would have a different parameter type.

This change:
  (1) Fixes the above bug
  (2) Refactors the code to live in Key.cpp rather than SubtleCrypto.cpp (since the latter is already large).
  (3) Adds a more descriptive message to the exception thrown when keys don't match.

BUG=245025

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156498 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Mark 2 layout tests as flaky on other platforms

The following 2 tests are also flaky on other platforms:
virtual/threaded/transitions/transition-end-event-all-properties.html
virtual/threaded/transitions/move-after-transition.html

BUG=248938
TEST=none
TBR=dominicc@chromium.org

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

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