| 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 30 matching lines...) Expand all Loading... |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class ExceptionState; | 43 class ExceptionState; |
| 44 class ExecutionContext; | 44 class ExecutionContext; |
| 45 class MediaStreamTrack; | 45 class MediaStreamTrack; |
| 46 class SpeechRecognitionController; | 46 class SpeechRecognitionController; |
| 47 class SpeechRecognitionError; | 47 class SpeechRecognitionError; |
| 48 | 48 |
| 49 class MODULES_EXPORT SpeechRecognition final : public RefCountedGarbageCollected
EventTargetWithInlineData<SpeechRecognition>, public PageLifecycleObserver, publ
ic ActiveScriptWrappable, public ActiveDOMObject { | 49 class MODULES_EXPORT SpeechRecognition final : public RefCountedGarbageCollected
EventTargetWithInlineData<SpeechRecognition>, public PageLifecycleObserver, publ
ic ActiveScriptWrappable, public ActiveDOMObject { |
| 50 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SpeechRecognition); | 50 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SpeechRecognition); |
| 51 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); | 51 USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); |
| 52 DEFINE_WRAPPERTYPEINFO(); | 52 DEFINE_WRAPPERTYPEINFO(); |
| 53 public: | 53 public: |
| 54 static SpeechRecognition* create(ExecutionContext*); | 54 static SpeechRecognition* create(ExecutionContext*); |
| 55 ~SpeechRecognition() override; | 55 ~SpeechRecognition() override; |
| 56 | 56 |
| 57 // SpeechRecognition.idl implemementation. | 57 // SpeechRecognition.idl implemementation. |
| 58 // Attributes. | 58 // Attributes. |
| 59 SpeechGrammarList* grammars() { return m_grammars; } | 59 SpeechGrammarList* grammars() { return m_grammars; } |
| 60 void setGrammars(SpeechGrammarList* grammars) { m_grammars = grammars; } | 60 void setGrammars(SpeechGrammarList* grammars) { m_grammars = grammars; } |
| 61 String lang() { return m_lang; } | 61 String lang() { return m_lang; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 76 | 76 |
| 77 // Called by the SpeechRecognitionClient. | 77 // Called by the SpeechRecognitionClient. |
| 78 void didStartAudio(); | 78 void didStartAudio(); |
| 79 void didStartSound(); | 79 void didStartSound(); |
| 80 void didStartSpeech(); | 80 void didStartSpeech(); |
| 81 void didEndSpeech(); | 81 void didEndSpeech(); |
| 82 void didEndSound(); | 82 void didEndSound(); |
| 83 void didEndAudio(); | 83 void didEndAudio(); |
| 84 void didReceiveResults(const HeapVector<Member<SpeechRecognitionResult>>& ne
wFinalResults, const HeapVector<Member<SpeechRecognitionResult>>& currentInterim
Results); | 84 void didReceiveResults(const HeapVector<Member<SpeechRecognitionResult>>& ne
wFinalResults, const HeapVector<Member<SpeechRecognitionResult>>& currentInterim
Results); |
| 85 void didReceiveNoMatch(SpeechRecognitionResult*); | 85 void didReceiveNoMatch(SpeechRecognitionResult*); |
| 86 void didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError>); | 86 void didReceiveError(RawPtr<SpeechRecognitionError>); |
| 87 void didStart(); | 87 void didStart(); |
| 88 void didEnd(); | 88 void didEnd(); |
| 89 | 89 |
| 90 // EventTarget. | 90 // EventTarget. |
| 91 const AtomicString& interfaceName() const override; | 91 const AtomicString& interfaceName() const override; |
| 92 ExecutionContext* getExecutionContext() const override; | 92 ExecutionContext* getExecutionContext() const override; |
| 93 | 93 |
| 94 // ActiveScriptWrappable. | 94 // ActiveScriptWrappable. |
| 95 bool hasPendingActivity() const final; | 95 bool hasPendingActivity() const final; |
| 96 | 96 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 117 private: | 117 private: |
| 118 SpeechRecognition(Page*, ExecutionContext*); | 118 SpeechRecognition(Page*, ExecutionContext*); |
| 119 | 119 |
| 120 Member<SpeechGrammarList> m_grammars; | 120 Member<SpeechGrammarList> m_grammars; |
| 121 Member<MediaStreamTrack> m_audioTrack; | 121 Member<MediaStreamTrack> m_audioTrack; |
| 122 String m_lang; | 122 String m_lang; |
| 123 bool m_continuous; | 123 bool m_continuous; |
| 124 bool m_interimResults; | 124 bool m_interimResults; |
| 125 unsigned long m_maxAlternatives; | 125 unsigned long m_maxAlternatives; |
| 126 | 126 |
| 127 RawPtrWillBeMember<SpeechRecognitionController> m_controller; | 127 Member<SpeechRecognitionController> m_controller; |
| 128 bool m_stoppedByActiveDOMObject; | 128 bool m_stoppedByActiveDOMObject; |
| 129 bool m_started; | 129 bool m_started; |
| 130 bool m_stopping; | 130 bool m_stopping; |
| 131 HeapVector<Member<SpeechRecognitionResult>> m_finalResults; | 131 HeapVector<Member<SpeechRecognitionResult>> m_finalResults; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace blink | 134 } // namespace blink |
| 135 | 135 |
| 136 #endif // SpeechRecognition_h | 136 #endif // SpeechRecognition_h |
| OLD | NEW |