This source file includes following definitions.
- create
- create
- createResult
- createNoMatch
- interfaceName
- m_results
- m_results
- trace
#include "config.h"
#include "modules/speech/SpeechRecognitionEvent.h"
namespace WebCore {
SpeechRecognitionEventInit::SpeechRecognitionEventInit()
: resultIndex(0)
{
}
PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create()
{
return adoptRefWillBeNoop(new SpeechRecognitionEvent());
}
PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create(const AtomicString& eventName, const SpeechRecognitionEventInit& initializer)
{
return adoptRefWillBeNoop(new SpeechRecognitionEvent(eventName, initializer));
}
PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createResult(unsigned long resultIndex, const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> >& results)
{
return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::result, resultIndex, SpeechRecognitionResultList::create(results)));
}
PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createNoMatch(PassRefPtrWillBeRawPtr<SpeechRecognitionResult> result)
{
if (result) {
WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> > results;
results.append(result);
return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nomatch, 0, SpeechRecognitionResultList::create(results)));
}
return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nomatch, 0, nullptr));
}
const AtomicString& SpeechRecognitionEvent::interfaceName() const
{
return EventNames::SpeechRecognitionEvent;
}
SpeechRecognitionEvent::SpeechRecognitionEvent()
: m_resultIndex(0)
{
ScriptWrappable::init(this);
}
SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomicString& eventName, const SpeechRecognitionEventInit& initializer)
: Event(eventName, initializer)
, m_resultIndex(initializer.resultIndex)
, m_results(initializer.results)
{
ScriptWrappable::init(this);
}
SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIndex, PassRefPtrWillBeRawPtr<SpeechRecognitionResultList> results)
: Event(eventName, false, false)
, m_resultIndex(resultIndex)
, m_results(results)
{
ScriptWrappable::init(this);
}
SpeechRecognitionEvent::~SpeechRecognitionEvent()
{
ScriptWrappable::init(this);
}
void SpeechRecognitionEvent::trace(Visitor* visitor)
{
visitor->trace(m_results);
Event::trace(visitor);
}
}