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

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

Issue 330463002: Revert of Enable Oilpan by default in modules/speech/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « Source/modules/speech/SpeechSynthesis.h ('k') | Source/modules/speech/SpeechSynthesis.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/speech/SpeechSynthesis.cpp
diff --git a/Source/modules/speech/SpeechSynthesis.cpp b/Source/modules/speech/SpeechSynthesis.cpp
index 35560788f0929cb1f0307052ee753fe826cbc619..7393a91c45acddd9ad3dcbe6a786c66bc1c15119 100644
--- a/Source/modules/speech/SpeechSynthesis.cpp
+++ b/Source/modules/speech/SpeechSynthesis.cpp
@@ -34,9 +34,9 @@
namespace WebCore {
-SpeechSynthesis* SpeechSynthesis::create(ExecutionContext* context)
-{
- return adoptRefCountedGarbageCollected(new SpeechSynthesis(context));
+PassRefPtrWillBeRawPtr<SpeechSynthesis> SpeechSynthesis::create(ExecutionContext* context)
+{
+ return adoptRefWillBeRefCountedGarbageCollected(new SpeechSynthesis(context));
}
SpeechSynthesis::SpeechSynthesis(ExecutionContext* context)
@@ -64,7 +64,7 @@
dispatchEvent(Event::create(EventTypeNames::voiceschanged));
}
-const HeapVector<Member<SpeechSynthesisVoice> >& SpeechSynthesis::getVoices()
+const WillBeHeapVector<RefPtrWillBeMember<SpeechSynthesisVoice> >& SpeechSynthesis::getVoices()
{
if (m_voiceList.size())
return m_voiceList;
@@ -152,6 +152,10 @@
void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utterance, bool errorOccurred)
{
ASSERT(utterance);
+
+ // Keep the utterance around long enough to fire an event on it in case m_utteranceQueue
+ // is holding the last reference to it.
+ RefPtrWillBeRawPtr<SpeechSynthesisUtterance> protect(utterance);
bool didJustFinishCurrentUtterance = false;
// If the utterance that completed was the one we're currently speaking,
« no previous file with comments | « Source/modules/speech/SpeechSynthesis.h ('k') | Source/modules/speech/SpeechSynthesis.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698