
- Prevent race condition in CastAudioOutputStream to prevent FillNextBuffer() from calling AudioSourceCallback::OnMoreData() after AudioOutputStream::Close() is called. - FillNextBuffer() will now acquire running_lock_ for the entirety of its scope. - CastAudioOutputStream::Close() will synchronously block on running_lock_ until FillNextBuffer() has completed before setting running_ to false and continuing its close sequence. - Subsequent calls to FillNextBuffer() will early return without calling AudioSourceCallback::OnMoreData(). - Add infrastructure in CastAudioOutputStream unittests to pause and resume the audio thread. - Add a test in CastAudioOutputStream unittests to ensure that a call to Close() will synchronously prevent any further callbacks. mutex synchronization is removed, race condition is difficult to reproduce in real-world testing. Bug: 138695782 Test: Builds, unit tests pass, new unit test passes and fails when the Change-Id: I11cdd64c0987298ba3fc6a9090359bd2715e6f03 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761483 Reviewed-by: Olga Sharonova <olka@chromium.org> Reviewed-by: Kenneth MacKay <kmackay@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org> Commit-Queue: Hari Nandagopal <hnandagopal@google.com> Cr-Commit-Position: refs/heads/master@{#691784}
Cast base
cast_features
This file contains tools for checking the feature state of all of the features which affect Cast products. Cast features build upon the Chrome feature system. Some aspects of Cast require the feature system to work differently, however, so some additional logic has been layered on top. Details are available in comments of the header file. The basics are:
- If you are adding a new feature, add it to
cast_features.cc
so it lives alongside existing features - Add your new feature to the list of
kFeatures
incast_features.cc
const base::Feature kMyFeature{"my_feature", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature* kFeatures[] = {
// ..other features
&kMyFeature
}