Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef SpeechRecognition_h | 26 #ifndef SpeechRecognition_h |
| 27 #define SpeechRecognition_h | 27 #define SpeechRecognition_h |
| 28 | 28 |
| 29 #include "bindings/v8/ScriptWrappable.h" | 29 #include "bindings/v8/ScriptWrappable.h" |
| 30 #include "core/dom/ActiveDOMObject.h" | 30 #include "core/dom/ActiveDOMObject.h" |
| 31 #include "core/events/EventTarget.h" | 31 #include "core/events/EventTarget.h" |
| 32 #include "heap/Handle.h" | |
| 32 #include "modules/speech/SpeechGrammarList.h" | 33 #include "modules/speech/SpeechGrammarList.h" |
| 34 #include "modules/speech/SpeechRecognitionResult.h" | |
| 33 #include "wtf/Compiler.h" | 35 #include "wtf/Compiler.h" |
| 34 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
| 36 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
| 37 | 39 |
| 38 namespace WebCore { | 40 namespace WebCore { |
| 39 | 41 |
| 40 class ExceptionState; | 42 class ExceptionState; |
| 41 class ExecutionContext; | 43 class ExecutionContext; |
| 42 class SpeechRecognitionController; | 44 class SpeechRecognitionController; |
| 43 class SpeechRecognitionError; | 45 class SpeechRecognitionError; |
| 44 class SpeechRecognitionResult; | |
| 45 class SpeechRecognitionResultList; | |
| 46 | 46 |
| 47 class SpeechRecognition FINAL : public RefCounted<SpeechRecognition>, public Scr iptWrappable, public ActiveDOMObject, public EventTargetWithInlineData { | 47 class SpeechRecognition FINAL : public RefCountedWillBeRefCountedGarbageCollecte d<SpeechRecognition>, public ScriptWrappable, public ActiveDOMObject, public Eve ntTargetWithInlineData { |
| 48 REFCOUNTED_EVENT_TARGET(SpeechRecognition); | 48 DECLARE_GC_INFO; |
| 49 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<S peechRecognition>); | |
| 49 public: | 50 public: |
| 50 static PassRefPtr<SpeechRecognition> create(ExecutionContext*); | 51 static PassRefPtrWillBeRawPtr<SpeechRecognition> create(ExecutionContext*); |
| 51 virtual ~SpeechRecognition(); | 52 virtual ~SpeechRecognition(); |
| 52 | 53 |
| 53 // Attributes. | 54 // Attributes. |
| 54 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; } | 55 SpeechGrammarList* grammars() { return m_grammars.get(); } |
| 55 void setGrammars(PassRefPtr<SpeechGrammarList> grammars) { m_grammars = gram mars; } | 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; } |
| 59 void setContinuous(bool continuous) { m_continuous = continuous; } | 60 void setContinuous(bool continuous) { m_continuous = continuous; } |
| 60 bool interimResults() { return m_interimResults; } | 61 bool interimResults() { return m_interimResults; } |
| 61 void setInterimResults(bool interimResults) { m_interimResults = interimResu lts; } | 62 void setInterimResults(bool interimResults) { m_interimResults = interimResu lts; } |
| 62 unsigned long maxAlternatives() { return m_maxAlternatives; } | 63 unsigned long maxAlternatives() { return m_maxAlternatives; } |
| 63 void setMaxAlternatives(unsigned long maxAlternatives) { m_maxAlternatives = maxAlternatives; } | 64 void setMaxAlternatives(unsigned long maxAlternatives) { m_maxAlternatives = maxAlternatives; } |
| 64 | 65 |
| 65 // Callable by the user. | 66 // Callable by the user. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); | 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); |
| 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); | 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); |
| 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); | 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); |
| 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); |
| 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); |
| 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); |
| 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); | 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); |
| 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); | 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); |
| 101 | 102 |
| 103 void trace(Visitor*); | |
| 104 | |
| 102 private: | 105 private: |
| 103 friend class RefCounted<SpeechRecognition>; | 106 friend class RefCounted<SpeechRecognition>; |
| 104 | 107 |
| 105 explicit SpeechRecognition(ExecutionContext*); | 108 explicit SpeechRecognition(ExecutionContext*); |
| 106 | 109 |
| 107 RefPtr<SpeechGrammarList> m_grammars; | 110 RefPtrWillBeMember<SpeechGrammarList> m_grammars; |
| 108 String m_lang; | 111 String m_lang; |
| 109 bool m_continuous; | 112 bool m_continuous; |
| 110 bool m_interimResults; | 113 bool m_interimResults; |
| 111 unsigned long m_maxAlternatives; | 114 unsigned long m_maxAlternatives; |
| 112 | 115 |
| 113 SpeechRecognitionController* m_controller; | 116 SpeechRecognitionController* m_controller; |
| 114 bool m_stoppedByActiveDOMObject; | 117 bool m_stoppedByActiveDOMObject; |
| 115 bool m_started; | 118 bool m_started; |
| 116 bool m_stopping; | 119 bool m_stopping; |
| 117 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults; | 120 WillBeHeapVector<RefPtr<SpeechRecognitionResult> > m_finalResults; |
|
haraken
2014/02/12 11:12:54
This should be WillBeHeapVector<RefPtrWillBeMember
zerny-chromium
2014/02/12 11:45:19
This should just stay as a non-heap vector until t
sof
2014/02/12 16:18:13
Changed back to a Vector<>
| |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace WebCore | 123 } // namespace WebCore |
| 121 | 124 |
| 122 #endif // SpeechRecognition_h | 125 #endif // SpeechRecognition_h |
| OLD | NEW |