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

Unified Diff: Source/modules/speech/SpeechSynthesis.h

Issue 27477002: Add support for onvoiceschanged event. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@platform_speech_chromium
Patch Set: Check activeDOMObjectsAreStopped, address other feedback Created 7 years, 2 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
« no previous file with comments | « Source/modules/speech/DOMWindowSpeechSynthesis.cpp ('k') | Source/modules/speech/SpeechSynthesis.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/speech/SpeechSynthesis.h
diff --git a/Source/modules/speech/SpeechSynthesis.h b/Source/modules/speech/SpeechSynthesis.h
index a51ccd4acc12176a55ba3e89028864e5a9e453a6..35ffba55d69536dfb3fb105b5188e35cf8071391 100644
--- a/Source/modules/speech/SpeechSynthesis.h
+++ b/Source/modules/speech/SpeechSynthesis.h
@@ -27,6 +27,8 @@
#define SpeechSynthesis_h
#include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
#include "core/platform/PlatformSpeechSynthesisUtterance.h"
#include "core/platform/PlatformSpeechSynthesizer.h"
#include "modules/speech/SpeechSynthesisUtterance.h"
@@ -42,9 +44,10 @@ class ExceptionState;
class PlatformSpeechSynthesizerClient;
class SpeechSynthesisVoice;
-class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public ScriptWrappable, public RefCounted<SpeechSynthesis> {
+class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public ScriptWrappable, public RefCounted<SpeechSynthesis>, public ContextLifecycleObserver, public EventTargetWithInlineData {
+ REFCOUNTED_EVENT_TARGET(SpeechSynthesis);
public:
- static PassRefPtr<SpeechSynthesis> create();
+ static PassRefPtr<SpeechSynthesis> create(ExecutionContext*);
bool pending() const;
bool speaking() const;
@@ -60,8 +63,12 @@ public:
// Used in testing to use a mock platform synthesizer
void setPlatformSynthesizer(PassOwnPtr<PlatformSpeechSynthesizer>);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(voiceschanged);
+
+ virtual ExecutionContext* executionContext() const;
+
private:
- SpeechSynthesis();
+ explicit SpeechSynthesis(ExecutionContext*);
// PlatformSpeechSynthesizerClient override methods.
virtual void voicesDidChange() OVERRIDE;
@@ -81,6 +88,9 @@ private:
SpeechSynthesisUtterance* m_currentSpeechUtterance;
Deque<RefPtr<SpeechSynthesisUtterance> > m_utteranceQueue;
bool m_isPaused;
+
+ // EventTarget
+ virtual const AtomicString& interfaceName() const OVERRIDE;
};
} // namespace WebCore
« no previous file with comments | « Source/modules/speech/DOMWindowSpeechSynthesis.cpp ('k') | Source/modules/speech/SpeechSynthesis.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698