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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 SpeechRecognitionEventInit::SpeechRecognitionEventInit() | 32 SpeechRecognitionEventInit::SpeechRecognitionEventInit() |
33 : resultIndex(0) | 33 : resultIndex(0) |
34 { | 34 { |
35 } | 35 } |
36 | 36 |
37 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create() | 37 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create() |
38 { | 38 { |
39 return adoptRefWillBeNoop(new SpeechRecognitionEvent()); | 39 return adoptRefWillBeNoop(new SpeechRecognitionEvent); |
40 } | 40 } |
41 | 41 |
42 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create(co
nst AtomicString& eventName, const SpeechRecognitionEventInit& initializer) | 42 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create(co
nst AtomicString& eventName, const SpeechRecognitionEventInit& initializer) |
43 { | 43 { |
44 return adoptRefWillBeNoop(new SpeechRecognitionEvent(eventName, initializer)
); | 44 return adoptRefWillBeNoop(new SpeechRecognitionEvent(eventName, initializer)
); |
45 } | 45 } |
46 | 46 |
47 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createRes
ult(unsigned long resultIndex, const WillBeHeapVector<RefPtrWillBeMember<SpeechR
ecognitionResult> >& results) | 47 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createRes
ult(unsigned long resultIndex, const HeapVector<Member<SpeechRecognitionResult>
>& results) |
48 { | 48 { |
49 return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::result,
resultIndex, SpeechRecognitionResultList::create(results))); | 49 return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::result,
resultIndex, SpeechRecognitionResultList::create(results))); |
50 } | 50 } |
51 | 51 |
52 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createNoM
atch(PassRefPtrWillBeRawPtr<SpeechRecognitionResult> result) | 52 PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createNoM
atch(SpeechRecognitionResult* result) |
53 { | 53 { |
54 if (result) { | 54 if (result) { |
55 WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> > results; | 55 HeapVector<Member<SpeechRecognitionResult> > results; |
56 results.append(result); | 56 results.append(result); |
57 return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nom
atch, 0, SpeechRecognitionResultList::create(results))); | 57 return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nom
atch, 0, SpeechRecognitionResultList::create(results))); |
58 } | 58 } |
59 | 59 |
60 return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nomatch
, 0, nullptr)); | 60 return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nomatch
, 0, nullptr)); |
61 } | 61 } |
62 | 62 |
63 const AtomicString& SpeechRecognitionEvent::interfaceName() const | 63 const AtomicString& SpeechRecognitionEvent::interfaceName() const |
64 { | 64 { |
65 return EventNames::SpeechRecognitionEvent; | 65 return EventNames::SpeechRecognitionEvent; |
66 } | 66 } |
67 | 67 |
68 SpeechRecognitionEvent::SpeechRecognitionEvent() | 68 SpeechRecognitionEvent::SpeechRecognitionEvent() |
69 : m_resultIndex(0) | 69 : m_resultIndex(0) |
70 { | 70 { |
71 ScriptWrappable::init(this); | 71 ScriptWrappable::init(this); |
72 } | 72 } |
73 | 73 |
74 SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomicString& eventName, co
nst SpeechRecognitionEventInit& initializer) | 74 SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomicString& eventName, co
nst SpeechRecognitionEventInit& initializer) |
75 : Event(eventName, initializer) | 75 : Event(eventName, initializer) |
76 , m_resultIndex(initializer.resultIndex) | 76 , m_resultIndex(initializer.resultIndex) |
77 , m_results(initializer.results) | 77 , m_results(initializer.results) |
78 { | 78 { |
79 ScriptWrappable::init(this); | 79 ScriptWrappable::init(this); |
80 } | 80 } |
81 | 81 |
82 SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomicString& eventName, un
signed long resultIndex, PassRefPtrWillBeRawPtr<SpeechRecognitionResultList> res
ults) | 82 SpeechRecognitionEvent::SpeechRecognitionEvent(const AtomicString& eventName, un
signed long resultIndex, SpeechRecognitionResultList* results) |
83 : Event(eventName, /*canBubble=*/false, /*cancelable=*/false) | 83 : Event(eventName, /*canBubble=*/false, /*cancelable=*/false) |
84 , m_resultIndex(resultIndex) | 84 , m_resultIndex(resultIndex) |
85 , m_results(results) | 85 , m_results(results) |
86 { | 86 { |
87 ScriptWrappable::init(this); | 87 ScriptWrappable::init(this); |
88 } | 88 } |
89 | 89 |
90 SpeechRecognitionEvent::~SpeechRecognitionEvent() | 90 SpeechRecognitionEvent::~SpeechRecognitionEvent() |
91 { | 91 { |
92 ScriptWrappable::init(this); | |
93 } | 92 } |
94 | 93 |
95 void SpeechRecognitionEvent::trace(Visitor* visitor) | 94 void SpeechRecognitionEvent::trace(Visitor* visitor) |
96 { | 95 { |
97 visitor->trace(m_results); | 96 visitor->trace(m_results); |
98 Event::trace(visitor); | 97 Event::trace(visitor); |
99 } | 98 } |
100 | 99 |
101 } // namespace WebCore | 100 } // namespace WebCore |
OLD | NEW |