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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices() { | 55 const HeapVector<Member<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices() { |
56 if (m_voiceList.size()) | 56 if (m_voiceList.size()) |
57 return m_voiceList; | 57 return m_voiceList; |
58 | 58 |
59 // If the voiceList is empty, that's the cue to get the voices from the | 59 // If the voiceList is empty, that's the cue to get the voices from the |
60 // platform again. | 60 // platform again. |
61 const Vector<RefPtr<PlatformSpeechSynthesisVoice>>& platformVoices = | 61 const Vector<RefPtr<PlatformSpeechSynthesisVoice>>& platformVoices = |
62 m_platformSpeechSynthesizer->voiceList(); | 62 m_platformSpeechSynthesizer->voiceList(); |
63 size_t voiceCount = platformVoices.size(); | 63 size_t voiceCount = platformVoices.size(); |
64 for (size_t k = 0; k < voiceCount; k++) | 64 for (size_t k = 0; k < voiceCount; k++) |
65 m_voiceList.append(SpeechSynthesisVoice::create(platformVoices[k])); | 65 m_voiceList.push_back(SpeechSynthesisVoice::create(platformVoices[k])); |
66 | 66 |
67 return m_voiceList; | 67 return m_voiceList; |
68 } | 68 } |
69 | 69 |
70 bool SpeechSynthesis::speaking() const { | 70 bool SpeechSynthesis::speaking() const { |
71 // If we have a current speech utterance, then that means we're assumed to be | 71 // If we have a current speech utterance, then that means we're assumed to be |
72 // in a speaking state. This state is independent of whether the utterance | 72 // in a speaking state. This state is independent of whether the utterance |
73 // happens to be paused. | 73 // happens to be paused. |
74 return currentSpeechUtterance(); | 74 return currentSpeechUtterance(); |
75 } | 75 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 DEFINE_TRACE(SpeechSynthesis) { | 237 DEFINE_TRACE(SpeechSynthesis) { |
238 visitor->trace(m_platformSpeechSynthesizer); | 238 visitor->trace(m_platformSpeechSynthesizer); |
239 visitor->trace(m_voiceList); | 239 visitor->trace(m_voiceList); |
240 visitor->trace(m_utteranceQueue); | 240 visitor->trace(m_utteranceQueue); |
241 PlatformSpeechSynthesizerClient::trace(visitor); | 241 PlatformSpeechSynthesizerClient::trace(visitor); |
242 ContextClient::trace(visitor); | 242 ContextClient::trace(visitor); |
243 EventTargetWithInlineData::trace(visitor); | 243 EventTargetWithInlineData::trace(visitor); |
244 } | 244 } |
245 | 245 |
246 } // namespace blink | 246 } // namespace blink |
OLD | NEW |