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 | |
parent | 2f359ed80ccb2cab440c0cda886404ed42ad9fdf (diff) | |
download | uxp-6571d2ceb42930dab01677ef0e95e732d5076fb8.tar.gz |
Remove MOZ_WIDGET_GONK [1/2]
Tag #288
Diffstat (limited to 'dom/presentation')
-rw-r--r-- | dom/presentation/PresentationSessionInfo.cpp | 49 | ||||
-rw-r--r-- | dom/presentation/provider/PresentationDeviceProviderModule.cpp | 5 |
2 files changed, 2 insertions, 52 deletions
diff --git a/dom/presentation/PresentationSessionInfo.cpp b/dom/presentation/PresentationSessionInfo.cpp index f939098649..1dd92ab69d 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); diff --git a/dom/presentation/provider/PresentationDeviceProviderModule.cpp b/dom/presentation/provider/PresentationDeviceProviderModule.cpp index 9100fa49bd..9c084e7dbb 100644 --- a/dom/presentation/provider/PresentationDeviceProviderModule.cpp +++ b/dom/presentation/provider/PresentationDeviceProviderModule.cpp @@ -68,12 +68,9 @@ static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContrac }; static const mozilla::Module::CategoryEntry kPresentationDeviceProviderCategories[] = { -#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID) || (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16) +#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID) { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", MULTICAST_DNS_PROVIDER_CONTRACT_ID }, #endif -#if defined(MOZ_WIDGET_GONK) - { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "DisplayDeviceProvider", DISPLAY_DEVICE_PROVIDER_CONTRACT_ID }, -#endif #ifdef MOZ_WIDGET_ANDROID { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "LegacyMDNSDeviceProvider", LEGACY_MDNS_PROVIDER_CONTRACT_ID }, #endif //MOZ_WIDGET_ANDROID |