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

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

Issue 2618613006: Remove ContextClient from DOMWindowSpeechSynthesis (Closed)
Patch Set: temp Created 3 years, 11 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
Index: third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
diff --git a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
index b992182efeb0d74ce14623d223105ecf823842b5..bdda709174972252e11597094380f97fe18e449e 100644
--- a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
+++ b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
@@ -30,6 +30,7 @@
#include "modules/speech/DOMWindowSpeechSynthesis.h"
+#include "bindings/core/v8/ScriptState.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "wtf/PassRefPtr.h"
@@ -37,7 +38,7 @@
namespace blink {
DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis(LocalDOMWindow& window)
- : ContextClient(window.frame()) {}
+ : Supplement<LocalDOMWindow>(window) {}
const char* DOMWindowSpeechSynthesis::supplementName() {
return "DOMWindowSpeechSynthesis";
@@ -56,22 +57,25 @@ DOMWindowSpeechSynthesis& DOMWindowSpeechSynthesis::from(
}
// static
-SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window) {
+SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(
+ ScriptState* scriptState,
+ DOMWindow& window) {
return DOMWindowSpeechSynthesis::from(toLocalDOMWindow(window))
- .speechSynthesis();
+ .speechSynthesis(scriptState);
}
-SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis() {
- if (!m_speechSynthesis && frame())
+SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(
+ ScriptState* scriptState) {
+ if (!m_speechSynthesis) {
m_speechSynthesis =
- SpeechSynthesis::create(frame()->domWindow()->getExecutionContext());
+ SpeechSynthesis::create(scriptState->getExecutionContext());
+ }
return m_speechSynthesis;
}
DEFINE_TRACE(DOMWindowSpeechSynthesis) {
visitor->trace(m_speechSynthesis);
Supplement<LocalDOMWindow>::trace(visitor);
- ContextClient::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698