| Index: media/audio/audio_input_controller.cc
|
| diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc
|
| index c048bf3b44abc72816e99aab51817f5824a2e79d..b860937d1f470418cfe2adc5d98731f9859db9a1 100644
|
| --- a/media/audio/audio_input_controller.cc
|
| +++ b/media/audio/audio_input_controller.cc
|
| @@ -200,7 +200,7 @@ AudioInputController::AudioInputController(
|
| AudioInputController::~AudioInputController() {
|
| DCHECK(!audio_callback_);
|
| DCHECK(!stream_);
|
| - DCHECK(!check_muted_state_timer_.IsRunning());
|
| + DCHECK(!check_muted_state_timer_);
|
| }
|
|
|
| // static
|
| @@ -364,10 +364,12 @@ void AudioInputController::DoCreateForStream(
|
| is_muted_ = stream_->IsMuted();
|
| handler_->OnCreated(this, is_muted_);
|
|
|
| - check_muted_state_timer_.Start(
|
| + // Start a new repeating timer to keep the muted state updated.
|
| + check_muted_state_timer_.emplace();
|
| + check_muted_state_timer_->Start(
|
| FROM_HERE, base::TimeDelta::FromSeconds(kCheckMutedStateIntervalSeconds),
|
| this, &AudioInputController::CheckMutedState);
|
| - DCHECK(check_muted_state_timer_.IsRunning());
|
| + DCHECK(check_muted_state_timer_->IsRunning());
|
| }
|
|
|
| void AudioInputController::DoRecord() {
|
| @@ -397,7 +399,8 @@ void AudioInputController::DoClose() {
|
| if (!stream_)
|
| return;
|
|
|
| - check_muted_state_timer_.Stop();
|
| + // Stop and destroy the mute check timer.
|
| + check_muted_state_timer_.reset();
|
|
|
| std::string log_string;
|
| static const char kLogStringPrefix[] = "AIC::DoClose:";
|
|
|