Commit 6cded335 authored by Hongchan Choi's avatar Hongchan Choi Committed by Commit Bot

Add check for |destination_node_| before querying info from context

The refactoring CL
(https://chromium-review.googlesource.com/c/chromium/src/+/1115516)
removed the redundant checks for the destination node in some getters.

In rare cases, however, these checks turned out to be necessary due
to the problematic design, which needs a long-term solution.

This CL adds those checks back in as a short-term workaround.

Bug: 860626
Change-Id: I78acb597851249a09d00094e6f1984d8c5b76613
Reviewed-on: https://chromium-review.googlesource.com/1138650
Commit-Queue: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: default avatarRaymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575449}
parent 7cd1cd44
......@@ -127,11 +127,19 @@ class MODULES_EXPORT BaseAudioContext
AudioDestinationNode* destination() const;
size_t CurrentSampleFrame() const {
return destination_node_->GetAudioDestinationHandler().CurrentSampleFrame();
// TODO(crbug.com/863951): |destination_node| is a GC-mananged object and
// should not be touched by the audio rendering thread.
return destination_node_ ? destination_node_->GetAudioDestinationHandler()
.CurrentSampleFrame()
: 0;
}
double currentTime() const {
return destination_node_->GetAudioDestinationHandler().CurrentTime();
// TODO(crbug.com/863951): |destination_node| is a GC-mananged object and
// should not be touched by the audio rendering thread.
return destination_node_
? destination_node_->GetAudioDestinationHandler().CurrentTime()
: 0;
}
float sampleRate() const {
......
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