OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 m_utteranceQueue.removeFirst(); | 154 m_utteranceQueue.removeFirst(); |
155 | 155 |
156 // Start the next job if there is one pending. | 156 // Start the next job if there is one pending. |
157 if (!m_utteranceQueue.isEmpty()) | 157 if (!m_utteranceQueue.isEmpty()) |
158 startSpeakingImmediately(m_utteranceQueue.first().get()); | 158 startSpeakingImmediately(m_utteranceQueue.first().get()); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 void SpeechSynthesis::boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUt
terance> utterance, SpeechBoundary boundary, unsigned charIndex) | 162 void SpeechSynthesis::boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUt
terance> utterance, SpeechBoundary boundary, unsigned charIndex) |
163 { | 163 { |
164 DEFINE_STATIC_LOCAL(const String, wordBoundaryString, (ASCIILiteral("word"))
); | 164 DEFINE_STATIC_LOCAL(const String, wordBoundaryString, ("word")); |
165 DEFINE_STATIC_LOCAL(const String, sentenceBoundaryString, (ASCIILiteral("sen
tence"))); | 165 DEFINE_STATIC_LOCAL(const String, sentenceBoundaryString, ("sentence")); |
166 | 166 |
167 switch (boundary) { | 167 switch (boundary) { |
168 case SpeechWordBoundary: | 168 case SpeechWordBoundary: |
169 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtteran
ce*>(utterance->client()), charIndex, wordBoundaryString); | 169 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtteran
ce*>(utterance->client()), charIndex, wordBoundaryString); |
170 break; | 170 break; |
171 case SpeechSentenceBoundary: | 171 case SpeechSentenceBoundary: |
172 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtteran
ce*>(utterance->client()), charIndex, sentenceBoundaryString); | 172 fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtteran
ce*>(utterance->client()), charIndex, sentenceBoundaryString); |
173 break; | 173 break; |
174 default: | 174 default: |
175 ASSERT_NOT_REACHED(); | 175 ASSERT_NOT_REACHED(); |
(...skipping 26 matching lines...) Expand all Loading... |
202 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance
->client()), false); | 202 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance
->client()), false); |
203 } | 203 } |
204 | 204 |
205 void SpeechSynthesis::speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUt
terance> utterance) | 205 void SpeechSynthesis::speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUt
terance> utterance) |
206 { | 206 { |
207 if (utterance->client()) | 207 if (utterance->client()) |
208 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance
->client()), true); | 208 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance
->client()), true); |
209 } | 209 } |
210 | 210 |
211 } // namespace WebCore | 211 } // namespace WebCore |
OLD | NEW |