Title: [247859] branches/safari-608.1-branch/Source
Revision
247859
Author
[email protected]
Date
2019-07-26 00:24:41 -0700 (Fri, 26 Jul 2019)

Log Message

Cherry-pick r247755. rdar://problem/53575424

    AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
    https://bugs.webkit.org/show_bug.cgi?id=199988

    Reviewed by Per Arne Vollan.

    Source/WebCore:

    Implement the reset state to cancel current speech jobs.

    * Modules/speech/SpeechSynthesis.cpp:
    (WebCore::SpeechSynthesis::startSpeakingImmediately):
    (WebCore::SpeechSynthesis::cancel):
    * platform/PlatformSpeechSynthesizer.h:
    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
    (WebCore::PlatformSpeechSynthesizer::resetState):
    * platform/mac/PlatformSpeechSynthesizerMac.mm:
    (WebCore::PlatformSpeechSynthesizer::resetState):

    Source/WebKit:

    Improvements to WebSpeechSynthesis to avoid crashing and improve correctness.
    - Reset and cancel speech jobs on page close or reload (otherwise the synthesizer keeps talking after your page is gone)
    - Have a separate speech finish callback mechanism, use the start speaking callback when the synthesizer tells us.
    - Move an assert on utterance state to only apply when we use the in process synthesizer.

    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
    (WebKit::WebPageProxy::didStartSpeaking):
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::reload):
    (WebKit::WebPageProxy::resetState):
    (WebKit::WebPageProxy::resetSpeechSynthesizer):
    (WebKit::WebPageProxy::speechSynthesisSetFinishedCallback):
    (WebKit::WebPageProxy::speechSynthesisSpeak):
    * UIProcess/WebPageProxy.h:
    * UIProcess/WebPageProxy.messages.in:
    * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
    (WebKit::WebSpeechSynthesisClient::speak):

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

Modified Paths

Diff

Modified: branches/safari-608.1-branch/Source/WebCore/ChangeLog (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-07-26 07:24:41 UTC (rev 247859)
@@ -1,5 +1,68 @@
 2019-07-26  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r247755. rdar://problem/53575424
+
+    AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
+    https://bugs.webkit.org/show_bug.cgi?id=199988
+    
+    Reviewed by Per Arne Vollan.
+    
+    Source/WebCore:
+    
+    Implement the reset state to cancel current speech jobs.
+    
+    * Modules/speech/SpeechSynthesis.cpp:
+    (WebCore::SpeechSynthesis::startSpeakingImmediately):
+    (WebCore::SpeechSynthesis::cancel):
+    * platform/PlatformSpeechSynthesizer.h:
+    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+    (WebCore::PlatformSpeechSynthesizer::resetState):
+    * platform/mac/PlatformSpeechSynthesizerMac.mm:
+    (WebCore::PlatformSpeechSynthesizer::resetState):
+    
+    Source/WebKit:
+    
+    Improvements to WebSpeechSynthesis to avoid crashing and improve correctness.
+    - Reset and cancel speech jobs on page close or reload (otherwise the synthesizer keeps talking after your page is gone)
+    - Have a separate speech finish callback mechanism, use the start speaking callback when the synthesizer tells us.
+    - Move an assert on utterance state to only apply when we use the in process synthesizer.
+    
+    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+    (WebKit::WebPageProxy::didStartSpeaking):
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::reload):
+    (WebKit::WebPageProxy::resetState):
+    (WebKit::WebPageProxy::resetSpeechSynthesizer):
+    (WebKit::WebPageProxy::speechSynthesisSetFinishedCallback):
+    (WebKit::WebPageProxy::speechSynthesisSpeak):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/WebPageProxy.messages.in:
+    * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
+    (WebKit::WebSpeechSynthesisClient::speak):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-23  Chris Fleizach  <[email protected]>
+
+            AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
+            https://bugs.webkit.org/show_bug.cgi?id=199988
+
+            Reviewed by Per Arne Vollan.
+
+            Implement the reset state to cancel current speech jobs.
+
+            * Modules/speech/SpeechSynthesis.cpp:
+            (WebCore::SpeechSynthesis::startSpeakingImmediately):
+            (WebCore::SpeechSynthesis::cancel):
+            * platform/PlatformSpeechSynthesizer.h:
+            * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+            (WebCore::PlatformSpeechSynthesizer::resetState):
+            * platform/mac/PlatformSpeechSynthesizerMac.mm:
+            (WebCore::PlatformSpeechSynthesizer::resetState):
+
+2019-07-26  Babak Shafiei  <[email protected]>
+
         Cherry-pick r247734. rdar://problem/53575398
 
     Fix crashes in ScrollingStateNode::insertChild()

