OLD | NEW |
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_output_controller.h" | 5 #include "media/audio/audio_output_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 void AudioOutputController::DisallowEntryToOnMoreIOData() { | 464 void AudioOutputController::DisallowEntryToOnMoreIOData() { |
465 const bool is_zero = !base::AtomicRefCountDec(&num_allowed_io_); | 465 const bool is_zero = !base::AtomicRefCountDec(&num_allowed_io_); |
466 DCHECK(is_zero); | 466 DCHECK(is_zero); |
467 } | 467 } |
468 | 468 |
469 void AudioOutputController::WedgeCheck() { | 469 void AudioOutputController::WedgeCheck() { |
470 DCHECK(message_loop_->BelongsToCurrentThread()); | 470 DCHECK(message_loop_->BelongsToCurrentThread()); |
471 | 471 |
472 // If we should be playing and we haven't, that's a wedge. | 472 // If we should be playing and we haven't, that's a wedge. |
473 if (state_ == kPlaying) { | 473 if (state_ == kPlaying) { |
474 const bool playback_success = | 474 UMA_HISTOGRAM_BOOLEAN("Media.AudioOutputControllerPlaybackStartupSuccess", |
475 base::AtomicRefCountIsOne(&on_more_io_data_called_); | 475 base::AtomicRefCountIsOne(&on_more_io_data_called_)); |
476 | |
477 UMA_HISTOGRAM_BOOLEAN( | |
478 "Media.AudioOutputControllerPlaybackStartupSuccess", playback_success); | |
479 | |
480 // Let the AudioManager try and fix it. | |
481 if (!playback_success) | |
482 audio_manager_->FixWedgedAudio(); | |
483 } | 476 } |
484 } | 477 } |
485 | 478 |
486 } // namespace media | 479 } // namespace media |
OLD | NEW |