Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: media/audio/sounds/sounds_manager.cc

Issue 2914593002: Replace deprecated base::NonThreadSafe in media/audio in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/sounds/sounds_manager.h ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/sounds/sounds_manager.cc
diff --git a/media/audio/sounds/sounds_manager.cc b/media/audio/sounds/sounds_manager.cc
index c678645eae247eb460ae38f35e7c87438fb46b90..46ba140d8b95cb9a080f15dffc2a9e3c1e4aca8a 100644
--- a/media/audio/sounds/sounds_manager.cc
+++ b/media/audio/sounds/sounds_manager.cc
@@ -23,7 +23,9 @@ bool g_initialized_for_testing = false;
class SoundsManagerImpl : public SoundsManager {
public:
SoundsManagerImpl() {}
- ~SoundsManagerImpl() override { DCHECK(CalledOnValidThread()); }
+ ~SoundsManagerImpl() override {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ }
// SoundsManager implementation:
bool Initialize(SoundKey key, const base::StringPiece& data) override;
@@ -62,13 +64,13 @@ bool SoundsManagerImpl::Initialize(SoundKey key,
}
bool SoundsManagerImpl::Play(SoundKey key) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AudioStreamHandler* handler = GetHandler(key);
return handler && handler->Play();
}
bool SoundsManagerImpl::Stop(SoundKey key) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AudioStreamHandler* handler = GetHandler(key);
if (!handler)
return false;
@@ -77,7 +79,7 @@ bool SoundsManagerImpl::Stop(SoundKey key) {
}
base::TimeDelta SoundsManagerImpl::GetDuration(SoundKey key) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AudioStreamHandler* handler = GetHandler(key);
return !handler ? base::TimeDelta() : handler->duration();
}
@@ -94,7 +96,9 @@ AudioStreamHandler* SoundsManagerImpl::GetHandler(SoundKey key) {
SoundsManager::SoundsManager() {}
-SoundsManager::~SoundsManager() { DCHECK(CalledOnValidThread()); }
+SoundsManager::~SoundsManager() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
// static
void SoundsManager::Create() {
« no previous file with comments | « media/audio/sounds/sounds_manager.h ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698