Chromium Code Reviews| Index: Source/modules/speech/SpeechRecognitionResult.h |
| diff --git a/Source/modules/speech/SpeechRecognitionResult.h b/Source/modules/speech/SpeechRecognitionResult.h |
| index 3c33629463f00ab8f9a99b8e895bcade97f38431..d5cada1c4b5153ef5f722b9790aed5ef4ff48269 100644 |
| --- a/Source/modules/speech/SpeechRecognitionResult.h |
| +++ b/Source/modules/speech/SpeechRecognitionResult.h |
| @@ -27,26 +27,32 @@ |
| #define SpeechRecognitionResult_h |
| #include "bindings/v8/ScriptWrappable.h" |
| +#include "heap/Handle.h" |
| #include "modules/speech/SpeechRecognitionAlternative.h" |
| #include "wtf/RefCounted.h" |
| #include "wtf/Vector.h" |
| namespace WebCore { |
| -class SpeechRecognitionResult : public ScriptWrappable, public RefCounted<SpeechRecognitionResult> { |
| +class SpeechRecognitionResult : public RefCountedWillBeRefCountedGarbageCollected<SpeechRecognitionResult>, public ScriptWrappable { |
| + DECLARE_GC_INFO; |
| public: |
| ~SpeechRecognitionResult(); |
| - static PassRefPtr<SpeechRecognitionResult> create(const Vector<RefPtr<SpeechRecognitionAlternative> >&, bool final); |
| + // FIXME (oilpan): the platform outer layer depends on holding a RefPtr to a result. |
|
haraken
2014/02/12 05:18:45
FIXME: oilpan:
Also move this FIXME to just above
haraken
2014/02/12 05:18:45
BTW, who retains a RefPtr to the SpeechRecognition
sof
2014/02/12 07:48:51
WebSpeechRecognitionResult holds a WebPrivatePtr t
sof
2014/02/12 07:48:51
Done + added a mention of WebSpeecRecognitionResul
haraken
2014/02/12 08:04:50
I see. Let's fix it in a follow-up CL. You can ref
|
| + // When/once that changes, the return type here can hopefully be adjusted. |
| + static PassRefPtr<SpeechRecognitionResult> create(const Vector<RefPtrWillBeRawPtr<SpeechRecognitionAlternative> >&, bool final); |
|
haraken
2014/02/12 05:18:45
This could be WillBeHeapVector<RefPtrWillBeMember<
sof
2014/02/12 10:17:09
I think it worked out (with side benefit of avoidi
|
| unsigned long length() { return m_alternatives.size(); } |
| SpeechRecognitionAlternative* item(unsigned long index); |
| bool isFinal() { return m_final; } |
| + void trace(Visitor*); |
| + |
| private: |
| - SpeechRecognitionResult(const Vector<RefPtr<SpeechRecognitionAlternative> >&, bool final); |
| + SpeechRecognitionResult(const Vector<RefPtrWillBeRawPtr<SpeechRecognitionAlternative> >&, bool final); |
|
haraken
2014/02/12 05:18:45
Ditto.
sof
2014/02/12 10:17:09
Done.
|
| - Vector<RefPtr<SpeechRecognitionAlternative> > m_alternatives; |
| bool m_final; |
| + Vector<RefPtrWillBeMember<SpeechRecognitionAlternative> > m_alternatives; |
|
haraken
2014/02/12 05:18:45
This works, but we want to use WillBeHeapVector<Re
sof
2014/02/12 10:17:09
Done.
|
| }; |
| } // namespace WebCore |