Fix incomplete inheritance of BaseAudioContext and AudioContext |
||
Issue description
The current call chain when BAC is collected:
BaseAudioContext::ContextDestroyed()
-> BaseAudioContext::Uninitialize()
However, AC needs .close() call to invoke the uinitialization:
AudioContext::CloseContext()
-> AudioContext::Uninitialize()
So without calling .close() method, AC's resources will not be collected properly.
The solution is:
AudioContext::ContextDestroyed()
-> AudioContext::Uninitialize()
-> BaseAudioContext::Uninitialize()
and also CloseContext() does not have to collect resource aggressively.
AudioContext::CloseContext()
-> StopRendering()
-> DidClose()
,
Jun 29 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fbeb7bf25a794a2d482e56faab4577b09a36c9d5 commit fbeb7bf25a794a2d482e56faab4577b09a36c9d5 Author: Hongchan Choi <hongchan@chromium.org> Date: Fri Jun 29 01:08:08 2018 Add AudioContext::ContextDestroyed Currently AudioContext has no way of uninitializing the instance without an explicit context closure. This extends BaseAudioContext's ContextDestroyed to AudioContext so we can hook up its own uninitialize routine, and then eventually calls the parent's uninitializer. This also fixes other issue of UKM metrics being reported in less cases because they were only reported when context.close() was called. Bug: 856690 , 688052 , 670065 Change-Id: I721dc2c27201caab1b0a95baf8f6906f44b76979 Reviewed-on: https://chromium-review.googlesource.com/1115516 Commit-Queue: Hongchan Choi <hongchan@chromium.org> Reviewed-by: Raymond Toy <rtoy@chromium.org> Cr-Commit-Position: refs/heads/master@{#571349} [modify] https://crrev.com/fbeb7bf25a794a2d482e56faab4577b09a36c9d5/third_party/WebKit/LayoutTests/webaudio/internals/audiocontext-close.html [modify] https://crrev.com/fbeb7bf25a794a2d482e56faab4577b09a36c9d5/third_party/blink/renderer/modules/webaudio/audio_context.cc [modify] https://crrev.com/fbeb7bf25a794a2d482e56faab4577b09a36c9d5/third_party/blink/renderer/modules/webaudio/audio_context.h [modify] https://crrev.com/fbeb7bf25a794a2d482e56faab4577b09a36c9d5/third_party/blink/renderer/modules/webaudio/base_audio_context.cc [modify] https://crrev.com/fbeb7bf25a794a2d482e56faab4577b09a36c9d5/third_party/blink/renderer/modules/webaudio/base_audio_context.h
,
Jun 29 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by hongchan@chromium.org
, Jun 26 2018