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

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

Issue 2583093002: Reduce SuspendableObjects (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
Index: third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp
index 1eeb4b012b6933e1ef51715bdbac83176bc3a5cb..65bc3e0b14ceb19c51e383c50848ad8f5bdd6290 100644
--- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp
+++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp
@@ -40,10 +40,7 @@ SpeechRecognition* SpeechRecognition::create(ExecutionContext* context) {
ASSERT(context && context->isDocument());
Document* document = toDocument(context);
ASSERT(document);
- SpeechRecognition* speechRecognition =
- new SpeechRecognition(document->page(), context);
- speechRecognition->suspendIfNeeded();
- return speechRecognition;
+ return new SpeechRecognition(document->page(), context);
}
void SpeechRecognition::start(ExceptionState& exceptionState) {
@@ -148,7 +145,7 @@ const AtomicString& SpeechRecognition::interfaceName() const {
}
ExecutionContext* SpeechRecognition::getExecutionContext() const {
- return SuspendableObject::getExecutionContext();
+ return ContextLifecycleObserver::getExecutionContext();
}
void SpeechRecognition::contextDestroyed() {
@@ -162,7 +159,7 @@ bool SpeechRecognition::hasPendingActivity() const {
}
SpeechRecognition::SpeechRecognition(Page* page, ExecutionContext* context)
- : SuspendableObject(context),
+ : ContextLifecycleObserver(context),
m_grammars(SpeechGrammarList::create()), // FIXME: The spec is not clear
// on the default value for the
// grammars attribute.
@@ -185,7 +182,7 @@ DEFINE_TRACE(SpeechRecognition) {
visitor->trace(m_controller);
visitor->trace(m_finalResults);
EventTargetWithInlineData::trace(visitor);
- SuspendableObject::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698