Modified: branches/safari-608.1-branch/Source/WebCore/Modules/speech/SpeechSynthesis.cpp (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebCore/Modules/speech/SpeechSynthesis.cpp	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebCore/Modules/speech/SpeechSynthesis.cpp	2019-07-26 07:24:41 UTC (rev 247859)
@@ -110,7 +110,6 @@
 
 void SpeechSynthesis::startSpeakingImmediately(SpeechSynthesisUtterance& utterance)
 {
-    ASSERT(!m_currentSpeechUtterance);
     utterance.setStartTime(MonotonicTime::now());
     m_currentSpeechUtterance = &utterance;
     m_isPaused = false;
@@ -152,12 +151,12 @@
     m_utteranceQueue.clear();
     if (m_speechSynthesisClient)
         m_speechSynthesisClient->cancel();
-    else if (m_platformSpeechSynthesizer)
+    else if (m_platformSpeechSynthesizer) {
         m_platformSpeechSynthesizer->cancel();
+        // The platform should have called back immediately and cleared the current utterance.
+        ASSERT(!m_currentSpeechUtterance);
+    }
     current = nullptr;
-
-    // The platform should have called back immediately and cleared the current utterance.
-    ASSERT(!m_currentSpeechUtterance);
 }
 
 void SpeechSynthesis::pause()

Modified: branches/safari-608.1-branch/Source/WebCore/platform/PlatformSpeechSynthesizer.h (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebCore/platform/PlatformSpeechSynthesizer.h	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebCore/platform/PlatformSpeechSynthesizer.h	2019-07-26 07:24:41 UTC (rev 247859)
@@ -73,6 +73,7 @@
     virtual void resume();
     virtual void cancel();
 
+    void resetState();
     PlatformSpeechSynthesizerClient* client() const { return m_speechSynthesizerClient; }
 
 protected:

Modified: branches/safari-608.1-branch/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm	2019-07-26 07:24:41 UTC (rev 247859)
@@ -291,6 +291,11 @@
     [m_platformSpeechWrapper.get() cancel];
 }
 
+void PlatformSpeechSynthesizer::resetState()
+{
+    [m_platformSpeechWrapper.get() cancel];
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SPEECH_SYNTHESIS) && PLATFORM(IOS_FAMILY)

Modified: branches/safari-608.1-branch/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm	2019-07-26 07:24:41 UTC (rev 247859)
@@ -277,6 +277,11 @@
     [m_platformSpeechWrapper.get() cancel];
 }
 
+void PlatformSpeechSynthesizer::resetState()
+{
+    [m_platformSpeechWrapper.get() cancel];
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SPEECH_SYNTHESIS) && PLATFORM(MAC)

