Chromium Code Reviews| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 TRACE_EVENT0("audio", "AudioOutputController::DoPause"); | 216 TRACE_EVENT0("audio", "AudioOutputController::DoPause"); |
| 217 | 217 |
| 218 StopStream(); | 218 StopStream(); |
| 219 | 219 |
| 220 if (state_ != kPaused) | 220 if (state_ != kPaused) |
| 221 return; | 221 return; |
| 222 | 222 |
| 223 // Let the renderer know we've stopped. Necessary to let PPAPI clients know | 223 // Let the renderer know we've stopped. Necessary to let PPAPI clients know |
| 224 // audio has been shutdown. TODO(dalecurtis): This stinks. PPAPI should have | 224 // audio has been shutdown. TODO(dalecurtis): This stinks. PPAPI should have |
| 225 // a better way to know when it should exit PPB_Audio_Shared::Run(). | 225 // a better way to know when it should exit PPB_Audio_Shared::Run(). |
| 226 sync_reader_->UpdatePendingBytes(-1); | 226 sync_reader_->UpdatePendingBytes(0xFFFFFFFF); |
|
ddorwin
2014/07/08 18:17:50
nit: kuint32max
Peter Kasting
2014/07/08 18:39:14
Done.
| |
| 227 | 227 |
| 228 handler_->OnPaused(); | 228 handler_->OnPaused(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void AudioOutputController::DoClose() { | 231 void AudioOutputController::DoClose() { |
| 232 DCHECK(message_loop_->BelongsToCurrentThread()); | 232 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 233 SCOPED_UMA_HISTOGRAM_TIMER("Media.AudioOutputController.CloseTime"); | 233 SCOPED_UMA_HISTOGRAM_TIMER("Media.AudioOutputController.CloseTime"); |
| 234 TRACE_EVENT0("audio", "AudioOutputController::DoClose"); | 234 TRACE_EVENT0("audio", "AudioOutputController::DoClose"); |
| 235 | 235 |
| 236 if (state_ != kClosed) { | 236 if (state_ != kClosed) { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 DCHECK(message_loop_->BelongsToCurrentThread()); | 424 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 425 | 425 |
| 426 // If we should be playing and we haven't, that's a wedge. | 426 // If we should be playing and we haven't, that's a wedge. |
| 427 if (state_ == kPlaying) { | 427 if (state_ == kPlaying) { |
| 428 UMA_HISTOGRAM_BOOLEAN("Media.AudioOutputControllerPlaybackStartupSuccess", | 428 UMA_HISTOGRAM_BOOLEAN("Media.AudioOutputControllerPlaybackStartupSuccess", |
| 429 base::AtomicRefCountIsOne(&on_more_io_data_called_)); | 429 base::AtomicRefCountIsOne(&on_more_io_data_called_)); |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace media | 433 } // namespace media |
| OLD | NEW |