Bug 707883 - Rename nsIRadio{Interface,Callback} -> nsITelephone{Interface,Callback} since this is not at all generic. r=bent
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 06 Dec 2011 14:35:17 +0800
changeset 82136 40d6fba613a23ad2d91c400a2e9c7e2840fdbd2f
parent 82135 02621ec98be018858880e2c3d14546ed696d51a1
child 82137 052b784ae76bc9c4e95ed018790d415c88f2cb39
push id21582
push userbmo@edmorley.co.uk
push dateWed, 07 Dec 2011 09:30:09 +0000
treeherdermozilla-central@489f2d51b011 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs707883
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 707883 - Rename nsIRadio{Interface,Callback} -> nsITelephone{Interface,Callback} since this is not at all generic. r=bent
dom/system/b2g/RadioManager.cpp
dom/system/b2g/RadioManager.h
dom/telephony/Makefile.in
dom/telephony/Telephony.js
dom/telephony/nsIRadioInterface.idl
dom/telephony/nsITelephone.idl
dom/telephony/nsTelephonyWorker.js
layout/build/nsLayoutModule.cpp
--- a/dom/system/b2g/RadioManager.cpp
+++ b/dom/system/b2g/RadioManager.cpp
@@ -259,29 +259,29 @@ RadioManager::Init()
   if (!wctd->PostTask(connection)) {
     return NS_ERROR_UNEXPECTED;
   }
 
   // Now that we're set up, connect ourselves to the RIL thread.
   mozilla::RefPtr<RILReceiver> receiver = new RILReceiver(wctd);
   StartRil(receiver);
 
-  mRadioInterface = do_QueryInterface(worker);
-  NS_ENSURE_TRUE(mRadioInterface, NS_ERROR_FAILURE);
+  mTelephone = do_QueryInterface(worker);
+  NS_ENSURE_TRUE(mTelephone, NS_ERROR_FAILURE);
 
   return NS_OK;
 }
 
 void
 RadioManager::Shutdown()
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   StopRil();
-  mRadioInterface = nsnull;
+  mTelephone = nsnull;
 
   mShutdown = true;
 }
 
 // static
 already_AddRefed<RadioManager>
 RadioManager::FactoryCreate()
 {
@@ -297,23 +297,23 @@ RadioManager::FactoryCreate()
 
     gInstance = instance;
   }
 
   return instance.forget();
 }
 
 // static
-already_AddRefed<nsIRadioInterface>
-RadioManager::GetRadioInterface()
+already_AddRefed<nsITelephone>
+RadioManager::GetTelephone()
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   if (gInstance) {
-    nsCOMPtr<nsIRadioInterface> retval = gInstance->mRadioInterface;
+    nsCOMPtr<nsITelephone> retval = gInstance->mTelephone;
     return retval.forget();
   }
 
   return nsnull;
 }
 
 
 NS_IMPL_ISUPPORTS1(RadioManager, nsIObserver)
--- a/dom/system/b2g/RadioManager.h
+++ b/dom/system/b2g/RadioManager.h
@@ -43,17 +43,17 @@
 #include "jsapi.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
 #include "nsServiceManagerUtils.h"
 
 #include "nsIObserver.h"
 #include "mozilla/ipc/Ril.h"
-#include "nsIRadioInterface.h"
+#include "nsITelephone.h"
 
 #define TELEPHONYRADIO_CONTRACTID "@mozilla.org/telephony/radio;1"
 #define TELEPHONYRADIOINTERFACE_CONTRACTID "@mozilla.org/telephony/radio-interface;1"
 
 #define BEGIN_TELEPHONY_NAMESPACE \
   namespace mozilla { namespace dom { namespace telephony {
 #define END_TELEPHONY_NAMESPACE \
   } /* namespace telephony */ } /* namespace dom */ } /* namespace mozilla */
@@ -80,22 +80,22 @@ public:
   NS_DECL_NSIOBSERVER
 
   nsresult Init();
   void Shutdown();
 
   static already_AddRefed<RadioManager>
   FactoryCreate();
 
-  static already_AddRefed<nsIRadioInterface>
-  GetRadioInterface();
+  static already_AddRefed<nsITelephone>
+  GetTelephone();
 
 protected:
   RadioManager();
   ~RadioManager();
 
-  nsCOMPtr<nsIRadioInterface> mRadioInterface;
+  nsCOMPtr<nsITelephone> mTelephone;
   bool mShutdown;
 };
 
 END_TELEPHONY_NAMESPACE
 
 #endif // mozilla_dom_telephony_radio_h__
--- a/dom/telephony/Makefile.in
+++ b/dom/telephony/Makefile.in
@@ -48,17 +48,17 @@ XPIDL_MODULE     = dom_telephony
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/dom/dom-config.mk
 
 XPIDLSRCS = \
   mozIDOMTelephony.idl \
   nsITelephonyWorker.idl \
-  nsIRadioInterface.idl \
+  nsITelephone.idl \
   $(NULL)
 
 EXTRA_COMPONENTS = \
   Telephony.manifest \
   Telephony.js \
   nsTelephonyWorker.manifest \
   nsTelephonyWorker.js \
   $(NULL)
--- a/dom/telephony/Telephony.js
+++ b/dom/telephony/Telephony.js
@@ -147,28 +147,28 @@ const DOM_CARDSTATE_UNAVAILABLE    = "un
 const DOM_CARDSTATE_ABSENT         = "absent";
 const DOM_CARDSTATE_PIN_REQUIRED   = "pin_required";
 const DOM_CARDSTATE_PUK_REQUIRED   = "puk_required";
 const DOM_CARDSTATE_NETWORK_LOCKED = "network_locked";
 const DOM_CARDSTATE_NOT_READY      = "not_ready";
 const DOM_CARDSTATE_READY          = "ready";
 
 /**
- * Callback object that Telephony registers with nsIRadioInterface.
+ * Callback object that Telephony registers with nsITelephone.
  * Telephony can't use itself because that might overload event handler
  * attributes ('onfoobar').
  */
 function TelephonyRadioCallback(telephony) {
   this.telephony = telephony;
 }
 TelephonyRadioCallback.prototype = {
 
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIRadioCallback]),
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephoneCallback]),
 