Modified: branches/safari-608.1-branch/Source/WebKit/ChangeLog (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebKit/ChangeLog	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebKit/ChangeLog	2019-07-26 07:24:41 UTC (rev 247859)
@@ -1,3 +1,73 @@
+2019-07-26  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r247755. rdar://problem/53575424
+
+    AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
+    https://bugs.webkit.org/show_bug.cgi?id=199988
+    
+    Reviewed by Per Arne Vollan.
+    
+    Source/WebCore:
+    
+    Implement the reset state to cancel current speech jobs.
+    
+    * Modules/speech/SpeechSynthesis.cpp:
+    (WebCore::SpeechSynthesis::startSpeakingImmediately):
+    (WebCore::SpeechSynthesis::cancel):
+    * platform/PlatformSpeechSynthesizer.h:
+    * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+    (WebCore::PlatformSpeechSynthesizer::resetState):
+    * platform/mac/PlatformSpeechSynthesizerMac.mm:
+    (WebCore::PlatformSpeechSynthesizer::resetState):
+    
+    Source/WebKit:
+    
+    Improvements to WebSpeechSynthesis to avoid crashing and improve correctness.
+    - Reset and cancel speech jobs on page close or reload (otherwise the synthesizer keeps talking after your page is gone)
+    - Have a separate speech finish callback mechanism, use the start speaking callback when the synthesizer tells us.
+    - Move an assert on utterance state to only apply when we use the in process synthesizer.
+    
+    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+    (WebKit::WebPageProxy::didStartSpeaking):
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::reload):
+    (WebKit::WebPageProxy::resetState):
+    (WebKit::WebPageProxy::resetSpeechSynthesizer):
+    (WebKit::WebPageProxy::speechSynthesisSetFinishedCallback):
+    (WebKit::WebPageProxy::speechSynthesisSpeak):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/WebPageProxy.messages.in:
+    * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
+    (WebKit::WebSpeechSynthesisClient::speak):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-23  Chris Fleizach  <[email protected]>
+
+            AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
+            https://bugs.webkit.org/show_bug.cgi?id=199988
+
+            Reviewed by Per Arne Vollan.
+
+            Improvements to WebSpeechSynthesis to avoid crashing and improve correctness.
+            - Reset and cancel speech jobs on page close or reload (otherwise the synthesizer keeps talking after your page is gone)
+            - Have a separate speech finish callback mechanism, use the start speaking callback when the synthesizer tells us.
+            - Move an assert on utterance state to only apply when we use the in process synthesizer.
+
+            * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+            (WebKit::WebPageProxy::didStartSpeaking):
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::reload):
+            (WebKit::WebPageProxy::resetState):
+            (WebKit::WebPageProxy::resetSpeechSynthesizer):
+            (WebKit::WebPageProxy::speechSynthesisSetFinishedCallback):
+            (WebKit::WebPageProxy::speechSynthesisSpeak):
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/WebPageProxy.messages.in:
+            * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
+            (WebKit::WebSpeechSynthesisClient::speak):
+
 2019-07-24  Alan Coon  <[email protected]>
 
         Cherry-pick r247746. rdar://problem/53483298

Modified: branches/safari-608.1-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2019-07-26 07:24:41 UTC (rev 247859)
@@ -258,21 +258,26 @@
 #if ENABLE(SPEECH_SYNTHESIS)
 void WebPageProxy::didStartSpeaking(WebCore::PlatformSpeechSynthesisUtterance&)
 {
+    if (speechSynthesisData().speakingStartedCompletionHandler)
+        speechSynthesisData().speakingStartedCompletionHandler();
 }
 
 void WebPageProxy::didFinishSpeaking(WebCore::PlatformSpeechSynthesisUtterance&)
 {
-    m_speechSynthesisData->speakingFinishedCompletionHandler();
+    if (speechSynthesisData().speakingFinishedCompletionHandler)
+        speechSynthesisData().speakingFinishedCompletionHandler();
 }
 
 void WebPageProxy::didPauseSpeaking(WebCore::PlatformSpeechSynthesisUtterance&)
 {
-    m_speechSynthesisData->speakingPausedCompletionHandler();
+    if (speechSynthesisData().speakingPausedCompletionHandler)
+        speechSynthesisData().speakingPausedCompletionHandler();
 }
 
 void WebPageProxy::didResumeSpeaking(WebCore::PlatformSpeechSynthesisUtterance&)
 {
-    m_speechSynthesisData->speakingResumedCompletionHandler();
+    if (speechSynthesisData().speakingResumedCompletionHandler)
+        speechSynthesisData().speakingResumedCompletionHandler();
 }
 
 void WebPageProxy::speakingErrorOccurred(WebCore::PlatformSpeechSynthesisUtterance&)

