Remove obsolete atomic debugging checks.

Removes AtomicRefCount checks from SincResampler and AudioOutputController
which never caught any issues.

BUG=295278, 349651
TEST=none

Review URL: https://codereview.chromium.org/231623005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262897 0039d316-1c4b-4281-b951-d872f2087c98
parent aa4b11d9
...@@ -41,7 +41,6 @@ AudioOutputController::AudioOutputController( ...@@ -41,7 +41,6 @@ AudioOutputController::AudioOutputController(
diverting_to_stream_(NULL), diverting_to_stream_(NULL),
volume_(1.0), volume_(1.0),
state_(kEmpty), state_(kEmpty),
not_currently_in_on_more_io_data_(1),
sync_reader_(sync_reader), sync_reader_(sync_reader),
message_loop_(audio_manager->GetTaskRunner()), message_loop_(audio_manager->GetTaskRunner()),
#if defined(AUDIO_POWER_MONITORING) #if defined(AUDIO_POWER_MONITORING)
...@@ -58,8 +57,6 @@ AudioOutputController::AudioOutputController( ...@@ -58,8 +57,6 @@ AudioOutputController::AudioOutputController(
AudioOutputController::~AudioOutputController() { AudioOutputController::~AudioOutputController() {
DCHECK_EQ(kClosed, state_); DCHECK_EQ(kClosed, state_);
// TODO(dalecurtis): Remove debugging for http://crbug.com/349651
CHECK(!base::AtomicRefCountDec(&not_currently_in_on_more_io_data_));
} }
// static // static
...@@ -304,7 +301,6 @@ int AudioOutputController::OnMoreData(AudioBus* dest, ...@@ -304,7 +301,6 @@ int AudioOutputController::OnMoreData(AudioBus* dest,
int AudioOutputController::OnMoreIOData(AudioBus* source, int AudioOutputController::OnMoreIOData(AudioBus* source,
AudioBus* dest, AudioBus* dest,
AudioBuffersState buffers_state) { AudioBuffersState buffers_state) {
CHECK(!base::AtomicRefCountDec(&not_currently_in_on_more_io_data_));
TRACE_EVENT0("audio", "AudioOutputController::OnMoreIOData"); TRACE_EVENT0("audio", "AudioOutputController::OnMoreIOData");
// Indicate that we haven't wedged (at least not indefinitely, WedgeCheck() // Indicate that we haven't wedged (at least not indefinitely, WedgeCheck()
...@@ -324,7 +320,6 @@ int AudioOutputController::OnMoreIOData(AudioBus* source, ...@@ -324,7 +320,6 @@ int AudioOutputController::OnMoreIOData(AudioBus* source,
power_monitor_.Scan(*dest, frames); power_monitor_.Scan(*dest, frames);
#endif #endif
base::AtomicRefCountInc(&not_currently_in_on_more_io_data_);
return frames; return frames;
} }
......
...@@ -237,11 +237,6 @@ class MEDIA_EXPORT AudioOutputController ...@@ -237,11 +237,6 @@ class MEDIA_EXPORT AudioOutputController
// is not required for reading on the audio manager thread. // is not required for reading on the audio manager thread.
State state_; State state_;
// Atomic ref count indicating when when we're in the middle of handling an
// OnMoreIOData() callback. Will be CHECK'd to find crashes.
// TODO(dalecurtis): Remove debug helpers for http://crbug.com/349651
base::AtomicRefCount not_currently_in_on_more_io_data_;
// SyncReader is used only in low latency mode for synchronous reading. // SyncReader is used only in low latency mode for synchronous reading.
SyncReader* const sync_reader_; SyncReader* const sync_reader_;
......
...@@ -153,8 +153,7 @@ SincResampler::SincResampler(double io_sample_rate_ratio, ...@@ -153,8 +153,7 @@ SincResampler::SincResampler(double io_sample_rate_ratio,
input_buffer_(static_cast<float*>( input_buffer_(static_cast<float*>(
base::AlignedAlloc(sizeof(float) * input_buffer_size_, 16))), base::AlignedAlloc(sizeof(float) * input_buffer_size_, 16))),
r1_(input_buffer_.get()), r1_(input_buffer_.get()),
r2_(input_buffer_.get() + kKernelSize / 2), r2_(input_buffer_.get() + kKernelSize / 2) {
not_currently_resampling_(1) {
CHECK_GT(request_frames_, 0); CHECK_GT(request_frames_, 0);
Flush(); Flush();
CHECK_GT(block_size_, kKernelSize) CHECK_GT(block_size_, kKernelSize)
...@@ -170,10 +169,7 @@ SincResampler::SincResampler(double io_sample_rate_ratio, ...@@ -170,10 +169,7 @@ SincResampler::SincResampler(double io_sample_rate_ratio,
InitializeKernel(); InitializeKernel();
} }
SincResampler::~SincResampler() { SincResampler::~SincResampler() {}
// TODO(dalecurtis): Remove debugging for http://crbug.com/295278
CHECK(!base::AtomicRefCountDec(&not_currently_resampling_));
}
void SincResampler::UpdateRegions(bool second_load) { void SincResampler::UpdateRegions(bool second_load) {
// Setup various region pointers in the buffer (see diagram above). If we're // Setup various region pointers in the buffer (see diagram above). If we're
...@@ -256,8 +252,6 @@ void SincResampler::SetRatio(double io_sample_rate_ratio) { ...@@ -256,8 +252,6 @@ void SincResampler::SetRatio(double io_sample_rate_ratio) {
} }
void SincResampler::Resample(int frames, float* destination) { void SincResampler::Resample(int frames, float* destination) {
CHECK(!base::AtomicRefCountDec(&not_currently_resampling_));
int remaining_frames = frames; int remaining_frames = frames;
// Step (1) -- Prime the input buffer at the start of the input stream. // Step (1) -- Prime the input buffer at the start of the input stream.
...@@ -306,10 +300,8 @@ void SincResampler::Resample(int frames, float* destination) { ...@@ -306,10 +300,8 @@ void SincResampler::Resample(int frames, float* destination) {
virtual_source_idx_ += current_io_ratio; virtual_source_idx_ += current_io_ratio;
source_idx = virtual_source_idx_; source_idx = virtual_source_idx_;
if (!--remaining_frames) { if (!--remaining_frames)
base::AtomicRefCountInc(&not_currently_resampling_);
return; return;
}
} }
// Wrap back around to the start. // Wrap back around to the start.
...@@ -327,8 +319,6 @@ void SincResampler::Resample(int frames, float* destination) { ...@@ -327,8 +319,6 @@ void SincResampler::Resample(int frames, float* destination) {
// Step (5) -- Refresh the buffer with more input. // Step (5) -- Refresh the buffer with more input.
read_cb_.Run(request_frames_, r0_); read_cb_.Run(request_frames_, r0_);
} }
base::AtomicRefCountInc(&not_currently_resampling_);
} }
#undef CONVOLVE_FUNC #undef CONVOLVE_FUNC
...@@ -338,7 +328,6 @@ int SincResampler::ChunkSize() const { ...@@ -338,7 +328,6 @@ int SincResampler::ChunkSize() const {
} }
void SincResampler::Flush() { void SincResampler::Flush() {
CHECK(base::AtomicRefCountIsOne(&not_currently_resampling_));
virtual_source_idx_ = 0; virtual_source_idx_ = 0;
buffer_primed_ = false; buffer_primed_ = false;
memset(input_buffer_.get(), 0, memset(input_buffer_.get(), 0,
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef MEDIA_BASE_SINC_RESAMPLER_H_ #ifndef MEDIA_BASE_SINC_RESAMPLER_H_
#define MEDIA_BASE_SINC_RESAMPLER_H_ #define MEDIA_BASE_SINC_RESAMPLER_H_
#include "base/atomic_ref_count.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/aligned_memory.h" #include "base/memory/aligned_memory.h"
...@@ -136,11 +135,6 @@ class MEDIA_EXPORT SincResampler { ...@@ -136,11 +135,6 @@ class MEDIA_EXPORT SincResampler {
float* r3_; float* r3_;
float* r4_; float* r4_;
// Atomic ref count indicating when when we're not currently resampling. Will
// be CHECK'd to find crashes...
// TODO(dalecurtis): Remove debug helpers for http://crbug.com/295278
base::AtomicRefCount not_currently_resampling_;
DISALLOW_COPY_AND_ASSIGN(SincResampler); DISALLOW_COPY_AND_ASSIGN(SincResampler);
}; };
......
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