Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: Source/modules/speech/SpeechSynthesis.cpp

Issue 330603002: Make SpeechSynthesis gracefully handle ExecutionContext-less operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/speech/SpeechSynthesis.cpp
diff --git a/Source/modules/speech/SpeechSynthesis.cpp b/Source/modules/speech/SpeechSynthesis.cpp
index 087691afac0be9f2361a80e216939b0a5c2af092..9ff4ae7bb65d32ec5e94459084e5c16a25bf0309 100644
--- a/Source/modules/speech/SpeechSynthesis.cpp
+++ b/Source/modules/speech/SpeechSynthesis.cpp
@@ -60,7 +60,7 @@ ExecutionContext* SpeechSynthesis::executionContext() const
void SpeechSynthesis::voicesDidChange()
{
m_voiceList.clear();
- if (!executionContext()->activeDOMObjectsAreStopped())
+ if (executionContext() && !executionContext()->activeDOMObjectsAreStopped())
dispatchEvent(Event::create(EventTypeNames::voiceschanged));
}
@@ -145,7 +145,7 @@ void SpeechSynthesis::resume()
void SpeechSynthesis::fireEvent(const AtomicString& type, SpeechSynthesisUtterance* utterance, unsigned long charIndex, const String& name)
{
- if (!executionContext()->activeDOMObjectsAreStopped())
+ if (executionContext() && !executionContext()->activeDOMObjectsAreStopped())
utterance->dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, (currentTime() - utterance->startTime()), name));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698