| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class ExceptionState; | 39 class ExceptionState; |
| 40 class ExecutionContext; | 40 class ExecutionContext; |
| 41 class MediaStreamTrack; | 41 class MediaStreamTrack; |
| 42 class SpeechRecognitionController; | 42 class SpeechRecognitionController; |
| 43 class SpeechRecognitionError; | 43 class SpeechRecognitionError; |
| 44 | 44 |
| 45 class SpeechRecognition FINAL : public RefCountedGarbageCollectedWillBeGarbageCo
llectedFinalized<SpeechRecognition>, public ActiveDOMObject, public EventTargetW
ithInlineData { | 45 class SpeechRecognition final : public RefCountedGarbageCollectedWillBeGarbageCo
llectedFinalized<SpeechRecognition>, public ActiveDOMObject, public EventTargetW
ithInlineData { |
| 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<S
peechRecognition>); | 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<S
peechRecognition>); |
| 47 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); | 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); |
| 49 public: | 49 public: |
| 50 static SpeechRecognition* create(ExecutionContext*); | 50 static SpeechRecognition* create(ExecutionContext*); |
| 51 virtual ~SpeechRecognition(); | 51 virtual ~SpeechRecognition(); |
| 52 | 52 |
| 53 // SpeechRecognition.idl implemementation. | 53 // SpeechRecognition.idl implemementation. |
| 54 // Attributes. | 54 // Attributes. |
| 55 SpeechGrammarList* grammars() { return m_grammars; } | 55 SpeechGrammarList* grammars() { return m_grammars; } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 77 void didEndSpeech(); | 77 void didEndSpeech(); |
| 78 void didEndSound(); | 78 void didEndSound(); |
| 79 void didEndAudio(); | 79 void didEndAudio(); |
| 80 void didReceiveResults(const HeapVector<Member<SpeechRecognitionResult> >& n
ewFinalResults, const HeapVector<Member<SpeechRecognitionResult> >& currentInter
imResults); | 80 void didReceiveResults(const HeapVector<Member<SpeechRecognitionResult> >& n
ewFinalResults, const HeapVector<Member<SpeechRecognitionResult> >& currentInter
imResults); |
| 81 void didReceiveNoMatch(SpeechRecognitionResult*); | 81 void didReceiveNoMatch(SpeechRecognitionResult*); |
| 82 void didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError>); | 82 void didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError>); |
| 83 void didStart(); | 83 void didStart(); |
| 84 void didEnd(); | 84 void didEnd(); |
| 85 | 85 |
| 86 // EventTarget. | 86 // EventTarget. |
| 87 virtual const AtomicString& interfaceName() const OVERRIDE; | 87 virtual const AtomicString& interfaceName() const override; |
| 88 virtual ExecutionContext* executionContext() const OVERRIDE; | 88 virtual ExecutionContext* executionContext() const override; |
| 89 | 89 |
| 90 // ActiveDOMObject. | 90 // ActiveDOMObject. |
| 91 virtual bool hasPendingActivity() const OVERRIDE; | 91 virtual bool hasPendingActivity() const override; |
| 92 virtual void stop() OVERRIDE; | 92 virtual void stop() override; |
| 93 | 93 |
| 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(audiostart); | 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(audiostart); |
| 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundstart); | 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundstart); |
| 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); |
| 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); |
| 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); |
| 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); | 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); |
| 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); | 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); |
| 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); | 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); |
| 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 103 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); | 103 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); |
| 104 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); | 104 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); |
| 105 | 105 |
| 106 virtual void trace(Visitor*) OVERRIDE; | 106 virtual void trace(Visitor*) override; |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 explicit SpeechRecognition(ExecutionContext*); | 109 explicit SpeechRecognition(ExecutionContext*); |
| 110 | 110 |
| 111 Member<SpeechGrammarList> m_grammars; | 111 Member<SpeechGrammarList> m_grammars; |
| 112 Member<MediaStreamTrack> m_audioTrack; | 112 Member<MediaStreamTrack> m_audioTrack; |
| 113 String m_lang; | 113 String m_lang; |
| 114 bool m_continuous; | 114 bool m_continuous; |
| 115 bool m_interimResults; | 115 bool m_interimResults; |
| 116 unsigned long m_maxAlternatives; | 116 unsigned long m_maxAlternatives; |
| 117 | 117 |
| 118 RawPtrWillBeMember<SpeechRecognitionController> m_controller; | 118 RawPtrWillBeMember<SpeechRecognitionController> m_controller; |
| 119 bool m_stoppedByActiveDOMObject; | 119 bool m_stoppedByActiveDOMObject; |
| 120 bool m_started; | 120 bool m_started; |
| 121 bool m_stopping; | 121 bool m_stopping; |
| 122 HeapVector<Member<SpeechRecognitionResult> > m_finalResults; | 122 HeapVector<Member<SpeechRecognitionResult> > m_finalResults; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| 126 | 126 |
| 127 #endif // SpeechRecognition_h | 127 #endif // SpeechRecognition_h |
| OLD | NEW |