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

Issue 22650008: Add 'error' property to exceptions thrown via Worker::importScripts. (Closed)

Created:
7 years, 4 months ago by Mike West
Modified:
7 years, 4 months ago
Reviewers:
do-not-use, adamk
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, do-not-use
Visibility:
Public.

Description

Add 'error' property to exceptions thrown via Worker::importScripts. If an imported script throws an exception, and the script is same-origin with the Worker, we should provide the exception object when handling the exception via 'self.onerror'. The exception should not, however, be available to the page-level 'window.onerror' (we'd be leaking state across worlds otherwise (also, the spec says not to[1])). This patch pulls the logic governing the exception object's storage (wrapping the ErrorEvent, storing the value on a hidden property) out of V8Initializer, and moves it to a static method on V8ErrorHandler so that it's easily reusable inside WorkerScriptController. [1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#runtime-script-errors-0 BUG=270005 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155953

Patch Set 1 #

Total comments: 9

Patch Set 2 : Feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -20 lines) Patch
M LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin.html View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/v8/V8ErrorHandler.h View 1 2 chunks +5 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8ErrorHandler.cpp View 1 2 chunks +14 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8Initializer.cpp View 1 4 chunks +9 lines, -17 lines 0 comments Download
M Source/bindings/v8/WorkerScriptController.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/v8/WorkerScriptController.cpp View 1 3 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 11 (0 generated)
Mike West
Hi Christophe! Would you mind taking a first pass at this CL? I'd also like ...
7 years, 4 months ago (2013-08-09 12:01:20 UTC) #1
adamk
https://codereview.chromium.org/22650008/diff/1/Source/bindings/v8/V8ErrorHandler.cpp File Source/bindings/v8/V8ErrorHandler.cpp (right): https://codereview.chromium.org/22650008/diff/1/Source/bindings/v8/V8ErrorHandler.cpp#newcode84 Source/bindings/v8/V8ErrorHandler.cpp:84: // This method might be called while we're creating ...
7 years, 4 months ago (2013-08-09 17:11:32 UTC) #2
Mike West
Thanks for taking a look! https://codereview.chromium.org/22650008/diff/1/Source/bindings/v8/V8ErrorHandler.cpp File Source/bindings/v8/V8ErrorHandler.cpp (right): https://codereview.chromium.org/22650008/diff/1/Source/bindings/v8/V8ErrorHandler.cpp#newcode84 Source/bindings/v8/V8ErrorHandler.cpp:84: // This method might ...
7 years, 4 months ago (2013-08-09 20:34:51 UTC) #3
adamk
I assume there's already a test that non-same-origin importScripts don't get to share errors? https://codereview.chromium.org/22650008/diff/1/Source/bindings/v8/V8ErrorHandler.cpp ...
7 years, 4 months ago (2013-08-09 21:29:24 UTC) #4
Mike West
Regarding tests: http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-crossorigin.html and http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-redirect-to-crossorigin.html test the cross-origin behavior. They're both asserting that 'error' is ...
7 years, 4 months ago (2013-08-09 21:38:45 UTC) #5
Mike West
On 2013/08/09 21:38:45, Mike West wrote: > That makes sense, I'll rework it on Monday. ...
7 years, 4 months ago (2013-08-12 08:42:54 UTC) #6
adamk
lgtm
7 years, 4 months ago (2013-08-12 17:12:00 UTC) #7
do-not-use
lgtm
7 years, 4 months ago (2013-08-12 17:14:36 UTC) #8
Mike West
On 2013/08/12 17:14:36, Christophe Dumez wrote: > lgtm Thank you both.
7 years, 4 months ago (2013-08-12 18:57:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/22650008/11001
7 years, 4 months ago (2013-08-12 18:57:35 UTC) #10
commit-bot: I haz the power
7 years, 4 months ago (2013-08-12 21:27:21 UTC) #11
Message was sent while issue was closed.
Change committed as 155953

Powered by Google App Engine
This is Rietveld 408576698