Bug 37691 - [v8] In Workers, script errors right after close() are not delivered to the Worker.onerror
Summary: [v8] In Workers, script errors right after close() are not delivered to the W...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other All
: P2 Normal
Assignee: Dmitry Titov
Depends on:
Reported: 2010-04-15 18:54 PDT by Dmitry Titov
Modified: 2010-04-16 17:16 PDT (History)
3 users (show)

See Also:

Patch. (5.06 KB, patch)
2010-04-15 19:25 PDT, Dmitry Titov
yurys: review+
dimich: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Titov 2010-04-15 18:54:58 PDT
WorkerGlobalScope.close() sets a flag in WorkerScriptController which makes WorkerScriptController::proxy() to always return 0. That prevents re-entry in JS after the block of script that called close() exits. However, the static accessor WebCore::getScriptExecutionContext() that retrieves the current WorkerContext using the DOM wrapper of the current v8 context uses proxy() and therefore starts to return 0 as well. This is un-necessary (and harmful) since retrieving of the current WorkerContext is not used to evaluate JS but rather to call various methods on it (like reportException(...)) and creating objects, which is fine to do even after close() called. 

The worker-close.html layout test is currently failing on chromium for this reason.

The fix is to avoid using proxy() for pulling out the WorkerContext from WorkerScriptController and just pull it from WorkerScriptController directly, since it also has it. Patch coming.
Comment 1 Dmitry Titov 2010-04-15 19:25:51 PDT
Created attachment 53505 [details]
Comment 2 Dmitry Titov 2010-04-16 17:16:41 PDT
Updated the expected result for platform/chromium and landed: http://trac.webkit.org/changeset/57767