Modified: branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.cpp (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-07-26 07:24:41 UTC (rev 247859)
@@ -1359,6 +1359,10 @@
     m_process->send(Messages::WebPage::Reload(navigation->navigationID(), options.toRaw(), sandboxExtensionHandle), m_pageID);
     m_process->responsivenessTimer().start();
 
+#if ENABLE(SPEECH_SYNTHESIS)
+    resetSpeechSynthesizer();
+#endif
+
     return navigation;
 }
 
@@ -7053,6 +7057,10 @@
 #if ENABLE(POINTER_LOCK)
     requestPointerUnlock();
 #endif
+    
+#if ENABLE(SPEECH_SYNTHESIS)
+    resetSpeechSynthesizer();
+#endif
 }
 
 void WebPageProxy::resetStateAfterProcessExited(ProcessTerminationReason terminationReason)
@@ -9121,10 +9129,25 @@
 }
 
 #if ENABLE(SPEECH_SYNTHESIS)
+
+void WebPageProxy::resetSpeechSynthesizer()
+{
+    if (!m_speechSynthesisData)
+        return;
+    
+    auto& synthesisData = speechSynthesisData();
+    synthesisData.speakingFinishedCompletionHandler = nullptr;
+    synthesisData.speakingStartedCompletionHandler = nullptr;
+    synthesisData.speakingPausedCompletionHandler = nullptr;
+    synthesisData.speakingResumedCompletionHandler = nullptr;
+    if (synthesisData.synthesizer)
+        synthesisData.synthesizer->resetState();
+}
+
 WebPageProxy::SpeechSynthesisData& WebPageProxy::speechSynthesisData()
 {
     if (!m_speechSynthesisData)
-        m_speechSynthesisData = SpeechSynthesisData { std::make_unique<PlatformSpeechSynthesizer>(this), nullptr, nullptr, nullptr, nullptr };
+        m_speechSynthesisData = SpeechSynthesisData { std::make_unique<PlatformSpeechSynthesizer>(this), nullptr, nullptr, nullptr, nullptr, nullptr };
     return *m_speechSynthesisData;
 }
 
@@ -9138,6 +9161,11 @@
     completionHandler(WTFMove(result));
 }
 
+void WebPageProxy::speechSynthesisSetFinishedCallback(CompletionHandler<void()>&& completionHandler)
+{
+    speechSynthesisData().speakingFinishedCompletionHandler = WTFMove(completionHandler);
+}
+
 void WebPageProxy::speechSynthesisSpeak(const String& text, const String& lang, float volume, float rate, float pitch, MonotonicTime startTime, const String& voiceURI, const String& voiceName, const String& voiceLang, bool localService, bool defaultVoice, CompletionHandler<void()>&& completionHandler)
 {
     auto voice = WebCore::PlatformSpeechSynthesisVoice::create(voiceURI, voiceName, voiceLang, localService, defaultVoice);
@@ -9149,8 +9177,8 @@
     utterance->setPitch(pitch);
     utterance->setVoice(&voice.get());
 
+    speechSynthesisData().speakingStartedCompletionHandler = WTFMove(completionHandler);
     speechSynthesisData().utterance = WTFMove(utterance);
-    speechSynthesisData().speakingFinishedCompletionHandler = WTFMove(completionHandler);
     speechSynthesisData().synthesizer->speak(m_speechSynthesisData->utterance.get());
 }
 

