| 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 21 matching lines...) Expand all Loading... |
| 32 #include "modules/speech/SpeechRecognitionResultList.h" | 32 #include "modules/speech/SpeechRecognitionResultList.h" |
| 33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class Document; | 37 class Document; |
| 38 | 38 |
| 39 class SpeechRecognitionEvent final : public Event { | 39 class SpeechRecognitionEvent final : public Event { |
| 40 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
| 41 public: | 41 public: |
| 42 static RawPtr<SpeechRecognitionEvent> create(); | 42 static SpeechRecognitionEvent* create(); |
| 43 static RawPtr<SpeechRecognitionEvent> create(const AtomicString&, const Spee
chRecognitionEventInit&); | 43 static SpeechRecognitionEvent* create(const AtomicString&, const SpeechRecog
nitionEventInit&); |
| 44 ~SpeechRecognitionEvent() override; | 44 ~SpeechRecognitionEvent() override; |
| 45 | 45 |
| 46 static RawPtr<SpeechRecognitionEvent> createResult(unsigned long resultIndex
, const HeapVector<Member<SpeechRecognitionResult>>& results); | 46 static SpeechRecognitionEvent* createResult(unsigned long resultIndex, const
HeapVector<Member<SpeechRecognitionResult>>& results); |
| 47 static RawPtr<SpeechRecognitionEvent> createNoMatch(SpeechRecognitionResult*
); | 47 static SpeechRecognitionEvent* createNoMatch(SpeechRecognitionResult*); |
| 48 | 48 |
| 49 unsigned long resultIndex() const { return m_resultIndex; } | 49 unsigned long resultIndex() const { return m_resultIndex; } |
| 50 SpeechRecognitionResultList* results() const { return m_results; } | 50 SpeechRecognitionResultList* results() const { return m_results; } |
| 51 | 51 |
| 52 // These two methods are here to satisfy the specification which requires th
ese attributes to exist. | 52 // These two methods are here to satisfy the specification which requires th
ese attributes to exist. |
| 53 Document* interpretation() { return nullptr; } | 53 Document* interpretation() { return nullptr; } |
| 54 Document* emma() { return nullptr; } | 54 Document* emma() { return nullptr; } |
| 55 | 55 |
| 56 // Event | 56 // Event |
| 57 const AtomicString& interfaceName() const override; | 57 const AtomicString& interfaceName() const override; |
| 58 | 58 |
| 59 DECLARE_VIRTUAL_TRACE(); | 59 DECLARE_VIRTUAL_TRACE(); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 SpeechRecognitionEvent(); | 62 SpeechRecognitionEvent(); |
| 63 SpeechRecognitionEvent(const AtomicString&, const SpeechRecognitionEventInit
&); | 63 SpeechRecognitionEvent(const AtomicString&, const SpeechRecognitionEventInit
&); |
| 64 SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIn
dex, SpeechRecognitionResultList* results); | 64 SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIn
dex, SpeechRecognitionResultList* results); |
| 65 | 65 |
| 66 unsigned long m_resultIndex; | 66 unsigned long m_resultIndex; |
| 67 Member<SpeechRecognitionResultList> m_results; | 67 Member<SpeechRecognitionResultList> m_results; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| 71 | 71 |
| 72 #endif // SpeechRecognitionEvent_h | 72 #endif // SpeechRecognitionEvent_h |
| OLD | NEW |