| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 if (executionContext() && !executionContext()->activeDOMObjectsAreStopped()) | 60 if (executionContext() && !executionContext()->activeDOMObjectsAreStopped()) |
| 61 dispatchEvent(Event::create(EventTypeNames::voiceschanged)); | 61 dispatchEvent(Event::create(EventTypeNames::voiceschanged)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices() | 64 const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices() |
| 65 { | 65 { |
| 66 if (m_voiceList.size()) | 66 if (m_voiceList.size()) |
| 67 return m_voiceList; | 67 return m_voiceList; |
| 68 | 68 |
| 69 // If the voiceList is empty, that's the cue to get the voices from the plat
form again. | 69 // If the voiceList is empty, that's the cue to get the voices from the plat
form again. |
| 70 const HeapVector<Member<PlatformSpeechSynthesisVoice>>& platformVoices = m_p
latformSpeechSynthesizer->voiceList(); | 70 const Vector<RefPtr<PlatformSpeechSynthesisVoice>>& platformVoices = m_platf
ormSpeechSynthesizer->voiceList(); |
| 71 size_t voiceCount = platformVoices.size(); | 71 size_t voiceCount = platformVoices.size(); |
| 72 for (size_t k = 0; k < voiceCount; k++) | 72 for (size_t k = 0; k < voiceCount; k++) |
| 73 m_voiceList.append(SpeechSynthesisVoice::create(platformVoices[k])); | 73 m_voiceList.append(SpeechSynthesisVoice::create(platformVoices[k])); |
| 74 | 74 |
| 75 return m_voiceList; | 75 return m_voiceList; |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool SpeechSynthesis::speaking() const | 78 bool SpeechSynthesis::speaking() const |
| 79 { | 79 { |
| 80 // If we have a current speech utterance, then that means we're assumed to b
e in a speaking state. | 80 // If we have a current speech utterance, then that means we're assumed to b
e in a speaking state. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 { | 232 { |
| 233 visitor->trace(m_platformSpeechSynthesizer); | 233 visitor->trace(m_platformSpeechSynthesizer); |
| 234 visitor->trace(m_voiceList); | 234 visitor->trace(m_voiceList); |
| 235 visitor->trace(m_utteranceQueue); | 235 visitor->trace(m_utteranceQueue); |
| 236 PlatformSpeechSynthesizerClient::trace(visitor); | 236 PlatformSpeechSynthesizerClient::trace(visitor); |
| 237 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechSynthesis>::trace(
visitor); | 237 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechSynthesis>::trace(
visitor); |
| 238 ContextLifecycleObserver::trace(visitor); | 238 ContextLifecycleObserver::trace(visitor); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace blink | 241 } // namespace blink |
| OLD | NEW |