Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(798)

Side by Side Diff: Source/modules/speech/SpeechSynthesis.cpp

Issue 398683005: Add routine for checking startTime when start the next utterance in handleSpeakingCompleted() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 didJustFinishCurrentUtterance = true; 161 didJustFinishCurrentUtterance = true;
162 } 162 }
163 163
164 // Always fire the event, because the platform may have asynchronously 164 // Always fire the event, because the platform may have asynchronously
165 // sent an event on an utterance before it got the message that we 165 // sent an event on an utterance before it got the message that we
166 // canceled it, and we should always report to the user what actually 166 // canceled it, and we should always report to the user what actually
167 // happened. 167 // happened.
168 fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end, utter ance, 0, String()); 168 fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end, utter ance, 0, String());
169 169
170 // Start the next utterance if we just finished one and one was pending. 170 // Start the next utterance if we just finished one and one was pending.
171 if (didJustFinishCurrentUtterance && !m_utteranceQueue.isEmpty()) 171 if (didJustFinishCurrentUtterance && !m_utteranceQueue.isEmpty() && !utteran ce->startTime())
172 startSpeakingImmediately(); 172 startSpeakingImmediately();
173 } 173 }
174 174
175 void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance* ut terance, SpeechBoundary boundary, unsigned charIndex) 175 void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance* ut terance, SpeechBoundary boundary, unsigned charIndex)
176 { 176 {
177 DEFINE_STATIC_LOCAL(const String, wordBoundaryString, ("word")); 177 DEFINE_STATIC_LOCAL(const String, wordBoundaryString, ("word"));
178 DEFINE_STATIC_LOCAL(const String, sentenceBoundaryString, ("sentence")); 178 DEFINE_STATIC_LOCAL(const String, sentenceBoundaryString, ("sentence"));
179 179
180 switch (boundary) { 180 switch (boundary) {
181 case SpeechWordBoundary: 181 case SpeechWordBoundary:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void SpeechSynthesis::trace(Visitor* visitor) 236 void SpeechSynthesis::trace(Visitor* visitor)
237 { 237 {
238 visitor->trace(m_platformSpeechSynthesizer); 238 visitor->trace(m_platformSpeechSynthesizer);
239 visitor->trace(m_voiceList); 239 visitor->trace(m_voiceList);
240 visitor->trace(m_utteranceQueue); 240 visitor->trace(m_utteranceQueue);
241 PlatformSpeechSynthesizerClient::trace(visitor); 241 PlatformSpeechSynthesizerClient::trace(visitor);
242 EventTargetWithInlineData::trace(visitor); 242 EventTargetWithInlineData::trace(visitor);
243 } 243 }
244 244
245 } // namespace WebCore 245 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698