Worker: Add a new error reporting path for top-level worker script fetch

Before this CL, unhandled runtime exceptions on WorkerGlobalScope and errors on
off-the-main-thread top-level worker script fetch are reported to the parent
execution context in the same way. According to the HTML spec, this was wrong.

For unhandled runtime exceptions, if it's also unhandled by the parent execution
context, that should be propagated to the grandparent execution context and so
forth. See the "Runtime script errors" algorithm:
  https://html.spec.whatwg.org/multipage/workers.html#runtime-script-errors-2

On the other hand, for script fetch erros, that should just dispatch an error
event at the worker object in the parent execution context:
  "Queue a task to fire an event named error at worker."
  https://html.spec.whatwg.org/multipage/workers.html#worker-processing-model

This CL adds a new error reporting path for errors on top-level worker script
fetch (WorkerReportingProxy::DidFailToFetchClassicScript()). This change fixes
web_tests failures when off-the-main-thread worker script fetch is enabled. In
those tests, script fetch errors are treated as unhandled exceptions and the
test harness complains it.

Note that this change affects only off-the-main-thread worker script fetch.
On-the-main-thread worker script fetch correctly dispatches the error event
without the propagation before this change (see DedicatedWorker::OnFinished()).

Change-Id: I093dc024a817516b88d062bcefc978935320418d
Bug: 835717
Reviewed-on: https://chromium-review.googlesource.com/c/1370230
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616242}
12 files changed