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

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

Issue 139803012: Move speech module over to Oilpan. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make SpeechSynthesisVoice GC-finalized Created 6 years, 10 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
Index: Source/modules/speech/SpeechSynthesis.cpp
diff --git a/Source/modules/speech/SpeechSynthesis.cpp b/Source/modules/speech/SpeechSynthesis.cpp
index 2a989a9514d29873f77f26251ed9f35517cc7e02..5c60959595bc82f072253e395b84043edff84710 100644
--- a/Source/modules/speech/SpeechSynthesis.cpp
+++ b/Source/modules/speech/SpeechSynthesis.cpp
@@ -34,9 +34,11 @@
namespace WebCore {
-PassRefPtr<SpeechSynthesis> SpeechSynthesis::create(ExecutionContext* context)
+DEFINE_GC_INFO(SpeechSynthesis);
+
+PassRefPtrWillBeRawPtr<SpeechSynthesis> SpeechSynthesis::create(ExecutionContext* context)
{
- return adoptRef(new SpeechSynthesis(context));
+ return adoptRefCountedWillBeRefCountedGarbageCollected(new SpeechSynthesis(context));
}
SpeechSynthesis::SpeechSynthesis(ExecutionContext* context)
@@ -65,7 +67,7 @@ void SpeechSynthesis::voicesDidChange()
dispatchEvent(Event::create(EventTypeNames::voiceschanged));
}
-const Vector<RefPtr<SpeechSynthesisVoice> >& SpeechSynthesis::getVoices()
+const WillBeHeapVector<RefPtrWillBeMember<SpeechSynthesisVoice> >& SpeechSynthesis::getVoices()
{
if (m_voiceList.size())
return m_voiceList;
@@ -125,7 +127,7 @@ void SpeechSynthesis::cancel()
{
// Remove all the items from the utterance queue.
// Hold on to the current utterance so the platform synthesizer can have a chance to clean up.
- RefPtr<SpeechSynthesisUtterance> current = m_currentSpeechUtterance;
+ RefPtrWillBeMember<SpeechSynthesisUtterance> current = m_currentSpeechUtterance;
m_utteranceQueue.clear();
m_platformSpeechSynthesizer->cancel();
current = 0;
@@ -162,7 +164,7 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc
fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end, utterance, 0, String());
if (m_utteranceQueue.size()) {
- RefPtr<SpeechSynthesisUtterance> firstUtterance = m_utteranceQueue.first();
+ RefPtrWillBeMember<SpeechSynthesisUtterance> firstUtterance = m_utteranceQueue.first();
ASSERT(firstUtterance == utterance);
if (firstUtterance == utterance)
m_utteranceQueue.removeFirst();
@@ -227,4 +229,11 @@ const AtomicString& SpeechSynthesis::interfaceName() const
return EventTargetNames::SpeechSynthesisUtterance;
}
+void SpeechSynthesis::trace(Visitor* visitor)
+{
+ visitor->trace(m_voiceList);
+ visitor->trace(m_currentSpeechUtterance);
+ visitor->trace(m_utteranceQueue);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698