diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 16:19:33 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 16:19:58 +0200 |
commit | 6571d2ceb42930dab01677ef0e95e732d5076fb8 (patch) | |
tree | 8c593b8e09f2cfb457df72d40dc719bb0e0df066 /dom/presentation/PresentationSessionInfo.cpp | |
parent | 2f359ed80ccb2cab440c0cda886404ed42ad9fdf (diff) | |
download | UXP-6571d2ceb42930dab01677ef0e95e732d5076fb8.tar UXP-6571d2ceb42930dab01677ef0e95e732d5076fb8.tar.gz UXP-6571d2ceb42930dab01677ef0e95e732d5076fb8.tar.lz UXP-6571d2ceb42930dab01677ef0e95e732d5076fb8.tar.xz UXP-6571d2ceb42930dab01677ef0e95e732d5076fb8.zip |
Remove MOZ_WIDGET_GONK [1/2]
Tag #288
Diffstat (limited to 'dom/presentation/PresentationSessionInfo.cpp')
-rw-r--r-- | dom/presentation/PresentationSessionInfo.cpp | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/dom/presentation/PresentationSessionInfo.cpp b/dom/presentation/PresentationSessionInfo.cpp index f93909864..1dd92ab69 100644 --- a/dom/presentation/PresentationSessionInfo.cpp +++ b/dom/presentation/PresentationSessionInfo.cpp @@ -31,11 +31,6 @@ #include "nsIPresentationNetworkHelper.h" #endif // MOZ_WIDGET_ANDROID -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkInterface.h" -#include "nsINetworkManager.h" -#endif - using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::services; @@ -647,49 +642,7 @@ PresentationControllingInfo::Shutdown(nsresult aReason) nsresult PresentationControllingInfo::GetAddress() { -#if defined(MOZ_WIDGET_GONK) - nsCOMPtr<nsINetworkManager> networkManager = - do_GetService("@mozilla.org/network/manager;1"); - if (NS_WARN_IF(!networkManager)) { - return NS_ERROR_NOT_AVAILABLE; - } - - nsCOMPtr<nsINetworkInfo> activeNetworkInfo; - networkManager->GetActiveNetworkInfo(getter_AddRefs(activeNetworkInfo)); - if (NS_WARN_IF(!activeNetworkInfo)) { - return NS_ERROR_FAILURE; - } - - char16_t** ips = nullptr; - uint32_t* prefixes = nullptr; - uint32_t count = 0; - activeNetworkInfo->GetAddresses(&ips, &prefixes, &count); - if (NS_WARN_IF(!count)) { - NS_Free(prefixes); - NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips); - return NS_ERROR_FAILURE; - } - - // TODO bug 1228504 Take all IP addresses in PresentationChannelDescription - // into account. And at the first stage Presentation API is only exposed on - // Firefox OS where the first IP appears enough for most scenarios. - - nsAutoString ip; - ip.Assign(ips[0]); - - // On Android platform, the IP address is retrieved from a callback function. - // To make consistent code sequence, following function call is dispatched - // into main thread instead of calling it directly. - NS_DispatchToMainThread( - NewRunnableMethod<nsCString>( - this, - &PresentationControllingInfo::OnGetAddress, - NS_ConvertUTF16toUTF8(ip))); - - NS_Free(prefixes); - NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips); - -#elif defined(MOZ_WIDGET_ANDROID) +#if defined(MOZ_WIDGET_ANDROID) RefPtr<PresentationNetworkHelper> networkHelper = new PresentationNetworkHelper(this, &PresentationControllingInfo::OnGetAddress); |