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

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

Issue 168963003: Make WebPrivatePtr capable of wrapping garbage collected objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Temporarily drop back to using .reset() instead of nullptr. 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/SpeechRecognition.cpp
diff --git a/Source/modules/speech/SpeechRecognition.cpp b/Source/modules/speech/SpeechRecognition.cpp
index d81aa2c39bb27c27fc8c47816f62d219ded98328..84027e379a956bd78395875e13b461dfaa63b280 100644
--- a/Source/modules/speech/SpeechRecognition.cpp
+++ b/Source/modules/speech/SpeechRecognition.cpp
@@ -108,21 +108,21 @@ void SpeechRecognition::didEndAudio()
dispatchEvent(Event::create(EventTypeNames::audioend));
}
-void SpeechRecognition::didReceiveResults(const Vector<RefPtr<SpeechRecognitionResult> >& newFinalResults, const Vector<RefPtr<SpeechRecognitionResult> >& currentInterimResults)
+void SpeechRecognition::didReceiveResults(const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> >& newFinalResults, const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> >& currentInterimResults)
{
unsigned long resultIndex = m_finalResults.size();
for (size_t i = 0; i < newFinalResults.size(); ++i)
m_finalResults.append(newFinalResults[i]);
- Vector<RefPtr<SpeechRecognitionResult> > results = m_finalResults;
+ WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> > results = m_finalResults;
for (size_t i = 0; i < currentInterimResults.size(); ++i)
results.append(currentInterimResults[i]);
dispatchEvent(SpeechRecognitionEvent::createResult(resultIndex, results));
}
-void SpeechRecognition::didReceiveNoMatch(PassRefPtr<SpeechRecognitionResult> result)
+void SpeechRecognition::didReceiveNoMatch(PassRefPtrWillBeRawPtr<SpeechRecognitionResult> result)
{
dispatchEvent(SpeechRecognitionEvent::createNoMatch(result));
}
@@ -194,6 +194,7 @@ SpeechRecognition::~SpeechRecognition()
void SpeechRecognition::trace(Visitor* visitor)
{
visitor->trace(m_grammars);
+ visitor->trace(m_finalResults);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698