| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 unsigned long 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 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 visitor->trace(m_grammars); | 198 visitor->trace(m_grammars); |
| 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 EventTargetWithInlineData::trace(visitor); | 204 EventTargetWithInlineData::trace(visitor); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |