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

Side by Side Diff: content/browser/speech/speech_recognizer_impl.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/speech/speech_recognizer_impl.h" 5 #include "content/browser/speech/speech_recognizer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 786 }
787 787
788 void SpeechRecognizerImpl::CloseAudioControllerAsynchronously() { 788 void SpeechRecognizerImpl::CloseAudioControllerAsynchronously() {
789 DCHECK(IsCapturingAudio()); 789 DCHECK(IsCapturingAudio());
790 DVLOG(1) << "SpeechRecognizerImpl closing audio controller."; 790 DVLOG(1) << "SpeechRecognizerImpl closing audio controller.";
791 // Issues a Close on the audio controller, passing an empty callback. The only 791 // Issues a Close on the audio controller, passing an empty callback. The only
792 // purpose of such callback is to keep the audio controller refcounted until 792 // purpose of such callback is to keep the audio controller refcounted until
793 // Close has completed (in the audio thread) and automatically destroy it 793 // Close has completed (in the audio thread) and automatically destroy it
794 // afterwards (upon return from OnAudioClosed). 794 // afterwards (upon return from OnAudioClosed).
795 audio_controller_->Close(base::Bind(&SpeechRecognizerImpl::OnAudioClosed, 795 audio_controller_->Close(base::Bind(&SpeechRecognizerImpl::OnAudioClosed,
796 this, audio_controller_)); 796 this,
797 base::RetainedRef(audio_controller_)));
797 audio_controller_ = NULL; // The controller is still refcounted by Bind. 798 audio_controller_ = NULL; // The controller is still refcounted by Bind.
798 audio_log_->OnClosed(0); 799 audio_log_->OnClosed(0);
799 } 800 }
800 801
801 int SpeechRecognizerImpl::GetElapsedTimeMs() const { 802 int SpeechRecognizerImpl::GetElapsedTimeMs() const {
802 return (num_samples_recorded_ * 1000) / kAudioSampleRate; 803 return (num_samples_recorded_ * 1000) / kAudioSampleRate;
803 } 804 }
804 805
805 void SpeechRecognizerImpl::UpdateSignalAndNoiseLevels(const float& rms, 806 void SpeechRecognizerImpl::UpdateSignalAndNoiseLevels(const float& rms,
806 bool clip_detected) { 807 bool clip_detected) {
(...skipping 28 matching lines...) Expand all
835 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { 836 engine_error(SPEECH_RECOGNITION_ERROR_NONE) {
836 } 837 }
837 838
838 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(const FSMEventArgs& other) = 839 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(const FSMEventArgs& other) =
839 default; 840 default;
840 841
841 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { 842 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() {
842 } 843 }
843 844
844 } // namespace content 845 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version_unittest.cc ('k') | content/browser/ssl/ssl_client_auth_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698