| 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_input_controller.h" | 5 #include "media/audio/audio_input_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 { | 345 { |
| 346 base::AutoLock auto_lock(lock_); | 346 base::AutoLock auto_lock(lock_); |
| 347 state_ = RECORDING; | 347 state_ = RECORDING; |
| 348 } | 348 } |
| 349 | 349 |
| 350 if (handler_) | 350 if (handler_) |
| 351 handler_->OnLog(this, "AIC::DoRecord"); | 351 handler_->OnLog(this, "AIC::DoRecord"); |
| 352 | 352 |
| 353 stream_->Start(this); | 353 stream_->Start(this); |
| 354 if (handler_) | |
| 355 handler_->OnRecording(this); | |
| 356 } | 354 } |
| 357 | 355 |
| 358 void AudioInputController::DoClose() { | 356 void AudioInputController::DoClose() { |
| 359 DCHECK(task_runner_->BelongsToCurrentThread()); | 357 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 360 SCOPED_UMA_HISTOGRAM_TIMER("Media.AudioInputController.CloseTime"); | 358 SCOPED_UMA_HISTOGRAM_TIMER("Media.AudioInputController.CloseTime"); |
| 361 // If we have already logged something, this does nothing. | 359 // If we have already logged something, this does nothing. |
| 362 // Otherwise, we haven't recieved data. | 360 // Otherwise, we haven't recieved data. |
| 363 LogCaptureStartupResult(CAPTURE_STARTUP_NEVER_GOT_DATA); | 361 LogCaptureStartupResult(CAPTURE_STARTUP_NEVER_GOT_DATA); |
| 364 | 362 |
| 365 if (state_ == CLOSED) | 363 if (state_ == CLOSED) |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 if (debug_writer_) | 651 if (debug_writer_) |
| 654 debug_writer_->Write(std::move(data)); | 652 debug_writer_->Write(std::move(data)); |
| 655 } | 653 } |
| 656 | 654 |
| 657 void AudioInputController::LogMessage(const std::string& message) { | 655 void AudioInputController::LogMessage(const std::string& message) { |
| 658 DCHECK(task_runner_->BelongsToCurrentThread()); | 656 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 659 handler_->OnLog(this, message); | 657 handler_->OnLog(this, message); |
| 660 } | 658 } |
| 661 | 659 |
| 662 } // namespace media | 660 } // namespace media |
| OLD | NEW |