Bug 1211974 - Implement nsIObserver in SpeechDispatcherService. r=smaug

This commit is contained in:
Eitan Isaacson 2015-12-23 13:44:11 -08:00
parent f3dd15b3d3
commit f7492b24ab
2 changed files with 17 additions and 2 deletions

View File

@ -277,7 +277,8 @@ speechd_cb(size_t msg_id, size_t client_id, SPDNotificationType state)
NS_INTERFACE_MAP_BEGIN(SpeechDispatcherService)
NS_INTERFACE_MAP_ENTRY(nsISpeechService)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISpeechService)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(SpeechDispatcherService)
@ -449,6 +450,17 @@ SpeechDispatcherService::RegisterVoices()
mInitialized = true;
}
// nsIObserver
NS_IMETHODIMP
SpeechDispatcherService::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData)
{
return NS_OK;
}
// nsISpeechService
// TODO: Support SSML
NS_IMETHODIMP
SpeechDispatcherService::Speak(const nsAString& aText, const nsAString& aUri,

View File

@ -9,6 +9,7 @@
#include "mozilla/StaticPtr.h"
#include "nsAutoPtr.h"
#include "nsIObserver.h"
#include "nsISpeechService.h"
#include "nsIThread.h"
#include "nsRefPtrHashtable.h"
@ -22,11 +23,13 @@ namespace dom {
class SpeechDispatcherCallback;
class SpeechDispatcherVoice;
class SpeechDispatcherService final : public nsISpeechService
class SpeechDispatcherService final : public nsIObserver,
public nsISpeechService
{
friend class SpeechDispatcherCallback;
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_NSISPEECHSERVICE
SpeechDispatcherService();