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

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

Issue 139803012: Move speech module over to Oilpan. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More namespace tweaks for clang 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/SpeechRecognitionResult.cpp
diff --git a/Source/modules/speech/SpeechRecognitionResult.cpp b/Source/modules/speech/SpeechRecognitionResult.cpp
index b4bfe7d71161fd13307bf4102f69d2e9c9a85d24..da99853b9d3e1741cf2a47412c18080569556132 100644
--- a/Source/modules/speech/SpeechRecognitionResult.cpp
+++ b/Source/modules/speech/SpeechRecognitionResult.cpp
@@ -29,11 +29,13 @@
namespace WebCore {
+DEFINE_GC_INFO(SpeechRecognitionResult);
+
SpeechRecognitionResult::~SpeechRecognitionResult()
{
}
-PassRefPtr<SpeechRecognitionResult> SpeechRecognitionResult::create(const Vector<RefPtr<SpeechRecognitionAlternative> >& alternatives, bool final)
+PassRefPtr<SpeechRecognitionResult> SpeechRecognitionResult::create(const Vector<RefPtrWillBeRawPtr<SpeechRecognitionAlternative> >& alternatives, bool final)
{
return adoptRef(new SpeechRecognitionResult(alternatives, final));
}
@@ -46,11 +48,26 @@ SpeechRecognitionAlternative* SpeechRecognitionResult::item(unsigned long index)
return m_alternatives[index].get();
}
-SpeechRecognitionResult::SpeechRecognitionResult(const Vector<RefPtr<SpeechRecognitionAlternative> >& alternatives, bool final)
- : m_alternatives(alternatives)
- , m_final(final)
+SpeechRecognitionResult::SpeechRecognitionResult(const Vector<RefPtrWillBeRawPtr<SpeechRecognitionAlternative> >& alternatives, bool final)
+ : m_final(final)
+#if !ENABLE(OILPAN)
+ , m_alternatives(alternatives)
+#endif
{
ScriptWrappable::init(this);
+#if ENABLE(OILPAN)
+ // Manual copying Vector<RawPtr> to Vector<Member>.
haraken 2014/02/12 05:18:45 That's why we want to use WillBeHeapVector<RefPtrW
+ m_alternatives.grow(alternatives.size());
+ for (size_t i = 0; i < alternatives.size(); i++)
+ m_alternatives[i] = alternatives[i];
+#endif
+}
+
+void SpeechRecognitionResult::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
haraken 2014/02/12 05:18:45 Is this #if needed?
sof 2014/02/12 07:48:51 It's like the earlier one, not being able to handl
+ visitor->trace(m_alternatives);
+#endif
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698