| OLD | NEW |
| 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/renderer_host/media/media_stream_ui_proxy.h" | 10 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 session.recognizer->StopAudioCapture(); | 585 session.recognizer->StopAudioCapture(); |
| 586 } | 586 } |
| 587 | 587 |
| 588 void SpeechRecognitionManagerImpl::ResetCapturingSessionId( | 588 void SpeechRecognitionManagerImpl::ResetCapturingSessionId( |
| 589 const Session& session) { | 589 const Session& session) { |
| 590 DCHECK_EQ(primary_session_id_, session.id); | 590 DCHECK_EQ(primary_session_id_, session.id); |
| 591 primary_session_id_ = kSessionIDInvalid; | 591 primary_session_id_ = kSessionIDInvalid; |
| 592 } | 592 } |
| 593 | 593 |
| 594 void SpeechRecognitionManagerImpl::SessionDelete(Session* session) { | 594 void SpeechRecognitionManagerImpl::SessionDelete(Session* session) { |
| 595 DCHECK(session->recognizer == NULL || !session->recognizer->IsActive()); | 595 DCHECK(session->recognizer.get() == NULL || !session->recognizer->IsActive()); |
| 596 if (primary_session_id_ == session->id) | 596 if (primary_session_id_ == session->id) |
| 597 primary_session_id_ = kSessionIDInvalid; | 597 primary_session_id_ = kSessionIDInvalid; |
| 598 sessions_.erase(session->id); | 598 sessions_.erase(session->id); |
| 599 delete session; | 599 delete session; |
| 600 } | 600 } |
| 601 | 601 |
| 602 void SpeechRecognitionManagerImpl::NotFeasible(const Session& session, | 602 void SpeechRecognitionManagerImpl::NotFeasible(const Session& session, |
| 603 FSMEvent event) { | 603 FSMEvent event) { |
| 604 NOTREACHED() << "Unfeasible event " << event | 604 NOTREACHED() << "Unfeasible event " << event |
| 605 << " in state " << GetSessionState(session.id) | 605 << " in state " << GetSessionState(session.id) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 659 |
| 660 SpeechRecognitionManagerImpl::Session::Session() | 660 SpeechRecognitionManagerImpl::Session::Session() |
| 661 : id(kSessionIDInvalid), | 661 : id(kSessionIDInvalid), |
| 662 listener_is_active(true) { | 662 listener_is_active(true) { |
| 663 } | 663 } |
| 664 | 664 |
| 665 SpeechRecognitionManagerImpl::Session::~Session() { | 665 SpeechRecognitionManagerImpl::Session::~Session() { |
| 666 } | 666 } |
| 667 | 667 |
| 668 } // namespace content | 668 } // namespace content |
| OLD | NEW |