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

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: Switch SpeechRecognitionResult over to WillBeHeapVector also 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..e8be3d148b9be84989f6087d05f1a038d1ab2961 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 adoptRefWillBeNoop(new SpeechSynthesis(context));
zerny-chromium 2014/02/12 11:45:19 adoptRefWillBeRefCountedGarbageCollected (alas, it
}
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;
haraken 2014/02/12 11:12:54 This works, but we prefer using RawPtrs on a stack
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();
haraken 2014/02/12 11:12:54 Ditto. RefPtrWillBeRawPtr.
ASSERT(firstUtterance == utterance);
if (firstUtterance == utterance)
m_utteranceQueue.removeFirst();
@@ -227,4 +229,13 @@ const AtomicString& SpeechSynthesis::interfaceName() const
return EventTargetNames::SpeechSynthesisUtterance;
}
+void SpeechSynthesis::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
zerny-chromium 2014/02/12 11:45:19 Nit: should not be needed
+ visitor->trace(m_voiceList);
+ visitor->trace(m_currentSpeechUtterance);
+ visitor->trace(m_utteranceQueue);
+#endif
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698