Reland of Worker: Introduce per-global-scope task scheduler

I couldn't reproduce the failure on my local machine and trybots.
If this still fails the tests only on the specific bot, I'll mark them with
SKIP and fix them in a separate CL.

Original issue's description:
> Revert of Worker: Introduce per-global-scope task scheduler (patchset #22 id:450001 of https://codereview.chromium.org/2806623004/ )
>
> Reason for revert:
> Seems to have caused a crash in fast/workers/termination-early.html on Webkit Linux Trusty Leak -
> https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_Trusty_Leak/4107/layout-test-results/results.html
> https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linux%20Trusty%20Leak/builds/4107
>
> https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_Trusty_Leak/4106/layout-test-results/fast/workers/termination-early-crash-log.txt
> https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linux%20Trusty%20Leak/builds/4106
>
> Original issue's description:
> > Worker: Introduce per-global-scope task scheduler
> >
> > This CL introduces WorkerGlobalScopeScheduler to make it simpler and saner to
> > manage tasks on worker threads.
> >
> > Before this CL, tasks on worker threads were always pushed into the thread's
> > default task queue, they should be handled in different ways based on their
> > task types though. For example, worker tasks shouldn't run after the global
> > scope is closed, while thread control tasks should run even after that. To
> > achieve it, worker tasks were always wrapped with WorkerThread's method to check
> > the current thread state. This was so tricky.
> >
> > After this CL, each global scope has its own task queues like per-frame task
> > scheduler. Worker tasks are pushed into the task queues, control tasks are still
> > pushed into the thread's default task queue though. Thanks to this separation,
> > we can abort only worker tasks by simply unregistering the queues when a global
> > scope is closed.
> >
> > In addition, this CL unifies postTask interfaces into TaskRunnerHelper (issue
> > 694914), and enables any threads to post a task to worker threads because of
> > thread-safe refcounted WebTaskRunner.
> >
> > BUG=670534, 694914, 710364
> >
> > Review-Url: https://codereview.chromium.org/2806623004
> > Cr-Commit-Position: refs/heads/master@{#465841}
> > Committed: https://chromium.googlesource.com/chromium/src/+/d56a35fb25dc388a0506174b9e3fda67337313ce
>
> TBR=kinuko@chromium.org,haraken@chromium.org,tzik@chromium.org,skyostil@chromium.org,altimin@chromium.org,nhiroki@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=670534, 694914, 710364
>
> Review-Url: https://codereview.chromium.org/2831843002
> Cr-Commit-Position: refs/heads/master@{#465892}
> Committed: https://chromium.googlesource.com/chromium/src/+/ee6a4f06b0e0561618669ed56e5997af91108c3e

TBR=kinuko@chromium.org,haraken@chromium.org,tzik@chromium.org,skyostil@chromium.org,altimin@chromium.org,aboxhall@chromium.org
BUG=670534, 694914, 710364

Review-Url: https://codereview.chromium.org/2832763002
Cr-Commit-Position: refs/heads/master@{#465962}
31 files changed