Commit e89ee8fd authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Remove base::ThreadChecker usage from the audio thread.

There's no gaurantee on what thread OnData() is called from and the
way the thread checker is used ends up only checking OnData() instead
of OnData() and OnSetFormat() since it always detaches in OnSetFormat.

BUG=823403
TEST=none

Change-Id: I5665ca4a2b5ffa8472404102d88dcf37604d83d2
Reviewed-on: https://chromium-review.googlesource.com/1022472Reviewed-by: default avatarHenrik Grunell <grunell@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553002}
parent 8839d302
...@@ -74,7 +74,6 @@ void TrackAudioRenderer::OnRenderError() { ...@@ -74,7 +74,6 @@ void TrackAudioRenderer::OnRenderError() {
// content::MediaStreamAudioSink implementation // content::MediaStreamAudioSink implementation
void TrackAudioRenderer::OnData(const media::AudioBus& audio_bus, void TrackAudioRenderer::OnData(const media::AudioBus& audio_bus,
base::TimeTicks reference_time) { base::TimeTicks reference_time) {
DCHECK(audio_thread_checker_.CalledOnValidThread());
DCHECK(!reference_time.is_null()); DCHECK(!reference_time.is_null());
TRACE_EVENT1("audio", "TrackAudioRenderer::OnData", "reference time (ms)", TRACE_EVENT1("audio", "TrackAudioRenderer::OnData", "reference time (ms)",
...@@ -98,10 +97,6 @@ void TrackAudioRenderer::OnData(const media::AudioBus& audio_bus, ...@@ -98,10 +97,6 @@ void TrackAudioRenderer::OnData(const media::AudioBus& audio_bus,
void TrackAudioRenderer::OnSetFormat(const media::AudioParameters& params) { void TrackAudioRenderer::OnSetFormat(const media::AudioParameters& params) {
DVLOG(1) << "TrackAudioRenderer::OnSetFormat()"; DVLOG(1) << "TrackAudioRenderer::OnSetFormat()";
// If the source is restarted, we might have changed to another capture
// thread.
audio_thread_checker_.DetachFromThread();
DCHECK(audio_thread_checker_.CalledOnValidThread());
// If the parameters changed, the audio in the AudioShifter is invalid and // If the parameters changed, the audio in the AudioShifter is invalid and
// should be dropped. // should be dropped.
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/public/renderer/media_stream_audio_renderer.h" #include "content/public/renderer/media_stream_audio_renderer.h"
#include "content/public/renderer/media_stream_audio_sink.h" #include "content/public/renderer/media_stream_audio_sink.h"
...@@ -170,9 +169,6 @@ class CONTENT_EXPORT TrackAudioRenderer ...@@ -170,9 +169,6 @@ class CONTENT_EXPORT TrackAudioRenderer
// Flag to indicate whether |sink_| has been started yet. // Flag to indicate whether |sink_| has been started yet.
bool sink_started_; bool sink_started_;
// Used to DCHECK that some methods are called on the audio thread.
base::ThreadChecker audio_thread_checker_;
DISALLOW_COPY_AND_ASSIGN(TrackAudioRenderer); DISALLOW_COPY_AND_ASSIGN(TrackAudioRenderer);
}; };
......
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