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

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

Issue 185093002: Revert 168169 "Fix use-after-free of m_currentSpeechUtterance." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 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 | Annotate | Revision Log
« 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (utterance->client()) 215 if (utterance->client())
216 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance ->client()), false); 216 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance ->client()), false);
217 } 217 }
218 218
219 void SpeechSynthesis::speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUt terance> utterance) 219 void SpeechSynthesis::speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUt terance> utterance)
220 { 220 {
221 if (utterance->client()) 221 if (utterance->client())
222 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance ->client()), true); 222 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance ->client()), true);
223 } 223 }
224 224
225 SpeechSynthesisUtterance* SpeechSynthesis::currentSpeechUtterance() const
226 {
227 if (!m_utteranceQueue.isEmpty())
228 return m_utteranceQueue.first().get();
229 return 0;
230 }
231
232 const AtomicString& SpeechSynthesis::interfaceName() const 225 const AtomicString& SpeechSynthesis::interfaceName() const
233 { 226 {
234 return EventTargetNames::SpeechSynthesisUtterance; 227 return EventTargetNames::SpeechSynthesisUtterance;
235 } 228 }
236 229
237 void SpeechSynthesis::trace(Visitor* visitor) 230 void SpeechSynthesis::trace(Visitor* visitor)
238 { 231 {
239 visitor->trace(m_voiceList); 232 visitor->trace(m_voiceList);
240 visitor->trace(m_currentSpeechUtterance); 233 visitor->trace(m_currentSpeechUtterance);
241 visitor->trace(m_utteranceQueue); 234 visitor->trace(m_utteranceQueue);
242 } 235 }
243 236
244 } // namespace WebCore 237 } // 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