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_BROWSER_SPEECH_GOOGLE_STREAMING_REMOTE_ENGINE_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_GOOGLE_STREAMING_REMOTE_ENGINE_H_ |
6 #define CONTENT_BROWSER_SPEECH_GOOGLE_STREAMING_REMOTE_ENGINE_H_ | 6 #define CONTENT_BROWSER_SPEECH_GOOGLE_STREAMING_REMOTE_ENGINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 static const int kAudioPacketIntervalMs; | 53 static const int kAudioPacketIntervalMs; |
54 | 54 |
55 // IDs passed to URLFetcher::Create(). Used for testing. | 55 // IDs passed to URLFetcher::Create(). Used for testing. |
56 static const int kUpstreamUrlFetcherIdForTesting; | 56 static const int kUpstreamUrlFetcherIdForTesting; |
57 static const int kDownstreamUrlFetcherIdForTesting; | 57 static const int kDownstreamUrlFetcherIdForTesting; |
58 | 58 |
59 explicit GoogleStreamingRemoteEngine(net::URLRequestContextGetter* context); | 59 explicit GoogleStreamingRemoteEngine(net::URLRequestContextGetter* context); |
60 virtual ~GoogleStreamingRemoteEngine(); | 60 virtual ~GoogleStreamingRemoteEngine(); |
61 | 61 |
62 // SpeechRecognitionEngine methods. | 62 // SpeechRecognitionEngine methods. |
63 virtual void SetConfig(const SpeechRecognitionEngineConfig& config) OVERRIDE; | 63 virtual void SetConfig(const SpeechRecognitionEngineConfig& config) override; |
64 virtual void StartRecognition() OVERRIDE; | 64 virtual void StartRecognition() override; |
65 virtual void EndRecognition() OVERRIDE; | 65 virtual void EndRecognition() override; |
66 virtual void TakeAudioChunk(const AudioChunk& data) OVERRIDE; | 66 virtual void TakeAudioChunk(const AudioChunk& data) override; |
67 virtual void AudioChunksEnded() OVERRIDE; | 67 virtual void AudioChunksEnded() override; |
68 virtual bool IsRecognitionPending() const OVERRIDE; | 68 virtual bool IsRecognitionPending() const override; |
69 virtual int GetDesiredAudioChunkDurationMs() const OVERRIDE; | 69 virtual int GetDesiredAudioChunkDurationMs() const override; |
70 | 70 |
71 // net::URLFetcherDelegate methods. | 71 // net::URLFetcherDelegate methods. |
72 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 72 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
73 virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, | 73 virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, |
74 int64 current, int64 total) OVERRIDE; | 74 int64 current, int64 total) override; |
75 | 75 |
76 private: | 76 private: |
77 // Response status codes from the speech recognition webservice. | 77 // Response status codes from the speech recognition webservice. |
78 static const int kWebserviceStatusNoError; | 78 static const int kWebserviceStatusNoError; |
79 static const int kWebserviceStatusErrorNoMatch; | 79 static const int kWebserviceStatusErrorNoMatch; |
80 | 80 |
81 // Data types for the internal Finite State Machine (FSM). | 81 // Data types for the internal Finite State Machine (FSM). |
82 enum FSMState { | 82 enum FSMState { |
83 STATE_IDLE = 0, | 83 STATE_IDLE = 0, |
84 STATE_BOTH_STREAMS_CONNECTED, | 84 STATE_BOTH_STREAMS_CONNECTED, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 bool got_last_definitive_result_; | 152 bool got_last_definitive_result_; |
153 bool is_dispatching_event_; | 153 bool is_dispatching_event_; |
154 FSMState state_; | 154 FSMState state_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(GoogleStreamingRemoteEngine); | 156 DISALLOW_COPY_AND_ASSIGN(GoogleStreamingRemoteEngine); |
157 }; | 157 }; |
158 | 158 |
159 } // namespace content | 159 } // namespace content |
160 | 160 |
161 #endif // CONTENT_BROWSER_SPEECH_GOOGLE_STREAMING_REMOTE_ENGINE_H_ | 161 #endif // CONTENT_BROWSER_SPEECH_GOOGLE_STREAMING_REMOTE_ENGINE_H_ |
OLD | NEW |