Title: [245178] trunk
Revision
245178
Author
[email protected]
Date
2019-05-10 10:19:24 -0700 (Fri, 10 May 2019)

Log Message

AX: Crash at WebKit: WebKit::WebSpeechSynthesisClient::speak
https://bugs.webkit.org/show_bug.cgi?id=197761
<rdar://problem/50237614>

Reviewed by Per Arne Vollan.

Source/WebKit:

It's valid for the incoming voice to be nil, so we need to protect against that.

Tests: fast/speechsynthesis/speech-synthesis-real-client-version.html

* WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
(WebKit::WebSpeechSynthesisClient::speak):

LayoutTests:

* fast/speechsynthesis/speech-synthesis-real-client-version-expected.txt: Added.
* fast/speechsynthesis/speech-synthesis-real-client-version.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (245177 => 245178)


--- trunk/LayoutTests/ChangeLog	2019-05-10 16:56:31 UTC (rev 245177)
+++ trunk/LayoutTests/ChangeLog	2019-05-10 17:19:24 UTC (rev 245178)
@@ -1,3 +1,14 @@
+2019-05-10  Chris Fleizach  <[email protected]>
+
+        AX: Crash at WebKit: WebKit::WebSpeechSynthesisClient::speak
+        https://bugs.webkit.org/show_bug.cgi?id=197761
+        <rdar://problem/50237614>
+
+        Reviewed by Per Arne Vollan.
+
+        * fast/speechsynthesis/speech-synthesis-real-client-version-expected.txt: Added.
+        * fast/speechsynthesis/speech-synthesis-real-client-version.html: Added.
+
 2019-05-10  Antti Koivisto  <[email protected]>
 
         Event region generation needs to know about backing-sharing

Added: trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-real-client-version-expected.txt (0 => 245178)


--- trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-real-client-version-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-real-client-version-expected.txt	2019-05-10 17:19:24 UTC (rev 245178)
@@ -0,0 +1,10 @@
+This tests that we can dispatch a speech job using the real synthesizer without crashing.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS speechSynthesis.speaking is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-real-client-version.html (0 => 245178)


--- trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-real-client-version.html	                        (rev 0)
+++ trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-real-client-version.html	2019-05-10 17:19:24 UTC (rev 245178)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="console"></div>
+
+<script>
+
+    description("This tests that we can dispatch a speech job using the real synthesizer without crashing.");
+
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    window.jsTestIsAsync = true;
+
+    // Start a very short speaking job that will finish quickly.
+    var u = new SpeechSynthesisUtterance("a");
+
+    u.addEventListener('end', function(e) { 
+       finishJSTest();
+    });
+
+    shouldBeFalse("speechSynthesis.speaking");
+    speechSynthesis.speak(u);
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebKit/ChangeLog (245177 => 245178)


--- trunk/Source/WebKit/ChangeLog	2019-05-10 16:56:31 UTC (rev 245177)
+++ trunk/Source/WebKit/ChangeLog	2019-05-10 17:19:24 UTC (rev 245178)
@@ -1,3 +1,18 @@
+2019-05-10  Chris Fleizach  <[email protected]>
+
+        AX: Crash at WebKit: WebKit::WebSpeechSynthesisClient::speak
+        https://bugs.webkit.org/show_bug.cgi?id=197761
+        <rdar://problem/50237614>
+
+        Reviewed by Per Arne Vollan.
+
+        It's valid for the incoming voice to be nil, so we need to protect against that.
+
+        Tests: fast/speechsynthesis/speech-synthesis-real-client-version.html
+
+        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
+        (WebKit::WebSpeechSynthesisClient::speak):
+
 2019-05-10  Michael Catanzaro  <[email protected]>
 
         [WPE][GTK] Add webkit_frame_get_id() API

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp (245177 => 245178)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp	2019-05-10 16:56:31 UTC (rev 245177)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp	2019-05-10 17:19:24 UTC (rev 245178)
@@ -58,8 +58,14 @@
     };
 
     auto voice = utterance->voice();
-    m_page.sendWithAsyncReply(Messages::WebPageProxy::SpeechSynthesisSpeak(utterance->text(), utterance->lang(), utterance->volume(), utterance->rate(), utterance->pitch(), utterance->startTime(), voice->voiceURI(), voice->name(), voice->lang(), voice->localService(), voice->isDefault()), WTFMove(completionHandler));
+    auto voiceURI = voice ? voice->voiceURI() : "";
+    auto name = voice ? voice->name() : "";
+    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));
+
     m_page.corePage()->speechSynthesisClient()->observer()->didStartSpeaking();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to