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

Issue 293053007: V8AbstractEventListener should hold a ScriptState (Closed)

Created:
6 years, 7 months ago by haraken
Modified:
6 years, 6 months ago
Reviewers:
dcarney, tasak, adamk
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Visibility:
Public.

Description

V8AbstractEventListener should hold a ScriptState - Basically, this CL replaces V8AbstractEventListener::m_world with V8AbstractEventListener::m_scriptState. - This CL uses the ScriptState in a lot of places about event listeners and cleans up the code (for example, this CL removes an empty creation context from toV8()). - The complicated part is that V8LazyEventListener does not know the ScriptState when it's created. Thus, V8AbstractEventListener::m_scriptState can be null if the listener is a V8LazyEventListener until the V8LazyEventListener is called back from Blink (i.e., either of handleEvent(), callListenerFunction() and getEventListener() is called). - This CL changes web-exposed behavior. In a case where the frame that registered an onload event handler (say Frame1) is different from the frame that triggers the onload event (Frame2), before this CL, the onload event handler is invoked in the context of Frame2. After this CL, the onload event handler is not triggered if Frame1 != Frame2. This behavior is not speced but aligns with Firefox. See comment #17 and #19 for more details. BUG=357144 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175241

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -228 lines) Patch
D LayoutTests/fast/dom/resources/set-frame-src-while-running-script-in-frame.html View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download
D LayoutTests/fast/dom/resources/xmlhttprequest-constructor-in-detached-document-frame.html View 1 2 3 4 1 chunk +0 lines, -20 lines 0 comments Download
D LayoutTests/fast/dom/set-frame-src-while-running-script-in-frame.html View 1 2 3 4 1 chunk +0 lines, -13 lines 0 comments Download
D LayoutTests/fast/dom/xmlhttprequest-constructor-in-detached-document.html View 1 2 3 4 1 chunk +0 lines, -17 lines 0 comments Download
M Source/bindings/scripts/v8_attributes.py View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/V8AbstractEventListener.h View 1 2 2 chunks +15 lines, -5 lines 0 comments Download
M Source/bindings/v8/V8AbstractEventListener.cpp View 1 2 3 4 5 5 chunks +34 lines, -35 lines 0 comments Download
M Source/bindings/v8/V8ErrorHandler.h View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/bindings/v8/V8ErrorHandler.cpp View 1 2 3 4 5 2 chunks +12 lines, -12 lines 0 comments Download
M Source/bindings/v8/V8EventListener.h View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/bindings/v8/V8EventListener.cpp View 1 2 3 4 5 2 chunks +9 lines, -13 lines 0 comments Download
M Source/bindings/v8/V8EventListenerList.h View 4 chunks +12 lines, -11 lines 0 comments Download
M Source/bindings/v8/V8EventListenerList.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/bindings/v8/V8LazyEventListener.h View 1 chunk +4 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8LazyEventListener.cpp View 1 2 3 4 5 6 8 chunks +45 lines, -38 lines 0 comments Download
M Source/bindings/v8/V8WorkerGlobalScopeEventListener.h View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp View 1 2 3 4 5 2 chunks +20 lines, -31 lines 0 comments Download
M Source/web/tests/CustomEventTest.cpp View 1 2 3 4 3 chunks +9 lines, -12 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
haraken
PTAL
6 years, 7 months ago (2014-05-21 10:37:42 UTC) #1
dcarney
lgtm
6 years, 7 months ago (2014-05-21 10:41:35 UTC) #2
adamk
lgtm https://codereview.chromium.org/293053007/diff/20001/Source/bindings/v8/V8AbstractEventListener.cpp File Source/bindings/v8/V8AbstractEventListener.cpp (left): https://codereview.chromium.org/293053007/diff/20001/Source/bindings/v8/V8AbstractEventListener.cpp#oldcode108 Source/bindings/v8/V8AbstractEventListener.cpp:108: if (v8Context.IsEmpty()) I take it you removed this ...
6 years, 7 months ago (2014-05-21 10:51:05 UTC) #3
haraken
https://codereview.chromium.org/293053007/diff/20001/Source/bindings/v8/V8AbstractEventListener.cpp File Source/bindings/v8/V8AbstractEventListener.cpp (left): https://codereview.chromium.org/293053007/diff/20001/Source/bindings/v8/V8AbstractEventListener.cpp#oldcode108 Source/bindings/v8/V8AbstractEventListener.cpp:108: if (v8Context.IsEmpty()) On 2014/05/21 10:51:06, adamk wrote: > I ...
6 years, 7 months ago (2014-05-21 11:15:31 UTC) #4
haraken
The CQ bit was checked by haraken@chromium.org
6 years, 7 months ago (2014-05-21 11:15:35 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/293053007/60001
6 years, 7 months ago (2014-05-21 11:16:38 UTC) #6
haraken
+tasak: FYI.
6 years, 7 months ago (2014-05-21 11:41:09 UTC) #7
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-21 17:54:23 UTC) #8
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-21 17:57:18 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu_triggered_tests/builds/16278)
6 years, 7 months ago (2014-05-21 17:57:19 UTC) #10
haraken
The CQ bit was checked by haraken@chromium.org
6 years, 7 months ago (2014-05-21 17:57:47 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/293053007/60001
6 years, 7 months ago (2014-05-21 17:59:47 UTC) #12
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-21 23:54:39 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-22 00:40:22 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/8541)
6 years, 7 months ago (2014-05-22 00:40:22 UTC) #15
adamk
These look like real failures too...
6 years, 7 months ago (2014-05-22 07:10:44 UTC) #16
haraken
adamk@, dcarney@: I removed the failing two tests, because this CL is changing behavior and ...
6 years, 6 months ago (2014-05-29 05:50:39 UTC) #17
adamk
I think I agree with you that for this test, the new behavior is acceptable ...
6 years, 6 months ago (2014-05-29 23:33:58 UTC) #18
haraken
On 2014/05/29 23:33:58, adamk wrote: > I think I agree with you that for this ...
6 years, 6 months ago (2014-05-30 04:36:45 UTC) #19
haraken
Note: - set-frame-src-while-running-script-in-frame.html is introduced in http://src.chromium.org/viewvc/blink?revision=19094&view=revision - fast/dom/xmlhttprequest-constructor-in-detached-document.html is introduced in http://src.chromium.org/viewvc/blink?revision=42700&view=revision Both CLs ...
6 years, 6 months ago (2014-05-30 04:38:36 UTC) #20
adamk
lgt, I think you've successfully convinced me that this new behavior is reasonable. Please make ...
6 years, 6 months ago (2014-05-30 20:03:46 UTC) #21
adamk
er, lgtm
6 years, 6 months ago (2014-05-30 20:03:53 UTC) #22
haraken
On 2014/05/30 20:03:46, adamk wrote: > lgt, I think you've successfully convinced me that this ...
6 years, 6 months ago (2014-06-02 00:40:38 UTC) #23
haraken
The CQ bit was checked by haraken@chromium.org
6 years, 6 months ago (2014-06-02 00:40:44 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/293053007/120001
6 years, 6 months ago (2014-06-02 00:41:01 UTC) #25
commit-bot: I haz the power
6 years, 6 months ago (2014-06-02 01:17:52 UTC) #26
Message was sent while issue was closed.
Change committed as 175241

Powered by Google App Engine
This is Rietveld 408576698