Terminate AnimationWorklet's backing thread when no one uses it |
||||
Issue descriptionWorkerBackingThread for AnimationWorklet is shared by multiple AnimationWorkletGlobalScopes in the same renderer process. The backing thread is created when the first global scope is created, and kept as a singleton object by AnimationWorkletThread until the renderer process gets destroyed. This model worked well before because AnimationWorklet used the compositor thread as the backing thread. However, after worker thread migration ( issue 731727 ), AnimationWorklet started running on a general worker thread and its backing thread is terminatable before the renderer process gets destroyed. To cut memory consumption, we should no sooner terminate the thread than all global scopes on the thread are closed. Probably we can do the same thing with AudioWorklet. AudioWorklet manages its backing thread by reference counting: https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/webaudio/audio_worklet_thread.cc?sq=package:chromium&dr=CSs&g=0&l=26 (This issue was found in issue 892006 )
,
Oct 9
,
Oct 17
I will be taking care of this this sprint whilst doing the PaintWorkletGlobalScope unification work.
,
Oct 18
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c5c01f7ed3136f9d143f43dc46dc2131abc23fe7 commit c5c01f7ed3136f9d143f43dc46dc2131abc23fe7 Author: Stephen McGruer <smcgruer@chromium.org> Date: Thu Oct 18 18:48:39 2018 [AnimationWorklet] Properly setup and teardown the backing thread This CL adds refcounting around the backing thread for AnimationWorklet, such that the backing thread is actually torn down when all AnimationWorkletThread objects are destroyed. Bug: 892527 Change-Id: I750b63c74146a4a4dc7b3b1ebda0e66b269b13dc Reviewed-on: https://chromium-review.googlesource.com/c/1286772 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Majid Valipour <majidvp@chromium.org> Reviewed-by: Yi Gu <yigu@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#600842} [modify] https://crrev.com/c5c01f7ed3136f9d143f43dc46dc2131abc23fe7/third_party/blink/renderer/modules/animationworklet/animation_worklet.cc [modify] https://crrev.com/c5c01f7ed3136f9d143f43dc46dc2131abc23fe7/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc [modify] https://crrev.com/c5c01f7ed3136f9d143f43dc46dc2131abc23fe7/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread.cc [modify] https://crrev.com/c5c01f7ed3136f9d143f43dc46dc2131abc23fe7/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread.h [modify] https://crrev.com/c5c01f7ed3136f9d143f43dc46dc2131abc23fe7/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread_test.cc
,
Oct 18
|
||||
►
Sign in to add a comment |
||||
Comment 1 by sunxd@chromium.org
, Oct 5