Commit 697401b4 authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

AnimationWorklet: Check for threaded animations before constructing a WorkletAnimation

This avoids hitting the DCHECK in WorkletAnimation::WorkletAnimation in
the case where --disable-threaded-animations is specified.

Bug: 825127
Change-Id: I5e2eb0684e472d5a88f40ad07f19f73c0118b627
Reviewed-on: https://chromium-review.googlesource.com/980234Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545824}
parent 1a8035fc
...@@ -155,6 +155,13 @@ WorkletAnimation* WorkletAnimation::Create( ...@@ -155,6 +155,13 @@ WorkletAnimation* WorkletAnimation::Create(
ExceptionState& exception_state) { ExceptionState& exception_state) {
DCHECK(IsMainThread()); DCHECK(IsMainThread());
if (!Platform::Current()->IsThreadedAnimationEnabled()) {
exception_state.ThrowDOMException(
kInvalidStateError,
"AnimationWorklet requires threaded animations to be enabled");
return nullptr;
}
HeapVector<Member<KeyframeEffect>> keyframe_effects; HeapVector<Member<KeyframeEffect>> keyframe_effects;
String error_string; String error_string;
if (!ConvertAnimationEffects(effects, keyframe_effects, error_string)) { if (!ConvertAnimationEffects(effects, keyframe_effects, error_string)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment