Index: Source/modules/speech/SpeechRecognitionController.h |
diff --git a/Source/modules/speech/SpeechRecognitionController.h b/Source/modules/speech/SpeechRecognitionController.h |
index 6a5fa1bde2914598430a0d9aefae086e28fd4e74..f45dc85c0a236272544dcf9c2c6911e46a471a69 100644 |
--- a/Source/modules/speech/SpeechRecognitionController.h |
+++ b/Source/modules/speech/SpeechRecognitionController.h |
@@ -27,34 +27,33 @@ |
#define SpeechRecognitionController_h |
#include "core/page/Page.h" |
+#include "core/page/PageLifecycleObserver.h" |
#include "modules/speech/SpeechRecognitionClient.h" |
-#include "wtf/PassOwnPtr.h" |
+#include "platform/Supplementable.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/Forward.h" |
namespace blink { |
class MediaStreamTrack; |
-class SpeechRecognitionController final : public NoBaseWillBeGarbageCollectedFinalized<SpeechRecognitionController>, public WillBeHeapSupplement<Page> { |
+class SpeechRecognitionController final : public NoBaseWillBeGarbageCollectedFinalized<SpeechRecognitionController>, public WillBeHeapSupplement<Page>, public PageLifecycleObserver { |
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognitionController); |
public: |
+ static PassOwnPtrWillBeRawPtr<SpeechRecognitionController> create(Page*, PassOwnPtr<SpeechRecognitionClient>); |
virtual ~SpeechRecognitionController(); |
- void start(SpeechRecognition* recognition, const SpeechGrammarList* grammars, const String& lang, bool continuous, bool interimResults, unsigned long maxAlternatives, MediaStreamTrack* audioTrack) |
- { |
- m_client->start(recognition, grammars, lang, continuous, interimResults, maxAlternatives, audioTrack); |
- } |
+ void start(SpeechRecognition*, const SpeechGrammarList*, const String& lang, bool continuous, bool interimResults, unsigned long maxAlternatives, MediaStreamTrack* audioTrack); |
+ void stop(SpeechRecognition*); |
+ void abort(SpeechRecognition*); |
- void stop(SpeechRecognition* recognition) { m_client->stop(recognition); } |
- void abort(SpeechRecognition* recognition) { m_client->abort(recognition); } |
- |
- static PassOwnPtrWillBeRawPtr<SpeechRecognitionController> create(PassOwnPtr<SpeechRecognitionClient>); |
+ static SpeechRecognitionController* from(Page*); |
static const char* supplementName(); |
- static SpeechRecognitionController* from(Page* page) { return static_cast<SpeechRecognitionController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); } |
- DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<Page>::trace(visitor); } |
+ DECLARE_VIRTUAL_TRACE(); |
private: |
- explicit SpeechRecognitionController(PassOwnPtr<SpeechRecognitionClient>); |
+ SpeechRecognitionController(Page*, PassOwnPtr<SpeechRecognitionClient>); |
OwnPtr<SpeechRecognitionClient> m_client; |
}; |