| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 SpeechInputResult_h | 26 #ifndef SpeechInputResult_h |
| 27 #define SpeechInputResult_h | 27 #define SpeechInputResult_h |
| 28 | 28 |
| 29 #if ENABLE(INPUT_SPEECH) | 29 #if ENABLE(INPUT_SPEECH) |
| 30 | 30 |
| 31 #include "bindings/v8/ScriptWrappable.h" | 31 #include "bindings/v8/ScriptWrappable.h" |
| 32 #include "heap/Handle.h" |
| 32 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 33 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
| 34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
| 35 | 36 |
| 36 namespace WebCore { | 37 namespace WebCore { |
| 37 | 38 |
| 38 // This class holds one speech recognition result including the text and other r
elated | 39 // This class holds one speech recognition result including the text and other r
elated |
| 39 // fields, as received from the embedder. | 40 // fields, as received from the embedder. |
| 40 class SpeechInputResult : public RefCounted<SpeechInputResult>, public ScriptWra
ppable { | 41 class SpeechInputResult : public RefCountedWillBeGarbageCollectedFinalized<Speec
hInputResult>, public ScriptWrappable { |
| 42 DECLARE_GC_INFO; |
| 41 public: | 43 public: |
| 42 static PassRefPtr<SpeechInputResult> create(const SpeechInputResult& source)
; | 44 static PassRefPtrWillBeRawPtr<SpeechInputResult> create(const SpeechInputRes
ult& source); |
| 43 static PassRefPtr<SpeechInputResult> create(const String& utterance, double
confidence); | 45 static PassRefPtrWillBeRawPtr<SpeechInputResult> create(const String& uttera
nce, double confidence); |
| 44 | 46 |
| 45 double confidence() const; | 47 double confidence() const; |
| 46 const String& utterance() const; | 48 const String& utterance() const; |
| 47 | 49 |
| 50 void trace(Visitor *) { } |
| 51 |
| 48 private: | 52 private: |
| 49 SpeechInputResult(const String& utterance, double confidence); | 53 SpeechInputResult(const String& utterance, double confidence); |
| 50 | 54 |
| 51 String m_utterance; | 55 String m_utterance; |
| 52 double m_confidence; | 56 double m_confidence; |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray; | 59 typedef WillBeHeapVector<RefPtrWillBeMember<SpeechInputResult> > SpeechInputResu
ltArray; |
| 56 | 60 |
| 57 } // namespace WebCore | 61 } // namespace WebCore |
| 58 | 62 |
| 59 #endif // ENABLE(INPUT_SPEECH) | 63 #endif // ENABLE(INPUT_SPEECH) |
| 60 | 64 |
| 61 #endif // SpeechInputResult_h | 65 #endif // SpeechInputResult_h |
| OLD | NEW |