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

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

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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: Source/modules/speech/DOMWindowSpeechSynthesis.cpp
diff --git a/Source/modules/speech/DOMWindowSpeechSynthesis.cpp b/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
index 2e4b06c6cd6a972bd16c4477841d82408de60c0e..b72448e28e2ac201f27a4a87f2ac1e65979eb5af 100644
--- a/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
+++ b/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
@@ -37,8 +37,8 @@
namespace WebCore {
-DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis(DOMWindow* window)
- : DOMWindowProperty(window->frame())
+DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis(DOMWindow& window)
+ : DOMWindowProperty(window.frame())
{
}
@@ -52,20 +52,20 @@ const char* DOMWindowSpeechSynthesis::supplementName()
}
// static
-DOMWindowSpeechSynthesis* DOMWindowSpeechSynthesis::from(DOMWindow* window)
+DOMWindowSpeechSynthesis& DOMWindowSpeechSynthesis::from(DOMWindow& window)
{
DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(Supplement<DOMWindow>::from(window, supplementName()));
if (!supplement) {
supplement = new DOMWindowSpeechSynthesis(window);
provideTo(window, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
// static
-SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow* window)
+SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window)
{
- return DOMWindowSpeechSynthesis::from(window)->speechSynthesis();
+ return DOMWindowSpeechSynthesis::from(window).speechSynthesis();
}
SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis()

Powered by Google App Engine
This is Rietveld 408576698