Bug 833229 - 1/4: rename VoicemailProvider to VoicemailService. r=echen

--HG--
rename : dom/voicemail/nsIVoicemailProvider.idl => dom/voicemail/nsIVoicemailService.idl
This commit is contained in:
Vicamo Yang 2014-09-26 13:00:23 +08:00
parent 5d62e4e622
commit bebe56b456
6 changed files with 27 additions and 27 deletions

View File

@ -309,7 +309,7 @@ RILContentHelper.prototype = {
__proto__: DOMRequestIpcHelper.prototype,
QueryInterface: XPCOMUtils.generateQI([Ci.nsICellBroadcastProvider,
Ci.nsIVoicemailProvider,
Ci.nsIVoicemailService,
Ci.nsIIccProvider,
Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
@ -317,7 +317,7 @@ RILContentHelper.prototype = {
classInfo: XPCOMUtils.generateCI({classID: RILCONTENTHELPER_CID,
classDescription: "RILContentHelper",
interfaces: [Ci.nsICellBroadcastProvider,
Ci.nsIVoicemailProvider,
Ci.nsIVoicemailService,
Ci.nsIIccProvider]}),
updateDebugFlag: function() {

View File

@ -51,22 +51,22 @@ private:
NS_IMPL_ISUPPORTS(Voicemail::Listener, nsIVoicemailListener)
Voicemail::Voicemail(nsPIDOMWindow* aWindow,
nsIVoicemailProvider* aProvider)
nsIVoicemailService* aService)
: DOMEventTargetHelper(aWindow)
, mProvider(aProvider)
, mService(aService)
{
mListener = new Listener(this);
DebugOnly<nsresult> rv = mProvider->RegisterVoicemailMsg(mListener);
DebugOnly<nsresult> rv = mService->RegisterVoicemailMsg(mListener);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed registering voicemail messages with provider");
"Failed registering voicemail messages with service");
}
Voicemail::~Voicemail()
{
MOZ_ASSERT(mProvider && mListener);
MOZ_ASSERT(mService && mListener);
mListener->Disconnect();
mProvider->UnregisterVoicemailMsg(mListener);
mService->UnregisterVoicemailMsg(mListener);
}
NS_IMPL_ISUPPORTS_INHERITED0(Voicemail, DOMEventTargetHelper)
@ -95,7 +95,7 @@ Voicemail::PassedOrDefaultServiceId(const Optional<uint32_t>& aServiceId,
}
aResult = aServiceId.Value();
} else {
mProvider->GetVoicemailDefaultServiceId(&aResult);
mService->GetVoicemailDefaultServiceId(&aResult);
}
return true;
@ -107,7 +107,7 @@ already_AddRefed<MozVoicemailStatus>
Voicemail::GetStatus(const Optional<uint32_t>& aServiceId,
ErrorResult& aRv) const
{
if (!mProvider) {
if (!mService) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
@ -119,7 +119,7 @@ Voicemail::GetStatus(const Optional<uint32_t>& aServiceId,
}
JSContext *cx = nsContentUtils::GetCurrentJSContext();
JS::Rooted<JS::Value> status(cx);
nsresult rv = mProvider->GetVoicemailStatus(id, &status);
nsresult rv = mService->GetVoicemailStatus(id, &status);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return nullptr;
@ -139,7 +139,7 @@ Voicemail::GetNumber(const Optional<uint32_t>& aServiceId, nsString& aNumber,
{
aNumber.SetIsVoid(true);
if (!mProvider) {
if (!mService) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
@ -150,7 +150,7 @@ Voicemail::GetNumber(const Optional<uint32_t>& aServiceId, nsString& aNumber,
return;
}
aRv = mProvider->GetVoicemailNumber(id, aNumber);
aRv = mService->GetVoicemailNumber(id, aNumber);
}
void
@ -159,7 +159,7 @@ Voicemail::GetDisplayName(const Optional<uint32_t>& aServiceId, nsString& aDispl
{
aDisplayName.SetIsVoid(true);
if (!mProvider) {
if (!mService) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
@ -170,7 +170,7 @@ Voicemail::GetDisplayName(const Optional<uint32_t>& aServiceId, nsString& aDispl
return;
}
aRv = mProvider->GetVoicemailDisplayName(id, aDisplayName);
aRv = mService->GetVoicemailDisplayName(id, aDisplayName);
}
// nsIVoicemailListener
@ -199,11 +199,11 @@ NS_NewVoicemail(nsPIDOMWindow* aWindow, Voicemail** aVoicemail)
aWindow :
aWindow->GetCurrentInnerWindow();
nsCOMPtr<nsIVoicemailProvider> provider =
nsCOMPtr<nsIVoicemailService> service =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_STATE(provider);
NS_ENSURE_STATE(service);
nsRefPtr<Voicemail> voicemail = new Voicemail(innerWindow, provider);
nsRefPtr<Voicemail> voicemail = new Voicemail(innerWindow, service);
voicemail.forget(aVoicemail);
return NS_OK;
}

View File

@ -10,7 +10,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/ErrorResult.h"
#include "nsIVoicemailProvider.h"
#include "nsIVoicemailService.h"
class JSObject;
struct JSContext;
@ -28,7 +28,7 @@ class Voicemail MOZ_FINAL : public DOMEventTargetHelper,
/**
* Class Voicemail doesn't actually expose nsIVoicemailListener. Instead, it
* owns an nsIVoicemailListener derived instance mListener and passes it to
* nsIVoicemailProvider. The onreceived events are first delivered to
* nsIVoicemailService. The onreceived events are first delivered to
* mListener and then forwarded to its owner, Voicemail. See also bug 775997
* comment #51.
*/
@ -42,7 +42,7 @@ public:
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailProvider* aProvider);
Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailService* aService);
nsPIDOMWindow*
GetParentObject() const
@ -67,7 +67,7 @@ public:
IMPL_EVENT_HANDLER(statuschanged)
private:
nsCOMPtr<nsIVoicemailProvider> mProvider;
nsCOMPtr<nsIVoicemailService> mService;
nsRefPtr<Listener> mListener;
bool

View File

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [
'nsIVoicemailProvider.idl',
'nsIVoicemailService.idl',
]
XPIDL_MODULE = 'dom_voicemail'

View File

@ -20,8 +20,8 @@ interface nsIVoicemailListener : nsISupports
* XPCOM component (in the content process) that provides the voicemail
* information.
*/
[scriptable, uuid(1bbfff90-88f7-4d73-896e-9620a0000ab0)]
interface nsIVoicemailProvider : nsISupports
[scriptable, uuid(1b42b00b-8f86-4fb5-b936-99e82802340c)]
interface nsIVoicemailService : nsISupports
{
readonly attribute unsigned long voicemailDefaultServiceId;

View File

@ -6,7 +6,7 @@ MARIONETTE_CONTEXT = "chrome";
Cu.import("resource://gre/modules/Promise.jsm");
const VOICEMAIL_PROVIDER_CONTRACTID = "@mozilla.org/ril/content-helper;1";
const VOICEMAIL_SERVICE_CONTRACTID = "@mozilla.org/ril/content-helper;1";
const PREF_RIL_NUM_RADIO_INTERFACES = "ril.numRadioInterfaces";
const PREF_DEFAULT_SERVICE_ID = "dom.voicemail.defaultServiceId";
@ -121,6 +121,6 @@ function verify(contractId, ifaceName, attrName, prefKey, numRil) {
}
getNumRadioInterfaces()
.then(verify.bind(null, VOICEMAIL_PROVIDER_CONTRACTID, "nsIVoicemailProvider",
.then(verify.bind(null, VOICEMAIL_SERVICE_CONTRACTID, "nsIVoicemailService",
"voicemailDefaultServiceId", PREF_DEFAULT_SERVICE_ID))
.then(finish);