-  // nsIRadioCallback
+  // nsITelephoneCallback
 
   onsignalstrengthchange: function onsignalstrengthchange(signalStrength) {
     this.telephony.signalStrength = signalStrength;
     this.telephony._dispatchEventByType("signalstrengthchange");
   },
 
   onoperatorchange: function onoperatorchange(operator) {
     this.telephony.operator = operator;
@@ -210,17 +210,17 @@ Telephony.prototype = {
                                          Ci.nsIDOMEventTarget,
                                          Ci.nsIDOMGlobalPropertyInitializer]),
 
   // nsIDOMGlobalPropertyInitializer
 
   init: function init(window) {
     this.window = window;
     this.radioInterface = Cc["@mozilla.org/telephony/radio-interface;1"]
-                            .createInstance(Ci.nsIRadioInterface);
+                            .createInstance(Ci.nsITelephone);
     this.radioCallback = new TelephonyRadioCallback(this);
     window.addEventListener("unload", function onunload(event) {
       this.radioInterface.unregisterCallback(this.radioCallback);
       this.radioCallback = null;
       this.window = null;
     }.bind(this));
     this.radioInterface.registerCallback(this.radioCallback);
     this.liveCalls = [];
rename from dom/telephony/nsIRadioInterface.idl
rename to dom/telephony/nsITelephone.idl
--- a/dom/telephony/nsIRadioInterface.idl
+++ b/dom/telephony/nsITelephone.idl
@@ -33,29 +33,29 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 [scriptable, uuid(e21cdf40-c511-442b-8c7d-aa75471b0423)]
-interface nsIRadioCallback : nsISupports {
+interface nsITelephoneCallback : nsISupports {
   void oncallstatechange(in jsval callState);
 
   //XXX philikon's additions
   void onoperatorchange(in jsval operatorInfo);
   void onradiostatechange(in jsval radioState);
   void oncardstatechange(in jsval cardState);
   void onsignalstrengthchange(in jsval signalStrength);
 };
 
 [scriptable, uuid(dda49485-5887-49bb-ba0b-10c5d116eb64)]
-interface nsIRadioInterface : nsISupports {
+interface nsITelephone : nsISupports {
 
   readonly attribute jsval initialState;
 
   void dial(in DOMString number);
   void hangup(in long callIndex);
 
-  void registerCallback(in nsIRadioCallback callback);
-  void unregisterCallback(in nsIRadioCallback callback);
+  void registerCallback(in nsITelephoneCallback callback);
+  void unregisterCallback(in nsITelephoneCallback callback);
 };
--- a/dom/telephony/nsTelephonyWorker.js
+++ b/dom/telephony/nsTelephonyWorker.js
@@ -56,20 +56,20 @@ function nsTelephonyWorker() {
 }
 nsTelephonyWorker.prototype = {
 
   classID:   TELEPHONYWORKER_CID,
   classInfo: XPCOMUtils.generateCI({classID: TELEPHONYWORKER_CID,
                                     contractID: TELEPHONYWORKER_CONTRACTID,
                                     classDescription: "TelephonyWorker",
                                     interfaces: [Ci.nsITelephonyWorker,
-                                                 Ci.nsIRadioInterface]}),
+                                                 Ci.nsITelephone]}),
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyWorker,
-                                         Ci.nsIRadioInterface]),
+                                         Ci.nsITelephone]),
 
   onerror: function onerror(event) {
     // It is very important to call preventDefault on the event here.
     // If an exception is thrown on the worker, it bubbles out to the
     // component that created it. If that component doesn't have an
     // onerror handler, the worker will try to call the error reporter
     // on the context it was created on. However, That doesn't work
     // for component contexts and can result in crashes. This onerror
@@ -113,21 +113,21 @@ nsTelephonyWorker.prototype = {
       let method = callback[methodname];
       if (typeof method != "function") {
         return;
       }
       method.call(callback, value);
     });
   },
 
-  // nsITelephonWorker
+  // nsITelephonyWorker
 
   worker: null,
 
-  // nsIRadioInterface
+  // nsITelephone
 
   initialState: null,
 
   dial: function dial(number) {
     debug("Dialing " + number);
     this.worker.postMessage({type: "dial", number: number});
   },
 
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -319,27 +319,27 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
                                          nsDOMStorageManager::GetInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(IndexedDatabaseManager,
                                          IndexedDatabaseManager::FactoryCreate)
 #ifdef MOZ_B2G_RIL
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(RadioManager, RadioManager::FactoryCreate)
 
 // The 'RadioManager' class controls the lifetime of the nsITelephonyWorker
-// object which is also an nsIRadioInterface, so we don't want to register it
+// object which is also an nsITelephone, so we don't want to register it
 // as a global service on app-startup. Instead, we'll (ab)use createInstance()
 // to always return the one singleton that 'RadioManager' holds on to.
 static nsresult
 RadioInterfaceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
   if (NULL != aOuter) {
     return NS_ERROR_NO_AGGREGATION;
   }
 
-  nsCOMPtr<nsIRadioInterface> inst = RadioManager::GetRadioInterface();
+  nsCOMPtr<nsITelephone> inst = RadioManager::GetTelephone();
   if (NULL == inst) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   *aResult = inst.get();
   inst.forget();
 
   return NS_OK;