Modified: branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.h (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.h	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.h	2019-07-26 07:24:41 UTC (rev 247859)
@@ -1533,6 +1533,7 @@
 #if ENABLE(SPEECH_SYNTHESIS)
     void speechSynthesisVoiceList(CompletionHandler<void(Vector<WebSpeechSynthesisVoice>&&)>&&);
     void speechSynthesisSpeak(const String&, const String&, float volume, float rate, float pitch, MonotonicTime startTime, const String& voiceURI, const String& voiceName, const String& voiceLang, bool localService, bool defaultVoice, CompletionHandler<void()>&&);
+    void speechSynthesisSetFinishedCallback(CompletionHandler<void()>&&);
     void speechSynthesisCancel();
     void speechSynthesisPause(CompletionHandler<void()>&&);
     void speechSynthesisResume(CompletionHandler<void()>&&);
@@ -2092,6 +2093,7 @@
 
     struct SpeechSynthesisData;
     SpeechSynthesisData& speechSynthesisData();
+    void resetSpeechSynthesizer();
 #endif
 
 #if PLATFORM(IOS_FAMILY)
@@ -2529,6 +2531,7 @@
     struct SpeechSynthesisData {
         std::unique_ptr<WebCore::PlatformSpeechSynthesizer> synthesizer;
         RefPtr<WebCore::PlatformSpeechSynthesisUtterance> utterance;
+        CompletionHandler<void()> speakingStartedCompletionHandler;
         CompletionHandler<void()> speakingFinishedCompletionHandler;
         CompletionHandler<void()> speakingPausedCompletionHandler;
         CompletionHandler<void()> speakingResumedCompletionHandler;

Modified: branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-07-26 07:24:41 UTC (rev 247859)
@@ -558,6 +558,7 @@
 #if ENABLE(SPEECH_SYNTHESIS)
     SpeechSynthesisVoiceList() -> (Vector<WebKit::WebSpeechSynthesisVoice> voiceList) Synchronous
     SpeechSynthesisSpeak(String text, String lang, float volume, float rate, float pitch, MonotonicTime startTime, String voiceURI, String voiceName, String voiceLang, bool localService, bool defaultVoice) -> () Async
+    SpeechSynthesisSetFinishedCallback() -> () Async
     SpeechSynthesisCancel()
     SpeechSynthesisPause() -> () Async
     SpeechSynthesisResume() -> () Async

Modified: branches/safari-608.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp (247858 => 247859)


--- branches/safari-608.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp	2019-07-26 07:24:37 UTC (rev 247858)
+++ branches/safari-608.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp	2019-07-26 07:24:41 UTC (rev 247859)
@@ -57,10 +57,17 @@
 
 void WebSpeechSynthesisClient::speak(RefPtr<WebCore::PlatformSpeechSynthesisUtterance> utterance)
 {
-    WTF::CompletionHandler<void()> completionHandler = [this, weakThis = makeWeakPtr(*this)]() mutable {
+    WTF::CompletionHandler<void()> startedCompletionHandler = [this, weakThis = makeWeakPtr(*this)]() mutable {
         if (!weakThis)
             return;
         if (auto observer = corePageObserver())
+            observer->didStartSpeaking();
+    };
+
+    WTF::CompletionHandler<void()> finishedCompletionHandler = [this, weakThis = makeWeakPtr(*this)]() mutable {
+        if (!weakThis)
+            return;
+        if (auto observer = corePageObserver())
             observer->didFinishSpeaking();
     };
 
@@ -70,10 +77,9 @@
     auto lang = voice ? voice->lang() : "";
     auto localService = voice ? voice->localService() : false;
     auto isDefault = voice ? voice->isDefault() : false;
-
-    m_page.sendWithAsyncReply(Messages::WebPageProxy::SpeechSynthesisSpeak(utterance->text(), utterance->lang(), utterance->volume(), utterance->rate(), utterance->pitch(), utterance->startTime(), voiceURI, name, lang, localService, isDefault), WTFMove(completionHandler));
-    if (auto observer = corePageObserver())
-        observer->didStartSpeaking();
+    
+    m_page.sendWithAsyncReply(Messages::WebPageProxy::SpeechSynthesisSetFinishedCallback(), WTFMove(finishedCompletionHandler));
+    m_page.sendWithAsyncReply(Messages::WebPageProxy::SpeechSynthesisSpeak(utterance->text(), utterance->lang(), utterance->volume(), utterance->rate(), utterance->pitch(), utterance->startTime(), voiceURI, name, lang, localService, isDefault), WTFMove(startedCompletionHandler));
 }
 
 void WebSpeechSynthesisClient::cancel()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to