|
|
Chromium Code Reviews|
Created:
6 years, 5 months ago by haraken Modified:
6 years, 4 months ago CC:
abarth-chromium, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org Base URL:
svn://svn.chromium.org/blink/trunk Project:
blink Visibility:
Public. |
DescriptionAdd ScriptForbiddenScope to weak callbacks of DOM wrappers
It's dangerous to allow arbitrary JavaScript to run during a V8 GC.
BUG=389445
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177457
Patch Set 1 #
Total comments: 2
Patch Set 2 : #
Total comments: 1
Messages
Total messages: 25 (0 generated)
V8RecursionScope has ASSERT(ScriptForbiddenScope::isScriptForbidden), so the assert will be caught only in Debug builds. I'm planning to change it to RELEASE_ASSERT in a follow-up CL. PTAL.
https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... File Source/bindings/core/v8/ScriptWrappable.h (right): https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... Source/bindings/core/v8/ScriptWrappable.h:256: ScriptForbiddenScope forbiddenScope; why here?
https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... File Source/bindings/core/v8/ScriptWrappable.h (right): https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... Source/bindings/core/v8/ScriptWrappable.h:256: ScriptForbiddenScope forbiddenScope; On 2014/07/02 11:21:54, jochen wrote: > why here? Because this calls releaseObject() for DOM wrappers stored in ScriptWrappable.
On 2014/07/02 11:23:13, haraken wrote: > https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... > File Source/bindings/core/v8/ScriptWrappable.h (right): > > https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... > Source/bindings/core/v8/ScriptWrappable.h:256: ScriptForbiddenScope > forbiddenScope; > On 2014/07/02 11:21:54, jochen wrote: > > why here? > > Because this calls releaseObject() for DOM wrappers stored in ScriptWrappable. Probably are you suggesting to rename the method to clearWrapper or something like that?
On 2014/07/02 at 11:23:39, haraken wrote: > On 2014/07/02 11:23:13, haraken wrote: > > https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... > > File Source/bindings/core/v8/ScriptWrappable.h (right): > > > > https://codereview.chromium.org/368853002/diff/1/Source/bindings/core/v8/Scri... > > Source/bindings/core/v8/ScriptWrappable.h:256: ScriptForbiddenScope > > forbiddenScope; > > On 2014/07/02 11:21:54, jochen wrote: > > > why here? > > > > Because this calls releaseObject() for DOM wrappers stored in ScriptWrappable. > > Probably are you suggesting to rename the method to clearWrapper or something like that? ah, no, I just misread the diff lgtm
The CQ bit was checked by haraken@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/368853002/1
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/1...) mac_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/13946)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/1...)
https://codereview.chromium.org/368853002/diff/20001/Source/core/dom/ScriptFo... File Source/core/dom/ScriptForbiddenScope.cpp (right): https://codereview.chromium.org/368853002/diff/20001/Source/core/dom/ScriptFo... Source/core/dom/ScriptForbiddenScope.cpp:20: if (isMainThread()) Since ScriptWrappable and DOMWrapperMap are used in workers as well, I removed the ASSERT(isMainThread()). I'll consider supporting non-main threads in a follow-up.
The CQ bit was checked by haraken@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/368853002/20001
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/28835)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/28862)
The CQ bit was checked by haraken@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/368853002/20001
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/28901)
Message was sent while issue was closed.
Change committed as 177457
Message was sent while issue was closed.
On 2014/07/03 at 07:43:44, commit-bot wrote: > Change committed as 177457 This is making isMainThread() show up in all the profiles now, I don't think you want to have that branch. We also probably need to make ScriptForbiddenScope inline.
Message was sent while issue was closed.
On 2014/07/29 23:01:14, esprehn wrote: > On 2014/07/03 at 07:43:44, commit-bot wrote: > > Change committed as 177457 > > This is making isMainThread() show up in all the profiles now, I don't think you > want to have that branch. We also probably need to make ScriptForbiddenScope > inline. Would it be OK to use a thread-local storage for s_scriptForbiddenCount? I don't think the performance overhead of accessing thread-local storage would become a problem.
Message was sent while issue was closed.
A revert of this CL has been created in https://codereview.chromium.org/430763002/ by abarth@chromium.org. The reason for reverting is: This CL regressed performance. We'll need to re-think how to handle this situation.
Message was sent while issue was closed.
I failed to revert this CL, but we probably should revert it while we sort out the performance issues.
Message was sent while issue was closed.
On 2014/07/30 07:03:46, abarth wrote: > I failed to revert this CL, but we probably should revert it while we sort out > the performance issues. I'll revert it tomorrow and investigate. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
