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

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

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
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_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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 remote_engine_config.continuous = config.continuous; 111 remote_engine_config.continuous = config.continuous;
112 remote_engine_config.interim_results = config.interim_results; 112 remote_engine_config.interim_results = config.interim_results;
113 remote_engine_config.max_hypotheses = config.max_hypotheses; 113 remote_engine_config.max_hypotheses = config.max_hypotheses;
114 remote_engine_config.hardware_info = hardware_info; 114 remote_engine_config.hardware_info = hardware_info;
115 remote_engine_config.origin_url = 115 remote_engine_config.origin_url =
116 can_report_metrics ? config.origin_url : std::string(); 116 can_report_metrics ? config.origin_url : std::string();
117 117
118 SpeechRecognitionEngine* google_remote_engine; 118 SpeechRecognitionEngine* google_remote_engine;
119 if (config.is_legacy_api) { 119 if (config.is_legacy_api) {
120 google_remote_engine = 120 google_remote_engine =
121 new GoogleOneShotRemoteEngine(config.url_request_context_getter); 121 new GoogleOneShotRemoteEngine(config.url_request_context_getter.get());
122 } else { 122 } else {
123 google_remote_engine = 123 google_remote_engine = new GoogleStreamingRemoteEngine(
124 new GoogleStreamingRemoteEngine(config.url_request_context_getter); 124 config.url_request_context_getter.get());
125 } 125 }
126 126
127 google_remote_engine->SetConfig(remote_engine_config); 127 google_remote_engine->SetConfig(remote_engine_config);
128 128
129 session.recognizer = new SpeechRecognizerImpl( 129 session.recognizer = new SpeechRecognizerImpl(
130 this, 130 this,
131 session_id, 131 session_id,
132 !config.continuous, 132 !config.continuous,
133 google_remote_engine); 133 google_remote_engine);
134 #else 134 #else
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 session.recognizer->StopAudioCapture(); 595 session.recognizer->StopAudioCapture();
596 } 596 }
597 597
598 void SpeechRecognitionManagerImpl::ResetCapturingSessionId( 598 void SpeechRecognitionManagerImpl::ResetCapturingSessionId(
599 const Session& session) { 599 const Session& session) {
600 DCHECK_EQ(primary_session_id_, session.id); 600 DCHECK_EQ(primary_session_id_, session.id);
601 primary_session_id_ = kSessionIDInvalid; 601 primary_session_id_ = kSessionIDInvalid;
602 } 602 }
603 603
604 void SpeechRecognitionManagerImpl::SessionDelete(const Session& session) { 604 void SpeechRecognitionManagerImpl::SessionDelete(const Session& session) {
605 DCHECK(session.recognizer == NULL || !session.recognizer->IsActive()); 605 DCHECK(session.recognizer.get() == NULL || !session.recognizer->IsActive());
606 if (primary_session_id_ == session.id) 606 if (primary_session_id_ == session.id)
607 primary_session_id_ = kSessionIDInvalid; 607 primary_session_id_ = kSessionIDInvalid;
608 sessions_.erase(session.id); 608 sessions_.erase(session.id);
609 } 609 }
610 610
611 void SpeechRecognitionManagerImpl::NotFeasible(const Session& session, 611 void SpeechRecognitionManagerImpl::NotFeasible(const Session& session,
612 FSMEvent event) { 612 FSMEvent event) {
613 NOTREACHED() << "Unfeasible event " << event 613 NOTREACHED() << "Unfeasible event " << event
614 << " in state " << GetSessionState(session.id) 614 << " in state " << GetSessionState(session.id)
615 << " for session " << session.id; 615 << " for session " << session.id;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 SpeechRecognitionManagerImpl::Session::Session() 673 SpeechRecognitionManagerImpl::Session::Session()
674 : id(kSessionIDInvalid), 674 : id(kSessionIDInvalid),
675 listener_is_active(true) { 675 listener_is_active(true) {
676 } 676 }
677 677
678 SpeechRecognitionManagerImpl::Session::~Session() { 678 SpeechRecognitionManagerImpl::Session::~Session() {
679 } 679 }
680 680
681 } // namespace content 681 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognition_dispatcher_host.cc ('k') | content/browser/speech/speech_recognizer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698