| 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 #ifndef CONTENT_RENDERER_SPEECH_RECOGNITION_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_SPEECH_RECOGNITION_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_SPEECH_RECOGNITION_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_SPEECH_RECOGNITION_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
| 13 #include "base/sync_socket.h" | 13 #include "base/sync_socket.h" |
| 14 #include "content/public/common/speech_recognition_result.h" | 14 #include "content/public/common/speech_recognition_result.h" |
| 15 #include "content/public/renderer/render_view_observer.h" | 15 #include "content/public/renderer/render_view_observer.h" |
| 16 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 16 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 17 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
| 18 #include "third_party/WebKit/public/web/WebSpeechRecognitionHandle.h" | 18 #include "third_party/WebKit/public/web/WebSpeechRecognitionHandle.h" |
| 19 #include "third_party/WebKit/public/web/WebSpeechRecognizer.h" | 19 #include "third_party/WebKit/public/web/WebSpeechRecognizer.h" |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 // The WebKit client class that we use to send events back to the JS world. | 78 // The WebKit client class that we use to send events back to the JS world. |
| 79 blink::WebSpeechRecognizerClient* recognizer_client_; | 79 blink::WebSpeechRecognizerClient* recognizer_client_; |
| 80 | 80 |
| 81 #if defined(ENABLE_WEBRTC) | 81 #if defined(ENABLE_WEBRTC) |
| 82 // Media stream audio track that the speech recognition connects to. | 82 // Media stream audio track that the speech recognition connects to. |
| 83 // Accessed on the render thread. | 83 // Accessed on the render thread. |
| 84 blink::WebMediaStreamTrack audio_track_; | 84 blink::WebMediaStreamTrack audio_track_; |
| 85 | 85 |
| 86 // Audio sink used to provide audio from the track. | 86 // Audio sink used to provide audio from the track. |
| 87 scoped_ptr<SpeechRecognitionAudioSink> speech_audio_sink_; | 87 std::unique_ptr<SpeechRecognitionAudioSink> speech_audio_sink_; |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 typedef std::map<int, blink::WebSpeechRecognitionHandle> HandleMap; | 90 typedef std::map<int, blink::WebSpeechRecognitionHandle> HandleMap; |
| 91 HandleMap handle_map_; | 91 HandleMap handle_map_; |
| 92 int next_id_; | 92 int next_id_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcher); | 94 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcher); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace content | 97 } // namespace content |
| 98 | 98 |
| 99 #endif // CONTENT_RENDERER_SPEECH_RECOGNITION_DISPATCHER_H_ | 99 #endif // CONTENT_RENDERER_SPEECH_RECOGNITION_DISPATCHER_H_ |
| OLD | NEW |