This source file includes following definitions.
- ErrorCodeToString
- create
- create
- create
- m_message
- m_message
- interfaceName
#include "config.h"
#include "modules/speech/SpeechRecognitionError.h"
namespace WebCore {
static String ErrorCodeToString(SpeechRecognitionError::ErrorCode code)
{
switch (code) {
case SpeechRecognitionError::ErrorCodeOther:
return "other";
case SpeechRecognitionError::ErrorCodeNoSpeech:
return "no-speech";
case SpeechRecognitionError::ErrorCodeAborted:
return "aborted";
case SpeechRecognitionError::ErrorCodeAudioCapture:
return "audio-capture";
case SpeechRecognitionError::ErrorCodeNetwork:
return "network";
case SpeechRecognitionError::ErrorCodeNotAllowed:
return "not-allowed";
case SpeechRecognitionError::ErrorCodeServiceNotAllowed:
return "service-not-allowed";
case SpeechRecognitionError::ErrorCodeBadGrammar:
return "bad-grammar";
case SpeechRecognitionError::ErrorCodeLanguageNotSupported:
return "language-not-supported";
}
ASSERT_NOT_REACHED();
return String();
}
PassRefPtrWillBeRawPtr<SpeechRecognitionError> SpeechRecognitionError::create(ErrorCode code, const String& message)
{
return adoptRefWillBeNoop(new SpeechRecognitionError(ErrorCodeToString(code), message));
}
PassRefPtrWillBeRawPtr<SpeechRecognitionError> SpeechRecognitionError::create()
{
return adoptRefWillBeNoop(new SpeechRecognitionError(emptyString(), emptyString()));
}
PassRefPtrWillBeRawPtr<SpeechRecognitionError> SpeechRecognitionError::create(const AtomicString& eventName, const SpeechRecognitionErrorInit& initializer)
{
return adoptRefWillBeNoop(new SpeechRecognitionError(eventName, initializer));
}
SpeechRecognitionError::SpeechRecognitionError(const String& error, const String& message)
: Event(EventTypeNames::error, false, false)
, m_error(error)
, m_message(message)
{
ScriptWrappable::init(this);
}
SpeechRecognitionError::SpeechRecognitionError(const AtomicString& eventName, const SpeechRecognitionErrorInit& initializer)
: Event(eventName, initializer)
, m_error(initializer.error)
, m_message(initializer.message)
{
ScriptWrappable::init(this);
}
const AtomicString& SpeechRecognitionError::interfaceName() const
{
return EventNames::SpeechRecognitionError;
}
SpeechRecognitionErrorInit::SpeechRecognitionErrorInit()
{
}
}