Backout c6a0d5f696ec (Bug 818353) due to causing bug 929815.

This commit is contained in:
Dave Hylands 2013-10-22 21:12:04 -07:00
Родитель b28e475dc4
Коммит 5b15ac0bbc
2 изменённых файлов: 24 добавлений и 29 удалений

Просмотреть файл

@ -83,9 +83,6 @@ MobileConnection::MobileConnection()
mProvider = do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
mWindow = nullptr;
// TODO: Bug 814629 - WebMobileConnection API: support multiple sim cards
mClientId = 0;
// Not being able to acquire the provider isn't fatal since we check
// for it explicitly below.
if (!mProvider) {
@ -104,7 +101,7 @@ MobileConnection::Init(nsPIDOMWindow* aWindow)
if (!CheckPermission("mobilenetwork") &&
CheckPermission("mobileconnection")) {
DebugOnly<nsresult> rv = mProvider->RegisterMobileConnectionMsg(mClientId, mListener);
DebugOnly<nsresult> rv = mProvider->RegisterMobileConnectionMsg(mListener);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed registering mobile connection messages with provider");
@ -117,7 +114,7 @@ MobileConnection::Shutdown()
{
if (mProvider && mListener) {
mListener->Disconnect();
mProvider->UnregisterMobileConnectionMsg(mClientId, mListener);
mProvider->UnregisterMobileConnectionMsg(mListener);
mProvider = nullptr;
mListener = nullptr;
}
@ -176,7 +173,7 @@ MobileConnection::GetVoice(nsIDOMMozMobileConnectionInfo** voice)
if (!mProvider || !CheckPermission("mobileconnection")) {
return NS_OK;
}
return mProvider->GetVoiceConnectionInfo(mClientId, voice);
return mProvider->GetVoiceConnectionInfo(voice);
}
NS_IMETHODIMP
@ -187,7 +184,7 @@ MobileConnection::GetData(nsIDOMMozMobileConnectionInfo** data)
if (!mProvider || !CheckPermission("mobileconnection")) {
return NS_OK;
}
return mProvider->GetDataConnectionInfo(mClientId, data);
return mProvider->GetDataConnectionInfo(data);
}
NS_IMETHODIMP
@ -198,7 +195,7 @@ MobileConnection::GetNetworkSelectionMode(nsAString& networkSelectionMode)
if (!mProvider || !CheckPermission("mobileconnection")) {
return NS_OK;
}
return mProvider->GetNetworkSelectionMode(mClientId, networkSelectionMode);
return mProvider->GetNetworkSelectionMode(networkSelectionMode);
}
NS_IMETHODIMP
@ -214,7 +211,7 @@ MobileConnection::GetNetworks(nsIDOMDOMRequest** request)
return NS_ERROR_FAILURE;
}
return mProvider->GetNetworks(mClientId, GetOwner(), request);
return mProvider->GetNetworks(GetOwner(), request);
}
NS_IMETHODIMP
@ -230,7 +227,7 @@ MobileConnection::SelectNetwork(nsIDOMMozMobileNetworkInfo* network, nsIDOMDOMRe
return NS_ERROR_FAILURE;
}
return mProvider->SelectNetwork(mClientId, GetOwner(), network, request);
return mProvider->SelectNetwork(GetOwner(), network, request);
}
NS_IMETHODIMP
@ -246,7 +243,7 @@ MobileConnection::SelectNetworkAutomatically(nsIDOMDOMRequest** request)
return NS_ERROR_FAILURE;
}
return mProvider->SelectNetworkAutomatically(mClientId, GetOwner(), request);
return mProvider->SelectNetworkAutomatically(GetOwner(), request);
}
NS_IMETHODIMP
@ -262,7 +259,7 @@ MobileConnection::SetRoamingPreference(const nsAString& aMode, nsIDOMDOMRequest*
return NS_ERROR_FAILURE;
}
return mProvider->SetRoamingPreference(mClientId, GetOwner(), aMode, aDomRequest);
return mProvider->SetRoamingPreference(GetOwner(), aMode, aDomRequest);
}
NS_IMETHODIMP
@ -278,7 +275,7 @@ MobileConnection::GetRoamingPreference(nsIDOMDOMRequest** aDomRequest)
return NS_ERROR_FAILURE;
}
return mProvider->GetRoamingPreference(mClientId, GetOwner(), aDomRequest);
return mProvider->GetRoamingPreference(GetOwner(), aDomRequest);
}
NS_IMETHODIMP
@ -294,7 +291,7 @@ MobileConnection::SetVoicePrivacyMode(bool aEnabled, nsIDOMDOMRequest** aDomRequ
return NS_ERROR_FAILURE;
}
return mProvider->SetVoicePrivacyMode(mClientId, GetOwner(), aEnabled, aDomRequest);
return mProvider->SetVoicePrivacyMode(GetOwner(), aEnabled, aDomRequest);
}
NS_IMETHODIMP
@ -310,7 +307,7 @@ MobileConnection::GetVoicePrivacyMode(nsIDOMDOMRequest** aDomRequest)
return NS_ERROR_FAILURE;
}
return mProvider->GetVoicePrivacyMode(mClientId, GetOwner(), aDomRequest);
return mProvider->GetVoicePrivacyMode(GetOwner(), aDomRequest);
}
NS_IMETHODIMP
@ -325,7 +322,7 @@ MobileConnection::SendMMI(const nsAString& aMMIString,
return NS_ERROR_FAILURE;
}
return mProvider->SendMMI(mClientId, GetOwner(), aMMIString, aRequest);
return mProvider->SendMMI(GetOwner(), aMMIString, aRequest);
}
NS_IMETHODIMP
@ -339,7 +336,7 @@ MobileConnection::CancelMMI(nsIDOMDOMRequest** aRequest)
return NS_ERROR_FAILURE;
}
return mProvider->CancelMMI(mClientId, GetOwner(),aRequest);
return mProvider->CancelMMI(GetOwner(), aRequest);
}
NS_IMETHODIMP
@ -356,7 +353,7 @@ MobileConnection::GetCallForwardingOption(uint16_t aReason,
return NS_ERROR_FAILURE;
}
return mProvider->GetCallForwardingOption(mClientId, GetOwner(), aReason, aRequest);
return mProvider->GetCallForwardingOption(GetOwner(), aReason, aRequest);
}
NS_IMETHODIMP
@ -373,7 +370,7 @@ MobileConnection::SetCallForwardingOption(nsIDOMMozMobileCFInfo* aCFInfo,
return NS_ERROR_FAILURE;
}
return mProvider->SetCallForwardingOption(mClientId, GetOwner(), aCFInfo, aRequest);
return mProvider->SetCallForwardingOption(GetOwner(), aCFInfo, aRequest);
}
NS_IMETHODIMP
@ -390,7 +387,7 @@ MobileConnection::GetCallBarringOption(const JS::Value& aOption,
return NS_ERROR_FAILURE;
}
return mProvider->GetCallBarringOption(mClientId, GetOwner(), aOption, aRequest);
return mProvider->GetCallBarringOption(GetOwner(), aOption, aRequest);
}
NS_IMETHODIMP
@ -407,7 +404,7 @@ MobileConnection::SetCallBarringOption(const JS::Value& aOption,
return NS_ERROR_FAILURE;
}
return mProvider->SetCallBarringOption(mClientId, GetOwner(), aOption, aRequest);
return mProvider->SetCallBarringOption(GetOwner(), aOption, aRequest);
}
NS_IMETHODIMP
@ -424,7 +421,7 @@ MobileConnection::ChangeCallBarringPassword(const JS::Value& aInfo,
return NS_ERROR_FAILURE;
}
return mProvider->ChangeCallBarringPassword(mClientId, GetOwner(), aInfo, aRequest);
return mProvider->ChangeCallBarringPassword(GetOwner(), aInfo, aRequest);
}
NS_IMETHODIMP
@ -440,7 +437,7 @@ MobileConnection::GetCallWaitingOption(nsIDOMDOMRequest** aRequest)
return NS_ERROR_FAILURE;
}
return mProvider->GetCallWaitingOption(mClientId, GetOwner(), aRequest);
return mProvider->GetCallWaitingOption(GetOwner(), aRequest);
}
NS_IMETHODIMP
@ -457,7 +454,7 @@ MobileConnection::SetCallWaitingOption(bool aEnabled,
return NS_ERROR_FAILURE;
}
return mProvider->SetCallWaitingOption(mClientId, GetOwner(), aEnabled, aRequest);
return mProvider->SetCallWaitingOption(GetOwner(), aEnabled, aRequest);
}
NS_IMETHODIMP
@ -473,7 +470,7 @@ MobileConnection::GetCallingLineIdRestriction(nsIDOMDOMRequest** aRequest)
return NS_ERROR_FAILURE;
}
return mProvider->GetCallingLineIdRestriction(mClientId, GetOwner(), aRequest);
return mProvider->GetCallingLineIdRestriction(GetOwner(), aRequest);
}
NS_IMETHODIMP
@ -490,7 +487,7 @@ MobileConnection::SetCallingLineIdRestriction(unsigned short aClirMode,
return NS_ERROR_FAILURE;
}
return mProvider->SetCallingLineIdRestriction(mClientId, GetOwner(), aClirMode, aRequest);
return mProvider->SetCallingLineIdRestriction(GetOwner(), aClirMode, aRequest);
}
NS_IMETHODIMP
@ -506,7 +503,7 @@ MobileConnection::ExitEmergencyCbMode(nsIDOMDOMRequest** aRequest)
return NS_ERROR_FAILURE;
}
return mProvider->ExitEmergencyCbMode(mClientId, GetOwner(), aRequest);
return mProvider->ExitEmergencyCbMode(GetOwner(), aRequest);
}
// nsIMobileConnectionListener

Просмотреть файл

@ -48,8 +48,6 @@ private:
nsRefPtr<Listener> mListener;
nsWeakPtr mWindow;
uint32_t mClientId;
bool CheckPermission(const char* type);
};