Oilpan: The main thread should not get involved in a GC after starting a shutdown sequence

This is a speculative fix for the following crash in build bots. This crash is flaky and I cannot reproduce it locally:
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan/builds/3338/steps/webkit_unit_tests/logs/stdio

As far as I see the stack trace, I guess that we're flakily hitting the following scenario:

(1) The main thread disposes V8.
(2) The parser thread has some tasks to be processed.
(3) The main thread calls HTMLParserThread::shutdown(). HTMLParserThread::shutdown() posts a shutdown task to the parser thread and then call TaskSynchronizer::waitTaskUntilCompleted(). The main thread enters a safe point scope.
(4) The parser thread processes some task (before processing the shutdown task) and triggers a GC.
(5) The main thread gets involved in the GC.
(6) The main thread calls ~XMLHttpRequest(). ~XMLHttpRequest() calls ~ScriptValue() which touches V8 APIs. Sicne V8 is already disposed, it crashes.

The issue is that the main thread gets involved in a GC after starting the shutdown sequence. To avoid that, this CL detaches the main thread from oilpan before the main thread starting the shutdown sequence.

BUG=340522

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171258 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add blink public interface for ServiceWorker.state and .statechange plumbing

- Add WebServiceWorker::state() (as well as scope() and url()) accessor
- Add WebServiceWorkerProxy interface for chromium to call into blink (e.g. to call dispatchStateChangeEvent() method)
- Add WebServiceWorker::setProxy() to pass the proxy from blink to chromium

No binding code change / no tests yet, just adding public interfaces.

(Note: this is to implement the behavior described #198 [1],
which is not yet reflected on algorithms.md / spec)

[1] https://github.com/slightlyoff/ServiceWorker/issues/198

BUG=349919

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171259 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: [Console] add ctrl-u shortcut to clear console prompt

BUG=335579

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171260 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Attach/detach the main thread in RunAllTests.cpp

After r171258, we need to explicitly attach/detach the main thread.
This CL does the attach/detach in RunAllTests.cpp.

TBR=ager@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171261 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Refactor v8_types.v8_value_to_local_cpp_value for clarity and to make Promises easier to implement

Noticed this cleanup, which will also make reuse easier.

Support for CL:
API functions returning Promises should not throw exceptions.
https://codereview.chromium.org/232563003/

R=haraken
BUG=359386

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171262 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove usages of touchEventEmulationEnabled setting from tests.

This setting is going away along with touch emulation tests. The only
clients left are some layout tests.

BUG=none

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

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