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

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

Issue 1007803002: Add SpeechSynthesisUtterance attribute on SpeechSynthesisEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix error on layout-test Created 5 years, 9 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
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 void SpeechSynthesis::resume() 138 void SpeechSynthesis::resume()
139 { 139 {
140 if (!currentSpeechUtterance()) 140 if (!currentSpeechUtterance())
141 return; 141 return;
142 m_platformSpeechSynthesizer->resume(); 142 m_platformSpeechSynthesizer->resume();
143 } 143 }
144 144
145 void SpeechSynthesis::fireEvent(const AtomicString& type, SpeechSynthesisUtteran ce* utterance, unsigned long charIndex, const String& name) 145 void SpeechSynthesis::fireEvent(const AtomicString& type, SpeechSynthesisUtteran ce* utterance, unsigned long charIndex, const String& name)
146 { 146 {
147 if (executionContext() && !executionContext()->activeDOMObjectsAreStopped()) 147 if (executionContext() && !executionContext()->activeDOMObjectsAreStopped())
148 utterance->dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, ( currentTime() - utterance->startTime()), name)); 148 utterance->dispatchEvent(SpeechSynthesisEvent::create(type, utterance, c harIndex, (currentTime() - utterance->startTime()), name));
149 } 149 }
150 150
151 void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc e, bool errorOccurred) 151 void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc e, bool errorOccurred)
152 { 152 {
153 ASSERT(utterance); 153 ASSERT(utterance);
154 154
155 bool shouldStartSpeaking = false; 155 bool shouldStartSpeaking = false;
156 // If the utterance that completed was the one we're currently speaking, 156 // If the utterance that completed was the one we're currently speaking,
157 // remove it from the queue and start speaking the next one. 157 // remove it from the queue and start speaking the next one.
158 if (utterance == currentSpeechUtterance()) { 158 if (utterance == currentSpeechUtterance()) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechSynthesis>::trace( visitor); 242 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechSynthesis>::trace( visitor);
243 ContextLifecycleObserver::trace(visitor); 243 ContextLifecycleObserver::trace(visitor);
244 } 244 }
245 245
246 } // namespace blink 246 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/webexposed/global-interface-listing-expected.txt ('k') | Source/modules/speech/SpeechSynthesisEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698