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

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

Issue 636863002: Make SpeechRecognitionController per frame instead of per page. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: first of many-ways CL Created 6 years, 1 month 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 | « Source/modules/speech/SpeechRecognitionController.h ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/speech/SpeechRecognitionController.cpp
diff --git a/Source/modules/speech/SpeechRecognitionController.cpp b/Source/modules/speech/SpeechRecognitionController.cpp
index da0b9df469adc681ead27e1d29eeac50a137b43e..7b3946d4635f11a49b5751a0d0d5e2d7ebff9b40 100644
--- a/Source/modules/speech/SpeechRecognitionController.cpp
+++ b/Source/modules/speech/SpeechRecognitionController.cpp
@@ -28,6 +28,17 @@
namespace blink {
+void SpeechRecognitionController::provideTo(LocalFrame& frame, PassOwnPtr<SpeechRecognitionClient> client)
+{
+ SpeechRecognitionController* controller = new SpeechRecognitionController(client);
+ WillBeHeapSupplement<LocalFrame>::provideTo(frame, SpeechRecognitionController::supplementName(), adoptPtrWillBeNoop(controller));
+}
+
+SpeechRecognitionController* SpeechRecognitionController::from(LocalFrame& frame)
+{
+ return static_cast<SpeechRecognitionController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName()));
+}
+
const char* SpeechRecognitionController::supplementName()
{
return "SpeechRecognitionController";
@@ -43,14 +54,9 @@ SpeechRecognitionController::~SpeechRecognitionController()
// FIXME: Call m_client->pageDestroyed(); once we have implemented a client.
}
-PassOwnPtrWillBeRawPtr<SpeechRecognitionController> SpeechRecognitionController::create(PassOwnPtr<SpeechRecognitionClient> client)
-{
- return adoptPtrWillBeNoop(new SpeechRecognitionController(client));
-}
-
-void provideSpeechRecognitionTo(Page& page, PassOwnPtr<SpeechRecognitionClient> client)
+void SpeechRecognitionController::trace(Visitor* visitor)
{
- SpeechRecognitionController::provideTo(page, SpeechRecognitionController::supplementName(), SpeechRecognitionController::create(client));
+ WillBeHeapSupplement<LocalFrame>::trace(visitor);
}
} // namespace blink
« no previous file with comments | « Source/modules/speech/SpeechRecognitionController.h ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698