Index: media/audio/audio_device_thread.cc |
diff --git a/media/audio/audio_device_thread.cc b/media/audio/audio_device_thread.cc |
index 20874599e68f5f7cfddeff0022291e64aa718b6c..4cbe9a5d2e18c80a5ae4eaf56e1a819f06c094d0 100644 |
--- a/media/audio/audio_device_thread.cc |
+++ b/media/audio/audio_device_thread.cc |
@@ -230,11 +230,16 @@ AudioDeviceThread::Callback::Callback(const AudioParameters& audio_parameters, |
CHECK_GT(total_segments_, 0); |
CHECK_EQ(memory_length_ % total_segments_, 0); |
segment_length_ = memory_length_ / total_segments_; |
+ thread_checker_.DetachFromThread(); |
} |
AudioDeviceThread::Callback::~Callback() {} |
void AudioDeviceThread::Callback::InitializeOnAudioThread() { |
+ // Normally this function is called before the thread checker is used |
+ // elsewhere, but it's not guaranteed. DCHECK to ensure it was not used on |
+ // another thread before we get here. |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
MapSharedMemory(); |
CHECK(shared_memory_.memory()); |
} |