Chromium Code Reviews| Index: Source/modules/speech/SpeechSynthesis.cpp |
| diff --git a/Source/modules/speech/SpeechSynthesis.cpp b/Source/modules/speech/SpeechSynthesis.cpp |
| index 363ea98d9b61ad5827bb5219818c8e2ed56933a5..df9edebe210b78befa9b0afa520a79af676fe653 100644 |
| --- a/Source/modules/speech/SpeechSynthesis.cpp |
| +++ b/Source/modules/speech/SpeechSynthesis.cpp |
| @@ -154,10 +154,12 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc |
| ASSERT(utterance); |
| bool didJustFinishCurrentUtterance = false; |
| + int oldQueueSize = 0; |
|
haraken
2014/08/21 01:01:22
Can we introduce something like a |shouldStartSpea
|
| // If the utterance that completed was the one we're currently speaking, |
| // remove it from the queue and start speaking the next one. |
| if (utterance == currentSpeechUtterance()) { |
| m_utteranceQueue.removeFirst(); |
| + oldQueueSize = m_utteranceQueue.size(); |
| didJustFinishCurrentUtterance = true; |
| } |
| @@ -168,7 +170,7 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc |
| fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end, utterance, 0, String()); |
| // Start the next utterance if we just finished one and one was pending. |
| - if (didJustFinishCurrentUtterance && !m_utteranceQueue.isEmpty() && !utterance->startTime()) |
| + if (didJustFinishCurrentUtterance && !m_utteranceQueue.isEmpty() && oldQueueSize) |
| startSpeakingImmediately(); |
| } |