|
Add 'error' parameter to 'window.onerror' and 'ErrorEvent'.
The HTML5 spec recently added the error object to both the
'window.onerror' callback and the 'ErrorEvent' interface in order to
improve developers' ability to debug issues that cause unexpected
exceptions in the wild[1]. This patch brings Blink's behavior into line
with that update.
Currently, we generate an ErrorEvent object after doing sanitization.
This patch refactors that code such that we generate an ErrorEvent when
V8 calls back into the bindings (V8Initializer::messageHandlerInWorker
and V8Initializer::messageHandlerInMainThread). Before we hand that
event off to core for sanitization and dispatch, we grab the wrapper
for the world in which the exception was thrown, and set the exception
object as a hidden value (V8HiddenPropertyName::error()).
On the other end, we grab that exception object in the custom 'error'
getter of 'V8ErrorEvent', and when triggering the 'onerror' handler
via 'V8ErrorHandler::callListenerFunction'. If the value exists, we're
still in the same isolated world, so we can safely return the exception
without leakage. If the value is empty, we've crossed worlds, and
return 'null' instead.
BUG= 147127
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155454
Total comments: 1
Total comments: 2
Total comments: 5
Total comments: 1
Total comments: 16
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+333 lines, -61 lines) |
Patch |
|
M |
LayoutTests/fast/events/constructors/error-event-constructor.html
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+11 lines, -6 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/constructors/error-event-constructor-expected.txt
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/resources/onerror-test.js
|
View
|
1
|
5 chunks |
+23 lines, -5 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-01-expected.txt
|
View
|
1
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-02-expected.txt
|
View
|
1
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-03-expected.txt
|
View
|
1
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-04-expected.txt
|
View
|
1
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-05-expected.txt
|
View
|
1
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-06-expected.txt
|
View
|
1
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-09-expected.txt
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-10-expected.txt
|
View
|
1
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-11-expected.txt
|
View
|
1
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-12-expected.txt
|
View
|
1
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt
|
View
|
1
|
1 chunk |
+68 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-isolatedworld-02.html
|
View
|
1
|
1 chunk |
+11 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/window-onerror-isolatedworld-02-expected.txt
|
View
|
1
|
1 chunk |
+16 lines, -10 lines |
0 comments
|
Download
|
|
M |
Source/bindings/bindings.gypi
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/IDLAttributes.txt
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/deprecated_code_generator_v8.pm
|
View
|
1
2
3
4
5
6
7
8
|
2 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/bindings/v8/V8ErrorHandler.cpp
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+7 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/v8/V8HiddenPropertyName.h
|
View
|
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/v8/V8Initializer.cpp
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+16 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/bindings/v8/WorkerScriptController.cpp
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
|
A + |
Source/bindings/v8/custom/V8ErrorEventCustom.cpp
|
View
|
1
2
3
4
5
6
|
1 chunk |
+21 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/ErrorEvent.h
|
View
|
1
2
3
4
5
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/ErrorEvent.idl
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/ScriptExecutionContext.h
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/ScriptExecutionContext.cpp
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+15 lines, -13 lines |
0 comments
|
Download
|
|
M |
Source/core/workers/WorkerMessagingProxy.cpp
|
View
|
1
2
3
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
Total messages: 24 (0 generated)
|