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

Issue 2615253002: Resolve ready and finished promises asynchronously (Closed)

Created:
3 years, 11 months ago by adithyas
Modified:
3 years, 11 months ago
CC:
darktears, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-bindings_chromium.org, chromium-reviews, Eric Willigers, rjwright, shans
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Resolve ready and finished promises asynchronously ~PlayStateUpdateScope() can be called inside a ScriptForbiddenScope, and resolving promises synchronously in ~PlayStateUpdateScope could result in script execution inside a forbidden scope. This patch makes promise resolution inside the destructor asynchronous. The DCHECK added crashes the following tests (when the promises are resolved synchronously): web-animations-api/animation-ready-promise.html animations/filter-responsive-neutral-keyframe.html web-animations-api/playState-changes.html imported/wpt/web-animations/interfaces/Animation/finished.html imported/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html web-animations-api/startTime.html imported/wpt/web-animations/interfaces/Animation/playState.html animations/viewport-unit-animation-responsive.html imported/wpt/web-animations/interfaces/Animation/cancel.html animations/zoom-responsive-transform-animation.html imported/wpt/web-animations/interfaces/Animation/play.html animations/transform-responsive-neutral-keyframe.html animations/opacity-responsive-neutral-keyframe.html imported/wpt/web-animations/interfaces/Animation/onfinish.html imported/wpt/web-animations/timing-model/animations/updating-the-finished-state.html transitions/opacity-transition-zindex.html transitions/opacity-transform-transitions-inside-iframe.html virtual/threaded/animations/transitions-retarget.html imported/wpt/web-animations/interfaces/Animation/startTime.html imported/wpt/web-animations/interfaces/Animation/playbackRate.html imported/wpt/web-animations/interfaces/Animation/pause.html web-animations-api/animation-set-timeline.html BUG=678706 Review-Url: https://codereview.chromium.org/2615253002 Cr-Commit-Position: refs/heads/master@{#442272} Committed: https://chromium.googlesource.com/chromium/src/+/ffb284d85f2e725aefb2314d436addf9431622ad

Patch Set 1 #

Total comments: 7

Patch Set 2 : Fix nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -8 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/animation/Animation.h View 1 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/animation/Animation.cpp View 1 5 chunks +14 lines, -4 lines 0 comments Download

Messages

Total messages: 29 (17 generated)
adithyas
3 years, 11 months ago (2017-01-06 20:58:52 UTC) #7
esprehn
Can we get a test? :) Also is the promise resolving code hardened against the ...
3 years, 11 months ago (2017-01-06 21:10:25 UTC) #8
adithyas
https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h File third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h (right): https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h#newcode108 third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h:108: DCHECK(!ScriptForbiddenScope::isScriptForbidden()); On 2017/01/06 at 21:10:25, esprehn wrote: > We ...
3 years, 11 months ago (2017-01-06 21:33:41 UTC) #9
esprehn
On 2017/01/06 at 21:33:41, adithyas wrote: > https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h > File third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h (right): > > https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h#newcode108 ...
3 years, 11 months ago (2017-01-06 21:36:39 UTC) #10
haraken
What is PlayUpdateScope? I cannot find it in the code base. In general, it's not ...
3 years, 11 months ago (2017-01-07 01:22:06 UTC) #12
esprehn
On 2017/01/07 at 01:22:06, haraken wrote: > What is PlayUpdateScope? I cannot find it in ...
3 years, 11 months ago (2017-01-07 02:21:21 UTC) #13
jbroman
lgtm w/ nits https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/core/animation/Animation.cpp File third_party/WebKit/Source/core/animation/Animation.cpp (right): https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/core/animation/Animation.cpp#newcode1119 third_party/WebKit/Source/core/animation/Animation.cpp:1119: WTF::bind(&AnimationPromise::resolve<Member<Animation>>, nit: Similarly, I'd expect this ...
3 years, 11 months ago (2017-01-07 04:06:36 UTC) #14
haraken
On 2017/01/07 02:21:21, esprehn wrote: > On 2017/01/07 at 01:22:06, haraken wrote: > > What ...
3 years, 11 months ago (2017-01-07 09:37:39 UTC) #15
alancutter (OOO until 2018)
lgtm. https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/core/animation/Animation.h File third_party/WebKit/Source/core/animation/Animation.h (right): https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/core/animation/Animation.h#newcode227 third_party/WebKit/Source/core/animation/Animation.h:227: AnimationPromise; Nit: "using =" might be easier to ...
3 years, 11 months ago (2017-01-09 03:25:07 UTC) #17
adithyas
https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/core/animation/Animation.h File third_party/WebKit/Source/core/animation/Animation.h (right): https://codereview.chromium.org/2615253002/diff/1/third_party/WebKit/Source/core/animation/Animation.h#newcode227 third_party/WebKit/Source/core/animation/Animation.h:227: AnimationPromise; On 2017/01/09 at 03:25:07, alancutter wrote: > Nit: ...
3 years, 11 months ago (2017-01-09 15:22:58 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2615253002/20001
3 years, 11 months ago (2017-01-09 16:58:24 UTC) #26
commit-bot: I haz the power
3 years, 11 months ago (2017-01-09 17:05:14 UTC) #29
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/ffb284d85f2e725aefb2314d436a...

Powered by Google App Engine
This is Rietveld 408576698