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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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) 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 "content/browser/speech/speech_recognition_manager_impl.h" 5 #include "content/browser/speech/speech_recognition_manager_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/browser_main_loop.h" 8 #include "content/browser/browser_main_loop.h"
9 #include "content/browser/renderer_host/media/media_stream_manager.h" 9 #include "content/browser/renderer_host/media/media_stream_manager.h"
10 #include "content/browser/speech/google_one_shot_remote_engine.h" 10 #include "content/browser/speech/google_one_shot_remote_engine.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 remote_engine_config.filter_profanities = config.filter_profanities; 168 remote_engine_config.filter_profanities = config.filter_profanities;
169 remote_engine_config.continuous = config.continuous; 169 remote_engine_config.continuous = config.continuous;
170 remote_engine_config.interim_results = config.interim_results; 170 remote_engine_config.interim_results = config.interim_results;
171 remote_engine_config.max_hypotheses = config.max_hypotheses; 171 remote_engine_config.max_hypotheses = config.max_hypotheses;
172 remote_engine_config.hardware_info = hardware_info; 172 remote_engine_config.hardware_info = hardware_info;
173 remote_engine_config.origin_url = can_report_metrics ? config.origin_url : ""; 173 remote_engine_config.origin_url = can_report_metrics ? config.origin_url : "";
174 174
175 SpeechRecognitionEngine* google_remote_engine; 175 SpeechRecognitionEngine* google_remote_engine;
176 if (config.is_legacy_api) { 176 if (config.is_legacy_api) {
177 google_remote_engine = 177 google_remote_engine =
178 new GoogleOneShotRemoteEngine(config.url_request_context_getter); 178 new GoogleOneShotRemoteEngine(config.url_request_context_getter.get());
179 } else { 179 } else {
180 google_remote_engine = 180 google_remote_engine =
181 new GoogleStreamingRemoteEngine(config.url_request_context_getter); 181 new GoogleStreamingRemoteEngine(
182 config.url_request_context_getter.get());
182 } 183 }
183 184
184 google_remote_engine->SetConfig(remote_engine_config); 185 google_remote_engine->SetConfig(remote_engine_config);
185 186
186 // The legacy api cannot use continuous mode. 187 // The legacy api cannot use continuous mode.
187 DCHECK(!config.is_legacy_api || !config.continuous); 188 DCHECK(!config.is_legacy_api || !config.continuous);
188 189
189 session.recognizer = new SpeechRecognizer( 190 session.recognizer = new SpeechRecognizer(
190 this, 191 this,
191 session_id, 192 session_id,
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 session.recognizer->StopAudioCapture(); 596 session.recognizer->StopAudioCapture();
596 } 597 }
597 598
598 void SpeechRecognitionManagerImpl::ResetCapturingSessionId( 599 void SpeechRecognitionManagerImpl::ResetCapturingSessionId(
599 const Session& session) { 600 const Session& session) {
600 DCHECK_EQ(primary_session_id_, session.id); 601 DCHECK_EQ(primary_session_id_, session.id);
601 primary_session_id_ = kSessionIDInvalid; 602 primary_session_id_ = kSessionIDInvalid;
602 } 603 }
603 604
604 void SpeechRecognitionManagerImpl::SessionDelete(const Session& session) { 605 void SpeechRecognitionManagerImpl::SessionDelete(const Session& session) {
605 DCHECK(session.recognizer == NULL || !session.recognizer->IsActive()); 606 DCHECK(session.recognizer.get() == NULL || !session.recognizer->IsActive());
606 if (primary_session_id_ == session.id) 607 if (primary_session_id_ == session.id)
607 primary_session_id_ = kSessionIDInvalid; 608 primary_session_id_ = kSessionIDInvalid;
608 sessions_.erase(session.id); 609 sessions_.erase(session.id);
609 } 610 }
610 611
611 void SpeechRecognitionManagerImpl::NotFeasible(const Session& session, 612 void SpeechRecognitionManagerImpl::NotFeasible(const Session& session,
612 FSMEvent event) { 613 FSMEvent event) {
613 NOTREACHED() << "Unfeasible event " << event 614 NOTREACHED() << "Unfeasible event " << event
614 << " in state " << GetSessionState(session.id) 615 << " in state " << GetSessionState(session.id)
615 << " for session " << session.id; 616 << " for session " << session.id;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 673
673 SpeechRecognitionManagerImpl::Session::Session() 674 SpeechRecognitionManagerImpl::Session::Session()
674 : id(kSessionIDInvalid), 675 : id(kSessionIDInvalid),
675 listener_is_active(true) { 676 listener_is_active(true) {
676 } 677 }
677 678
678 SpeechRecognitionManagerImpl::Session::~Session() { 679 SpeechRecognitionManagerImpl::Session::~Session() {
679 } 680 }
680 681
681 } // namespace content 682 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/input_tag_speech_dispatcher_host.cc ('k') | content/browser/speech/speech_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698