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

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

Issue 2554303002: Remove ContextLifecycleObserver from SpeechSynthesis (Closed)
Patch Set: Created 4 years 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 | « third_party/WebKit/Source/modules/speech/SpeechSynthesis.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
index de3c677ff9cf949d97c75f07519ccd4e7b1bbe88..89d723d55a70d8b1337e911544bfa814e2acb5b9 100644
--- a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
+++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp
@@ -37,7 +37,7 @@ SpeechSynthesis* SpeechSynthesis::create(ExecutionContext* context) {
}
SpeechSynthesis::SpeechSynthesis(ExecutionContext* context)
- : ContextLifecycleObserver(context),
+ : m_executionContext(context),
m_platformSpeechSynthesizer(PlatformSpeechSynthesizer::create(this)),
m_isPaused(false) {}
@@ -46,13 +46,9 @@ void SpeechSynthesis::setPlatformSynthesizer(
m_platformSpeechSynthesizer = synthesizer;
}
-ExecutionContext* SpeechSynthesis::getExecutionContext() const {
- return ContextLifecycleObserver::getExecutionContext();
-}
-
void SpeechSynthesis::voicesDidChange() {
m_voiceList.clear();
- if (getExecutionContext() && !getExecutionContext()->isContextDestroyed())
+ if (!m_executionContext->isContextDestroyed())
dispatchEvent(Event::create(EventTypeNames::voiceschanged));
}
@@ -130,7 +126,7 @@ void SpeechSynthesis::fireEvent(const AtomicString& type,
SpeechSynthesisUtterance* utterance,
unsigned long charIndex,
const String& name) {
- if (getExecutionContext() && !getExecutionContext()->isContextDestroyed()) {
+ if (!m_executionContext->isContextDestroyed()) {
double elapsedTimeMillis =
(monotonicallyIncreasingTime() - utterance->startTime()) * 1000.0;
utterance->dispatchEvent(SpeechSynthesisEvent::create(
@@ -238,12 +234,12 @@ const AtomicString& SpeechSynthesis::interfaceName() const {
}
DEFINE_TRACE(SpeechSynthesis) {
+ visitor->trace(m_executionContext);
visitor->trace(m_platformSpeechSynthesizer);
visitor->trace(m_voiceList);
visitor->trace(m_utteranceQueue);
PlatformSpeechSynthesizerClient::trace(visitor);
EventTargetWithInlineData::trace(visitor);
- ContextLifecycleObserver::trace(visitor);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/speech/SpeechSynthesis.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698