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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void SpeechRecognition::didEndSound() | 99 void SpeechRecognition::didEndSound() |
100 { | 100 { |
101 dispatchEvent(Event::create(EventTypeNames::soundend)); | 101 dispatchEvent(Event::create(EventTypeNames::soundend)); |
102 } | 102 } |
103 | 103 |
104 void SpeechRecognition::didEndAudio() | 104 void SpeechRecognition::didEndAudio() |
105 { | 105 { |
106 dispatchEvent(Event::create(EventTypeNames::audioend)); | 106 dispatchEvent(Event::create(EventTypeNames::audioend)); |
107 } | 107 } |
108 | 108 |
109 void SpeechRecognition::didReceiveResults(const HeapVector<Member<SpeechRecognit
ionResult> >& newFinalResults, const HeapVector<Member<SpeechRecognitionResult>
>& currentInterimResults) | 109 void SpeechRecognition::didReceiveResults(const HeapVector<Member<SpeechRecognit
ionResult>>& newFinalResults, const HeapVector<Member<SpeechRecognitionResult>>&
currentInterimResults) |
110 { | 110 { |
111 size_t resultIndex = m_finalResults.size(); | 111 size_t resultIndex = m_finalResults.size(); |
112 | 112 |
113 for (size_t i = 0; i < newFinalResults.size(); ++i) | 113 for (size_t i = 0; i < newFinalResults.size(); ++i) |
114 m_finalResults.append(newFinalResults[i]); | 114 m_finalResults.append(newFinalResults[i]); |
115 | 115 |
116 HeapVector<Member<SpeechRecognitionResult> > results = m_finalResults; | 116 HeapVector<Member<SpeechRecognitionResult>> results = m_finalResults; |
117 for (size_t i = 0; i < currentInterimResults.size(); ++i) | 117 for (size_t i = 0; i < currentInterimResults.size(); ++i) |
118 results.append(currentInterimResults[i]); | 118 results.append(currentInterimResults[i]); |
119 | 119 |
120 dispatchEvent(SpeechRecognitionEvent::createResult(resultIndex, results)); | 120 dispatchEvent(SpeechRecognitionEvent::createResult(resultIndex, results)); |
121 } | 121 } |
122 | 122 |
123 void SpeechRecognition::didReceiveNoMatch(SpeechRecognitionResult* result) | 123 void SpeechRecognition::didReceiveNoMatch(SpeechRecognitionResult* result) |
124 { | 124 { |
125 dispatchEvent(SpeechRecognitionEvent::createNoMatch(result)); | 125 dispatchEvent(SpeechRecognitionEvent::createNoMatch(result)); |
126 } | 126 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 visitor->trace(m_audioTrack); | 199 visitor->trace(m_audioTrack); |
200 #if ENABLE(OILPAN) | 200 #if ENABLE(OILPAN) |
201 visitor->trace(m_controller); | 201 visitor->trace(m_controller); |
202 #endif | 202 #endif |
203 visitor->trace(m_finalResults); | 203 visitor->trace(m_finalResults); |
204 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechRecognition>::trac
e(visitor); | 204 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechRecognition>::trac
e(visitor); |
205 ActiveDOMObject::trace(visitor); | 205 ActiveDOMObject::trace(visitor); |
206 } | 206 } |
207 | 207 |
208 } // namespace blink | 208 } // namespace blink |
OLD | NEW |