WebSpeech: Implement basic speaking/finished speaking behavior
https://bugs.webkit.org/show_bug.cgi?id=107135

Reviewed by Sam Weinig.

Source/WebCore: 

Implements the basic functionality of speaking utterances.

In the WebCore side, it manages the speech queue the way the spec defines
(that is, new jobs are appended to a queue and wait for other jobs to finish).

On the Mac side, it instantiates a synthesizer and handles the callbacks for when
jobs are finished. It sends those jobs back to WebCore to dispatch the right events.

Test: platform/mac/fast/speechsynthesis/speech-synthesis-speak.html

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::SpeechSynthesis):
(WebCore::SpeechSynthesis::paused):
(WebCore::SpeechSynthesis::startSpeakingImmediately):
(WebCore::SpeechSynthesis::speak):
(WebCore):
(WebCore::SpeechSynthesis::fireEvent):
(WebCore::SpeechSynthesis::handleSpeakingCompleted):
(WebCore::SpeechSynthesis::didStartSpeaking):
(WebCore::SpeechSynthesis::didFinishSpeaking):
(WebCore::SpeechSynthesis::speakingErrorOccurred):
* Modules/speech/SpeechSynthesis.h:
(WebCore):
(WebCore::SpeechSynthesis::speaking):
(SpeechSynthesis):
* Modules/speech/SpeechSynthesisEvent.cpp:
(WebCore::SpeechSynthesisEvent::create):
(WebCore):
(WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
* Modules/speech/SpeechSynthesisEvent.h:
(SpeechSynthesisEvent):
(WebCore::SpeechSynthesisEvent::interfaceName):
* Modules/speech/SpeechSynthesisUtterance.h:
(WebCore::SpeechSynthesisUtterance::startTime):
(WebCore::SpeechSynthesisUtterance::setStartTime):
(SpeechSynthesisUtterance):
* platform/PlatformSpeechSynthesisUtterance.cpp:
(WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance):
* platform/PlatformSpeechSynthesisUtterance.h:
(PlatformSpeechSynthesisUtterance):
(WebCore::PlatformSpeechSynthesisUtterance::setVolume):
(WebCore::PlatformSpeechSynthesisUtterance::setRate):
(WebCore::PlatformSpeechSynthesisUtterance::setPitch):
(WebCore::PlatformSpeechSynthesisUtterance::startTime):
(WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
(WebCore::PlatformSpeechSynthesisUtterance::client):
* platform/PlatformSpeechSynthesizer.cpp:
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
* platform/PlatformSpeechSynthesizer.h:
(PlatformSpeechSynthesizerClient):
(WebCore::PlatformSpeechSynthesizer::client):
(PlatformSpeechSynthesizer):
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:WebCore::]):
(-[WebSpeechSynthesisWrapper dealloc]):
(-[WebSpeechSynthesisWrapper convertRateToWPM:]):
(-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
(WebCore::PlatformSpeechSynthesizer::speak):

LayoutTests: 

* platform/mac/fast/speechsynthesis/speech-synthesis-speak-expected.txt: Added.
* platform/mac/fast/speechsynthesis/speech-synthesis-speak.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142433 268f45cc-cd09-0410-ab3c-d52691b4dbfc