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

Unified Diff: third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp

Issue 2367693003: Fix SpeechSynthesisEvent.elapsedTime (Closed)
Patch Set: Fix expectation Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-speak-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
index f0f81e36c5b54f28701d0cc15214eb6d20f55e11..9844675d7d7dfadd90a7cd0859b0f160a1720f2c 100644
--- a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
+++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
@@ -139,8 +139,10 @@ void SpeechSynthesis::resume()
void SpeechSynthesis::fireEvent(const AtomicString& type, SpeechSynthesisUtterance* utterance, unsigned long charIndex, const String& name)
{
- if (getExecutionContext() && !getExecutionContext()->activeDOMObjectsAreStopped())
- utterance->dispatchEvent(SpeechSynthesisEvent::create(type, utterance, charIndex, (currentTime() - utterance->startTime()), name));
+ if (getExecutionContext() && !getExecutionContext()->activeDOMObjectsAreStopped()) {
+ double elapsedTimeMillis = (monotonicallyIncreasingTime() - utterance->startTime()) * 1000.0;
+ utterance->dispatchEvent(SpeechSynthesisEvent::create(type, utterance, charIndex, elapsedTimeMillis, name));
+ }
}
void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utterance, bool errorOccurred)
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-speak-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698