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

Side by Side Diff: media/audio/audio_input_controller.cc

Issue 219023003: Disables the check for no data timer for audio on all platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tommi@ Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/audio/audio_input_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/audio_input_controller.h" 5 #include "media/audio/audio_input_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 #include "media/base/limits.h" 9 #include "media/base/limits.h"
10 #include "media/base/scoped_histogram_timer.h" 10 #include "media/base/scoped_histogram_timer.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 if (stream_ && !stream_->Open()) { 196 if (stream_ && !stream_->Open()) {
197 stream_->Close(); 197 stream_->Close();
198 stream_ = NULL; 198 stream_ = NULL;
199 handler_->OnError(this, STREAM_OPEN_ERROR); 199 handler_->OnError(this, STREAM_OPEN_ERROR);
200 return; 200 return;
201 } 201 }
202 202
203 DCHECK(!no_data_timer_.get()); 203 DCHECK(!no_data_timer_.get());
204 204
205 #if defined(OS_MACOSX)
206 // This is a fix for crbug.com/357501. The timer can trigger when closing 205 // This is a fix for crbug.com/357501. The timer can trigger when closing
207 // the lid on Macs, which causes more problems than the timer fixes. 206 // the lid on Macs, which causes more problems than the timer fixes.
207 // Also, in crbug.com/357569, the goal is to remove usage of this timer
208 // since it was added to solve a crash on Windows that no longer can be
209 // reproduced.
210 // TODO(henrika): remove usage of timer when it has been verified on Canary
211 // that we are safe doing so. Goal is to get rid of |no_data_timer_| and
212 // everything that is tied to it.
208 enable_nodata_timer = false; 213 enable_nodata_timer = false;
209 #endif
210 214
211 if (enable_nodata_timer) { 215 if (enable_nodata_timer) {
212 // Create the data timer which will call DoCheckForNoData(). The timer 216 // Create the data timer which will call DoCheckForNoData(). The timer
213 // is started in DoRecord() and restarted in each DoCheckForNoData() 217 // is started in DoRecord() and restarted in each DoCheckForNoData()
214 // callback. 218 // callback.
215 no_data_timer_.reset(new base::Timer( 219 no_data_timer_.reset(new base::Timer(
216 FROM_HERE, base::TimeDelta::FromSeconds(kTimerInitialIntervalSeconds), 220 FROM_HERE, base::TimeDelta::FromSeconds(kTimerInitialIntervalSeconds),
217 base::Bind(&AudioInputController::DoCheckForNoData, 221 base::Bind(&AudioInputController::DoCheckForNoData,
218 base::Unretained(this)), false)); 222 base::Unretained(this)), false));
219 } else { 223 } else {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 397
394 void AudioInputController::SetDataIsActive(bool enabled) { 398 void AudioInputController::SetDataIsActive(bool enabled) {
395 base::subtle::Release_Store(&data_is_active_, enabled); 399 base::subtle::Release_Store(&data_is_active_, enabled);
396 } 400 }
397 401
398 bool AudioInputController::GetDataIsActive() { 402 bool AudioInputController::GetDataIsActive() {
399 return (base::subtle::Acquire_Load(&data_is_active_) != false); 403 return (base::subtle::Acquire_Load(&data_is_active_) != false);
400 } 404 }
401 405
402 } // namespace media 406 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_input_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698