Backed out changeset 2b35949ca31c (bug 1080863) for non-unified bustage
authorWes Kocher <wkocher@mozilla.com>
Tue, 14 Oct 2014 17:20:30 -0700
changeset 210477 cf230fd2ae8bfa7681ba28f7afe96d654bd7fb51
parent 210476 3f41967081d5c5121f6a5698d41587e9a82baf21
child 210478 2d1c7353557ea5e3ea888f9eabad4c64a4ff12ad
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1080863
milestone36.0a1
backs out2b35949ca31cb1907c534b5dafb723ecbae3f046
Backed out changeset 2b35949ca31c (bug 1080863) for non-unified bustage
content/media/webspeech/synth/pico/nsPicoService.cpp
content/media/webspeech/synth/pico/nsPicoService.h
--- a/content/media/webspeech/synth/pico/nsPicoService.cpp
+++ b/content/media/webspeech/synth/pico/nsPicoService.cpp
@@ -406,51 +406,52 @@ NS_IMETHODIMP
 PicoCallbackRunnable::OnCancel()
 {
   mService->mCurrentTask = nullptr;
   return NS_OK;
 }
 
 NS_INTERFACE_MAP_BEGIN(nsPicoService)
   NS_INTERFACE_MAP_ENTRY(nsISpeechService)
-  NS_INTERFACE_MAP_ENTRY(nsIObserver)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISpeechService)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(nsPicoService)
 NS_IMPL_RELEASE(nsPicoService)
 
+nsPicoService::nsPicoService()
+  : mInitialized(false)
+  , mVoicesMonitor("nsPicoService::mVoices")
+  , mCurrentTask(nullptr)
+  , mPicoSystem(nullptr)
+  , mPicoEngine(nullptr)
+  , mSgResource(nullptr)
+  , mTaResource(nullptr)
+  , mPicoMemArea(nullptr)
+{
+  DebugOnly<nsresult> rv = NS_NewNamedThread("Pico Worker", getter_AddRefs(mThread));
+  MOZ_ASSERT(NS_SUCCEEDED(rv));
+  rv = mThread->Dispatch(NS_NewRunnableMethod(this, &nsPicoService::Init), NS_DISPATCH_NORMAL);
+  MOZ_ASSERT(NS_SUCCEEDED(rv));
+}
+
 nsPicoService::~nsPicoService()
 {
   // We don't worry about removing the voices because this gets
   // destructed at shutdown along with the voice registry.
   MonitorAutoLock autoLock(mVoicesMonitor);
   mVoices.Clear();
 
   if (mThread) {
     mThread->Shutdown();
   }
 
   UnloadEngine();
 }
 
-// nsIObserver
-
-NS_IMETHODIMP
-nsPicoService::Observe(nsISupports* aSubject, const char* aTopic,
-                       const char16_t* aData)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_TRUE(!strcmp(aTopic, "profile-after-change"), NS_ERROR_UNEXPECTED);
-
-  DebugOnly<nsresult> rv = NS_NewNamedThread("Pico Worker", getter_AddRefs(mThread));
-  MOZ_ASSERT(NS_SUCCEEDED(rv));
-  return mThread->Dispatch(
-    NS_NewRunnableMethod(this, &nsPicoService::Init), NS_DISPATCH_NORMAL);
-}
 // nsISpeechService
 
 NS_IMETHODIMP
 nsPicoService::Speak(const nsAString& aText, const nsAString& aUri,
                      float aRate, float aPitch, nsISpeechTask* aTask)
 {
   NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_AVAILABLE);
 
--- a/content/media/webspeech/synth/pico/nsPicoService.h
+++ b/content/media/webspeech/synth/pico/nsPicoService.h
@@ -5,43 +5,42 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPicoService_h
 #define nsPicoService_h
 
 #include "mozilla/Mutex.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
-#include "nsIObserver.h"
 #include "nsIThread.h"
 #include "nsISpeechService.h"
 #include "nsRefPtrHashtable.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Monitor.h"
 
 namespace mozilla {
 namespace dom {
 
 class PicoVoice;
 class PicoCallbackRunnable;
 
 typedef void* pico_System;
 typedef void* pico_Resource;
 typedef void* pico_Engine;
 
-class nsPicoService : public nsIObserver,
-                      public nsISpeechService
+class nsPicoService : public nsISpeechService
 {
   friend class PicoCallbackRunnable;
   friend class PicoInitRunnable;
 
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISPEECHSERVICE
-  NS_DECL_NSIOBSERVER
+
+  nsPicoService();
 
   static nsPicoService* GetInstance();
 
   static already_AddRefed<nsPicoService> GetInstanceForService();
 
   static void Shutdown();
 
 private:
@@ -78,25 +77,14 @@ private:
 
   pico_Resource mSgResource;
 
   pico_Resource mTaResource;
 
   nsAutoPtr<uint8_t> mPicoMemArea;
 
   static StaticRefPtr<nsPicoService> sSingleton;
+};
 
-protected:
-  nsPicoService() : mInitialized(false)
-                  , mVoicesMonitor("nsPicoService::mVoices")
-                  , mCurrentTask(nullptr)
-                  , mPicoSystem(nullptr)
-                  , mPicoEngine(nullptr)
-                  , mSgResource(nullptr)
-                  , mTaResource(nullptr)
-                  , mPicoMemArea(nullptr)
-  {
-  }
-};
 } // namespace dom
 } // namespace mozilla
 
 #endif