| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 void SpeechSynthesis::startSpeakingImmediately(SpeechSynthesisUtterance* utteran
ce) | 101 void SpeechSynthesis::startSpeakingImmediately(SpeechSynthesisUtterance* utteran
ce) |
| 102 { | 102 { |
| 103 ASSERT(!m_currentSpeechUtterance); | 103 ASSERT(!m_currentSpeechUtterance); |
| 104 utterance->setStartTime(monotonicallyIncreasingTime()); | 104 utterance->setStartTime(monotonicallyIncreasingTime()); |
| 105 m_currentSpeechUtterance = utterance; | 105 m_currentSpeechUtterance = utterance; |
| 106 m_isPaused = false; | 106 m_isPaused = false; |
| 107 m_platformSpeechSynthesizer->speak(utterance->platformUtterance()); | 107 m_platformSpeechSynthesizer->speak(utterance->platformUtterance()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void SpeechSynthesis::speak(SpeechSynthesisUtterance* utterance, ExceptionState&
es) | 110 void SpeechSynthesis::speak(SpeechSynthesisUtterance* utterance, ExceptionState&
exceptionState) |
| 111 { | 111 { |
| 112 if (!utterance) { | 112 if (!utterance) { |
| 113 es.throwTypeError("Invalid utterance argument"); | 113 exceptionState.throwTypeError("Invalid utterance argument"); |
| 114 return; | 114 return; |
| 115 } | 115 } |
| 116 | 116 |
| 117 m_utteranceQueue.append(utterance); | 117 m_utteranceQueue.append(utterance); |
| 118 | 118 |
| 119 // If the queue was empty, speak this immediately and add it to the queue. | 119 // If the queue was empty, speak this immediately and add it to the queue. |
| 120 if (m_utteranceQueue.size() == 1) | 120 if (m_utteranceQueue.size() == 1) |
| 121 startSpeakingImmediately(utterance); | 121 startSpeakingImmediately(utterance); |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 if (utterance->client()) | 221 if (utterance->client()) |
| 222 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance
->client()), true); | 222 handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance*>(utterance
->client()), true); |
| 223 } | 223 } |
| 224 | 224 |
| 225 const AtomicString& SpeechSynthesis::interfaceName() const | 225 const AtomicString& SpeechSynthesis::interfaceName() const |
| 226 { | 226 { |
| 227 return EventTargetNames::SpeechSynthesisUtterance; | 227 return EventTargetNames::SpeechSynthesisUtterance; |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace WebCore | 230 } // namespace WebCore |
| OLD | NEW |