Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Issue 22467005: Correctly attribute exceptions thrown inside a Worker's imported scripts. (Closed)

Created:
7 years, 4 months ago by Mike West
Modified:
7 years, 4 months ago
CC:
blink-reviews, Nils Barth (inactive), kojih, jsbell+bindings_chromium.org, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, haraken, Nate Chapin
Visibility:
Public.

Description

Correctly attribute exceptions thrown inside a Worker's imported scripts. Currently, we have strange behavior when a script loaded into a worker via 'importScripts()' throws an exception: * Rather than reporting the exception's full details for same-origin scripts, the exception is rethrown from the point at which 'importScripts()' is called. This makes it difficult to determine where the exception actually occurred. * Exceptions thrown from cross-origin scripts are incorrectly sanitized: the message is generally "Uncaught undefined", and the file/line/column all point to the 'importScripts()' call. This patch corrects both cases: cross-origin exceptions are sanitized in the same way that we sanitize non-worker exceptions (message of "Script error.", blank file, line and column both set to 0). Same-origin exceptions now contain accurate file/line/column information. Note that this patch does not address the 'error' parameter for same-origin exceptions. BUG=269538 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155824

Patch Set 1 #

Total comments: 7

Patch Set 2 : tests. #

Total comments: 1

Patch Set 3 : Removings. #

Patch Set 4 : Killing windows-specific expectations. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -127 lines) Patch
M LayoutTests/http/tests/workers/resources/worker-importscripts-onerror-crossorigin.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/workers/resources/worker-importscripts-onerror-redirect-to-crossorigin.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/workers/resources/worker-importscripts-onerror-sameorigin.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/workers/shared-worker-importScripts-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html View 1 1 chunk +12 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin-expected.txt View 1 1 chunk +10 lines, -7 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-redirect-to-crossorigin.html View 1 1 chunk +12 lines, -12 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-redirect-to-crossorigin-expected.txt View 1 1 chunk +10 lines, -7 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin.html View 1 1 chunk +10 lines, -9 lines 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin-expected.txt View 1 1 chunk +9 lines, -6 lines 0 comments Download
D LayoutTests/platform/win/http/tests/workers/worker-importScripts-expected.txt View 1 2 3 1 chunk +0 lines, -44 lines 0 comments Download
M Source/bindings/v8/WorkerScriptController.h View 1 2 4 chunks +5 lines, -4 lines 0 comments Download
M Source/bindings/v8/WorkerScriptController.cpp View 1 4 chunks +10 lines, -11 lines 0 comments Download
M Source/core/workers/WorkerGlobalScope.cpp View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Mike West
MOAR worker changes. Would you mind taking a look, Christophe? -mike
7 years, 4 months ago (2013-08-07 14:41:14 UTC) #1
do-not-use
Looks like http/tests/workers/worker-importScripts.html is failing on the try bot. https://codereview.chromium.org/22467005/diff/1/LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html File LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html (right): https://codereview.chromium.org/22467005/diff/1/LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html#newcode23 LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html:23: ...
7 years, 4 months ago (2013-08-07 18:05:05 UTC) #2
Mike West
Thanks for taking a look, Christophe. I'll track down what's going on with that test... ...
7 years, 4 months ago (2013-08-08 05:03:15 UTC) #3
do-not-use
https://codereview.chromium.org/22467005/diff/1/Source/bindings/v8/WorkerScriptController.cpp File Source/bindings/v8/WorkerScriptController.cpp (right): https://codereview.chromium.org/22467005/diff/1/Source/bindings/v8/WorkerScriptController.cpp#newcode170 Source/bindings/v8/WorkerScriptController.cpp:170: state->exception = ScriptValue(block.Exception()); On 2013/08/08 05:03:15, Mike West wrote: ...
7 years, 4 months ago (2013-08-08 06:25:00 UTC) #4
Use mkwst_at_chromium.org plz.
On 2013/08/08 06:25:00, Christophe Dumez wrote: > I think it is fine to keep it ...
7 years, 4 months ago (2013-08-08 07:19:00 UTC) #5
do-not-use
https://codereview.chromium.org/22467005/diff/10001/Source/bindings/v8/WorkerScriptController.cpp File Source/bindings/v8/WorkerScriptController.cpp (left): https://codereview.chromium.org/22467005/diff/10001/Source/bindings/v8/WorkerScriptController.cpp#oldcode171 Source/bindings/v8/WorkerScriptController.cpp:171: state->exception = throwError(v8GeneralError, "Script error.", m_isolate); It feels bad ...
7 years, 4 months ago (2013-08-08 07:23:45 UTC) #6
Mike West
On 2013/08/08 07:23:45, Christophe Dumez wrote: > https://codereview.chromium.org/22467005/diff/10001/Source/bindings/v8/WorkerScriptController.cpp > File Source/bindings/v8/WorkerScriptController.cpp (left): > > https://codereview.chromium.org/22467005/diff/10001/Source/bindings/v8/WorkerScriptController.cpp#oldcode171 ...
7 years, 4 months ago (2013-08-08 12:26:48 UTC) #7
do-not-use
LGTM. Sadly, the try bots seem to be stuck?
7 years, 4 months ago (2013-08-08 13:08:30 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/22467005/19001
7 years, 4 months ago (2013-08-09 05:16:13 UTC) #9
commit-bot: I haz the power
7 years, 4 months ago (2013-08-09 05:19:47 UTC) #10
Message was sent while issue was closed.
Change committed as 155824

Powered by Google App Engine
This is Rietveld 408576698