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 27 matching lines...) Expand all Loading... |
38 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class ExceptionState; | 42 class ExceptionState; |
43 class ExecutionContext; | 43 class ExecutionContext; |
44 class SpeechRecognitionController; | 44 class SpeechRecognitionController; |
45 class SpeechRecognitionError; | 45 class SpeechRecognitionError; |
46 | 46 |
47 class SpeechRecognition FINAL : public RefCountedWillBeRefCountedGarbageCollecte
d<SpeechRecognition>, public ScriptWrappable, public ActiveDOMObject, public Eve
ntTargetWithInlineData { | 47 class SpeechRecognition FINAL : public RefCountedWillBeRefCountedGarbageCollecte
d<SpeechRecognition>, public ScriptWrappable, public ActiveDOMObject, public Eve
ntTargetWithInlineData { |
48 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<S
peechRecognition>); | 48 REFCOUNTED_EVENT_TARGET(SpeechRecognition); |
| 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); |
49 public: | 50 public: |
50 static PassRefPtrWillBeRawPtr<SpeechRecognition> create(ExecutionContext*); | 51 static PassRefPtrWillBeRawPtr<SpeechRecognition> create(ExecutionContext*); |
51 virtual ~SpeechRecognition(); | 52 virtual ~SpeechRecognition(); |
52 | 53 |
53 // Attributes. | 54 // Attributes. |
54 SpeechGrammarList* grammars() { return m_grammars.get(); } | 55 SpeechGrammarList* grammars() { return m_grammars.get(); } |
55 void setGrammars(PassRefPtrWillBeRawPtr<SpeechGrammarList> grammars) { m_gra
mmars = grammars; } | 56 void setGrammars(PassRefPtrWillBeRawPtr<SpeechGrammarList> grammars) { m_gra
mmars = grammars; } |
56 String lang() { return m_lang; } | 57 String lang() { return m_lang; } |
57 void setLang(const String& lang) { m_lang = lang; } | 58 void setLang(const String& lang) { m_lang = lang; } |
58 bool continuous() { return m_continuous; } | 59 bool continuous() { return m_continuous; } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); | 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); |
94 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); | 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); |
95 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); |
96 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); |
97 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); |
98 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); | 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); |
99 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
100 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); | 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); |
101 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); | 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); |
102 | 103 |
103 void trace(Visitor*); | 104 virtual void trace(Visitor*) OVERRIDE; |
104 | 105 |
105 private: | 106 private: |
106 friend class RefCounted<SpeechRecognition>; | 107 friend class RefCounted<SpeechRecognition>; |
107 | 108 |
108 explicit SpeechRecognition(ExecutionContext*); | 109 explicit SpeechRecognition(ExecutionContext*); |
109 | 110 |
110 RefPtrWillBeMember<SpeechGrammarList> m_grammars; | 111 RefPtrWillBeMember<SpeechGrammarList> m_grammars; |
111 String m_lang; | 112 String m_lang; |
112 bool m_continuous; | 113 bool m_continuous; |
113 bool m_interimResults; | 114 bool m_interimResults; |
114 unsigned long m_maxAlternatives; | 115 unsigned long m_maxAlternatives; |
115 | 116 |
116 SpeechRecognitionController* m_controller; | 117 SpeechRecognitionController* m_controller; |
117 bool m_stoppedByActiveDOMObject; | 118 bool m_stoppedByActiveDOMObject; |
118 bool m_started; | 119 bool m_started; |
119 bool m_stopping; | 120 bool m_stopping; |
120 WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> > m_finalResult
s; | 121 WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> > m_finalResult
s; |
121 }; | 122 }; |
122 | 123 |
123 } // namespace WebCore | 124 } // namespace WebCore |
124 | 125 |
125 #endif // SpeechRecognition_h | 126 #endif // SpeechRecognition_h |
OLD | NEW |