#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> {
+// FIXME: oilpan: the platform outer layer (WebSpeechRecognitionResult) depends on
+// holding a WebPrivatePtr (a RefPtr) to this result object. When/if such pointers
+// can be to GCed objects, we can drop the extra reference counting layer.
+class SpeechRecognitionResult : public RefCountedWillBeRefCountedGarbageCollected<SpeechRecognitionResult>, public ScriptWrappable {
+ DECLARE_GC_INFO;
public:
~SpeechRecognitionResult();
- static PassRefPtr<SpeechRecognitionResult> create(const Vector<RefPtr<SpeechRecognitionAlternative> >&, bool final);
+ static PassRefPtr<SpeechRecognitionResult> create(const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionAlternative> >&, bool final);
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 WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionAlternative> >&, bool final);
- Vector<RefPtr<SpeechRecognitionAlternative> > m_alternatives;
bool m_final;
+ WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionAlternative> > m_alternatives;
};
} // namespace WebCore