WebKit Bugzilla
Attachment 373396 Details for
Bug 199435
: AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch (text/plain), 5.42 KB, created by
chris fleizach
on 2019-07-03 10:06:38 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
chris fleizach
Created:
2019-07-03 10:06:38 PDT
Size:
5.42 KB
patch
obsolete
>diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4c9425a61dc..7ebbad52fce 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,22 @@ >+2019-07-03 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak >+ https://bugs.webkit.org/show_bug.cgi?id=199435 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Ensure we don't access null observers in speech callbacks. >+ >+ * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp: >+ (WebKit::WebSpeechSynthesisClient::voiceList): >+ (WebKit::WebSpeechSynthesisClient::speak): >+ (WebKit::WebSpeechSynthesisClient::pause): >+ (WebKit::WebSpeechSynthesisClient::resume): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::speakingErrorOccurred): >+ (WebKit::WebPage::boundaryEventOccurred): >+ (WebKit::WebPage::voicesDidChange): >+ > 2019-07-02 Joonghun Park <jh718.park@samsung.com> > > Unreviewed. Fix build break introduced in r247058. >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp >index dbbe843312f..4fba162c637 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp >@@ -43,18 +43,18 @@ const Vector<RefPtr<WebCore::PlatformSpeechSynthesisVoice>>& WebSpeechSynthesisC > m_page.sendSync(Messages::WebPageProxy::SpeechSynthesisVoiceList(), voiceList); > > m_voices.clear(); >- for (auto& voice : voiceList) { >+ for (auto& voice : voiceList) > m_voices.append(WebCore::PlatformSpeechSynthesisVoice::create(voice.voiceURI, voice.name, voice.lang, voice.localService, voice.defaultLang)); >- >- } > return m_voices; > } > > void WebSpeechSynthesisClient::speak(RefPtr<WebCore::PlatformSpeechSynthesisUtterance> utterance) > { > WTF::CompletionHandler<void()> completionHandler = [this, weakThis = makeWeakPtr(*this)]() mutable { >- if (weakThis) >- m_page.corePage()->speechSynthesisClient()->observer()->didFinishSpeaking(); >+ if (!weakThis) >+ return; >+ if (auto observer = m_page.corePage()->speechSynthesisClient()->observer()) >+ observer->didFinishSpeaking(); > }; > > auto voice = utterance->voice(); >@@ -65,8 +65,8 @@ void WebSpeechSynthesisClient::speak(RefPtr<WebCore::PlatformSpeechSynthesisUtte > 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(); >+ if (auto observer = m_page.corePage()->speechSynthesisClient()->observer()) >+ observer->didStartSpeaking(); > } > > void WebSpeechSynthesisClient::cancel() >@@ -77,8 +77,10 @@ void WebSpeechSynthesisClient::cancel() > void WebSpeechSynthesisClient::pause() > { > WTF::CompletionHandler<void()> completionHandler = [this, weakThis = makeWeakPtr(*this)]() mutable { >- if (weakThis) >- m_page.corePage()->speechSynthesisClient()->observer()->didPauseSpeaking(); >+ if (!weakThis) >+ return; >+ if (auto observer = m_page.corePage()->speechSynthesisClient()->observer()) >+ observer->didPauseSpeaking(); > }; > > m_page.sendWithAsyncReply(Messages::WebPageProxy::SpeechSynthesisPause(), WTFMove(completionHandler)); >@@ -87,8 +89,10 @@ void WebSpeechSynthesisClient::pause() > void WebSpeechSynthesisClient::resume() > { > WTF::CompletionHandler<void()> completionHandler = [this, weakThis = makeWeakPtr(*this)]() mutable { >- if (weakThis) >- m_page.corePage()->speechSynthesisClient()->observer()->didResumeSpeaking(); >+ if (!weakThis) >+ return; >+ if (auto observer = m_page.corePage()->speechSynthesisClient()->observer()) >+ observer->didResumeSpeaking(); > }; > > m_page.sendWithAsyncReply(Messages::WebPageProxy::SpeechSynthesisResume(), WTFMove(completionHandler)); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 3bcf0d785ff..c85ca604efb 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -6579,17 +6579,20 @@ void WebPage::simulateDeviceOrientationChange(double alpha, double beta, double > #if ENABLE(SPEECH_SYNTHESIS) > void WebPage::speakingErrorOccurred() > { >- corePage()->speechSynthesisClient()->observer()->speakingErrorOccurred(); >+ if (auto observer = corePage()->speechSynthesisClient()->observer()) >+ observer->speakingErrorOccurred(); > } > > void WebPage::boundaryEventOccurred(bool wordBoundary, unsigned charIndex) > { >- corePage()->speechSynthesisClient()->observer()->boundaryEventOccurred(wordBoundary, charIndex); >+ if (auto observer = corePage()->speechSynthesisClient()->observer()) >+ observer->boundaryEventOccurred(wordBoundary, charIndex); > } > > void WebPage::voicesDidChange() > { >- corePage()->speechSynthesisClient()->observer()->voicesChanged(); >+ if (auto observer = corePage()->speechSynthesisClient()->observer()) >+ observer->voicesChanged(); > } > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rniwa
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199435
:
373396
|
373557