Implement Web Speech Synthesis for Chromium
https://bugs.webkit.org/show_bug.cgi?id=111695

Reviewed by Adam Barth.

Source/Platform:

Exposes a platform API that the embedder can implement to
provide speech synthesis for the Chromium port.

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::speechSynthesizer):
* chromium/public/WebSpeechSynthesisUtterance.h: Added.
(WebKit):
(WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::~WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::operator=):
(WebKit::WebSpeechSynthesisUtterance::isNull):
* chromium/public/WebSpeechSynthesisVoice.h: Added.
(WebCore):
(WebKit):
(WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::~WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::operator=):
* chromium/public/WebSpeechSynthesizer.h: Added.
(WebKit):
(WebSpeechSynthesizer):
(WebKit::WebSpeechSynthesizer::~WebSpeechSynthesizer):
* chromium/public/WebSpeechSynthesizerClient.h: Added.
(WebKit):
(WebSpeechSynthesizerClient):
(WebKit::WebSpeechSynthesizerClient::~WebSpeechSynthesizerClient):

Source/WebCore:

Straightforward implementation of speech synthesis
for Chromium by exposing interfaces for the platform
to implement.

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::boundaryEventOccurred):
(WebCore::SpeechSynthesis::didStartSpeaking):
(WebCore::SpeechSynthesis::didPauseSpeaking):
(WebCore::SpeechSynthesis::didResumeSpeaking):
(WebCore::SpeechSynthesis::didFinishSpeaking):
(WebCore::SpeechSynthesis::speakingErrorOccurred):
(WebCore):
* Modules/speech/SpeechSynthesis.h:
(SpeechSynthesis):
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
(WebCore):
(WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance):
(WebCore::SpeechSynthesisUtterance::setVoice):
* Modules/speech/SpeechSynthesisUtterance.h:
(SpeechSynthesisUtterance):
(WebCore::SpeechSynthesisUtterance::text):
(WebCore::SpeechSynthesisUtterance::setText):
(WebCore::SpeechSynthesisUtterance::lang):
(WebCore::SpeechSynthesisUtterance::setLang):
(WebCore::SpeechSynthesisUtterance::volume):
(WebCore::SpeechSynthesisUtterance::setVolume):
(WebCore::SpeechSynthesisUtterance::rate):
(WebCore::SpeechSynthesisUtterance::setRate):
(WebCore::SpeechSynthesisUtterance::pitch):
(WebCore::SpeechSynthesisUtterance::setPitch):
(WebCore::SpeechSynthesisUtterance::startTime):
(WebCore::SpeechSynthesisUtterance::setStartTime):
(WebCore::SpeechSynthesisUtterance::platformUtterance):
* Modules/speech/SpeechSynthesisVoice.h:
(WebCore::SpeechSynthesisVoice::~SpeechSynthesisVoice):
* WebCore.exp.in:
* WebCore.gypi:
* platform/PlatformSpeechSynthesis.h:
(PlatformSpeechSynthesis):
* platform/PlatformSpeechSynthesisUtterance.cpp:
(WebCore):
(WebCore::PlatformSpeechSynthesisUtterance::create):
* platform/PlatformSpeechSynthesisUtterance.h:
(PlatformSpeechSynthesisUtterance):
(WebCore::PlatformSpeechSynthesisUtterance::setClient):
* platform/PlatformSpeechSynthesisVoice.cpp:
(WebCore):
(WebCore::PlatformSpeechSynthesisVoice::create):
(WebCore::PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice):
* platform/PlatformSpeechSynthesisVoice.h:
(PlatformSpeechSynthesisVoice):
(WebCore::PlatformSpeechSynthesisVoice::setVoiceURI):
(WebCore::PlatformSpeechSynthesisVoice::setName):
(WebCore::PlatformSpeechSynthesisVoice::setLang):
(WebCore::PlatformSpeechSynthesisVoice::setLocalService):
(WebCore::PlatformSpeechSynthesisVoice::setIsDefault):
* platform/PlatformSpeechSynthesizer.cpp:
(WebCore::PlatformSpeechSynthesizer::create):
(WebCore::PlatformSpeechSynthesizer::setVoiceList):
(WebCore):
* platform/PlatformSpeechSynthesizer.h:
(WebKit):
(PlatformSpeechSynthesizerClient):
(PlatformSpeechSynthesizer):
* platform/chromium/PlatformSpeechSynthesizerChromium.cpp: Added.
(WebCore):
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
(WebCore::PlatformSpeechSynthesizer::speak):
(WebCore::PlatformSpeechSynthesizer::pause):
(WebCore::PlatformSpeechSynthesizer::resume):
(WebCore::PlatformSpeechSynthesizer::cancel):
* platform/chromium/support/WebSpeechSynthesisUtterance.cpp: Added.
(WebKit):
(WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::operator=):
(WebKit::WebSpeechSynthesisUtterance::assign):
(WebKit::WebSpeechSynthesisUtterance::reset):
(WebKit::WebSpeechSynthesisUtterance::operator PassRefPtr<PlatformSpeechSynthesisUtterance>):
(WebKit::WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*):
(WebKit::WebSpeechSynthesisUtterance::text):
(WebKit::WebSpeechSynthesisUtterance::lang):
(WebKit::WebSpeechSynthesisUtterance::voice):
(WebKit::WebSpeechSynthesisUtterance::volume):
(WebKit::WebSpeechSynthesisUtterance::rate):
(WebKit::WebSpeechSynthesisUtterance::pitch):
(WebKit::WebSpeechSynthesisUtterance::startTime):
* platform/chromium/support/WebSpeechSynthesisVoice.cpp: Added.
(WebKit):
(WebKit::WebSpeechSynthesisVoice::assign):
(WebKit::WebSpeechSynthesisVoice::reset):
(WebKit::WebSpeechSynthesisVoice::setVoiceURI):
(WebKit::WebSpeechSynthesisVoice::setName):
(WebKit::WebSpeechSynthesisVoice::setLanguage):
(WebKit::WebSpeechSynthesisVoice::setIsLocalService):
(WebKit::WebSpeechSynthesisVoice::setIsDefault):
(WebKit::WebSpeechSynthesisVoice::operator PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>):
* platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp: Added.
(WebCore):
(WebCore::WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl):
(WebCore::WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl):
(WebCore::WebSpeechSynthesizerClientImpl::setVoiceList):
(WebCore::WebSpeechSynthesizerClientImpl::didStartSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::didFinishSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::didPauseSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::didResumeSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::speakingErrorOccurred):
(WebCore::WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred):
(WebCore::WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred):
* platform/chromium/support/WebSpeechSynthesizerClientImpl.h: Added.
(WebCore):
(WebSpeechSynthesizerClientImpl):
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
(WebCore):
(WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::speak):
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock):
(WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
(WebCore::PlatformSpeechSynthesizerMock::speak):
* platform/mock/PlatformSpeechSynthesizerMock.h:
(PlatformSpeechSynthesizerMock):


git-svn-id: https://svn.webkit.org/repository/webkit/trunk/Source/Platform/chromium/public@146724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
5 files changed
tree: 70c70f61c788d4a5439491ab4b17d90e126616b6
  1. android/
  2. default/
  3. linux/
  4. mac/
  5. win/
  6. Platform.h
  7. WebAnimation.h
  8. WebAnimationCurve.h
  9. WebAnimationDelegate.h
  10. WebAudioBus.h
  11. WebAudioDestinationConsumer.h
  12. WebAudioDevice.h
  13. WebBlobData.h
  14. WebBlobRegistry.h
  15. WebCanvas.h
  16. WebClipboard.h
  17. WebColor.h
  18. WebCommon.h
  19. WebCompositorOutputSurface.h
  20. WebCompositorSupport.h
  21. WebContentLayer.h
  22. WebContentLayerClient.h
  23. WebCookie.h
  24. WebCookieJar.h
  25. WebCString.h
  26. WebData.h
  27. WebDiscardableMemory.h
  28. WebDragData.h
  29. WebExternalTextureLayer.h
  30. WebExternalTextureLayerClient.h
  31. WebFileError.h
  32. WebFileInfo.h
  33. WebFileSystem.h
  34. WebFileSystemCallbacks.h
  35. WebFileSystemEntry.h
  36. WebFileSystemType.h
  37. WebFileUtilities.h
  38. WebFilterOperation.h
  39. WebFilterOperations.h
  40. WebFlingAnimator.h
  41. WebFloatAnimationCurve.h
  42. WebFloatKeyframe.h
  43. WebFloatPoint.h
  44. WebFloatQuad.h
  45. WebFloatRect.h
  46. WebFloatSize.h
  47. WebGamepad.h
  48. WebGamepads.h
  49. WebGestureCurve.h
  50. WebGestureCurveTarget.h
  51. WebGraphicsContext3D.h
  52. WebGraphicsMemoryAllocation.h
  53. WebGraphicsMemoryStats.h
  54. WebHTTPBody.h
  55. WebHTTPHeaderVisitor.h
  56. WebHTTPLoadInfo.h
  57. WebHyphenator.h
  58. WebImage.h
  59. WebImageLayer.h
  60. WebInputHandler.h
  61. WebInputHandlerClient.h
  62. WebLayer.h
  63. WebLayerScrollClient.h
  64. WebLayerTreeView.h
  65. WebLocalizedString.h
  66. WebMediaConstraints.h
  67. WebMediaStream.h
  68. WebMediaStreamCenter.h
  69. WebMediaStreamCenterClient.h
  70. WebMediaStreamSource.h
  71. WebMediaStreamSourcesRequest.h
  72. WebMediaStreamTrack.h
  73. WebMessagePortChannel.h
  74. WebMessagePortChannelClient.h
  75. WebMimeRegistry.h
  76. WebNonCopyable.h
  77. WebPluginListBuilder.h
  78. WebPoint.h
  79. WebPrerender.h
  80. WebPrerenderingSupport.h
  81. WebPrivateOwnPtr.h
  82. WebPrivatePtr.h
  83. WebRect.h
  84. WebReferrerPolicy.h
  85. WebRenderingStats.h
  86. WebRTCConfiguration.h
  87. WebRTCDataChannelHandler.h
  88. WebRTCDataChannelHandlerClient.h
  89. WebRTCDTMFSenderHandler.h
  90. WebRTCDTMFSenderHandlerClient.h
  91. WebRTCICECandidate.h
  92. WebRTCPeerConnectionHandler.h
  93. WebRTCPeerConnectionHandlerClient.h
  94. WebRTCSessionDescription.h
  95. WebRTCSessionDescriptionRequest.h
  96. WebRTCStatsRequest.h
  97. WebRTCStatsResponse.h
  98. WebRTCVoidRequest.h
  99. WebScreenInfo.h
  100. WebScrollbar.h
  101. WebScrollbarLayer.h
  102. WebScrollbarThemeGeometry.h
  103. WebScrollbarThemePainter.h
  104. WebSize.h
  105. WebSocketStreamError.h
  106. WebSocketStreamHandle.h
  107. WebSocketStreamHandleClient.h
  108. WebSolidColorLayer.h
  109. WebSpeechSynthesisUtterance.h
  110. WebSpeechSynthesisVoice.h
  111. WebSpeechSynthesizer.h
  112. WebSpeechSynthesizerClient.h
  113. WebStorageArea.h
  114. WebStorageNamespace.h
  115. WebString.h
  116. WebThread.h
  117. WebThreadSafeData.h
  118. WebTransformAnimationCurve.h
  119. WebTransformKeyframe.h
  120. WebTransformOperations.h
  121. WebUnitTestSupport.h
  122. WebURL.h
  123. WebURLError.h
  124. WebURLLoader.h
  125. WebURLLoaderClient.h
  126. WebURLLoadTiming.h
  127. WebURLRequest.h
  128. WebURLResponse.h
  129. WebVector.h
  130. WebVideoFrame.h
  131. WebVideoFrameProvider.h
  132. WebVideoLayer.h
  133. WebWorkerRunLoop.h