Bug 1152046 - Disable ClosingService for Firefox OS. r=mcmanus

--HG--
extra : rebase_source : fc005bccf525a785e9b87d47236b738eb384c88e
This commit is contained in:
Dragana Damjanovic 2015-09-23 09:49:00 +02:00
parent b08e7b3457
commit 5dbbbf93f4

View File

@ -26,6 +26,7 @@ public:
namespace mozilla {
namespace net {
#ifndef MOZ_WIDGET_GONK
static PRIOMethods sTcpUdpPRCloseLayerMethods;
static PRIOMethods *sTcpUdpPRCloseLayerMethodsPtr = nullptr;
static PRDescIdentity sTcpUdpPRCloseLayerId;
@ -68,6 +69,7 @@ TcpUdpPRCloseLayerClose(PRFileDesc *aFd)
delete closingLayerSecret;
return status;
}
#endif //MOZ_WIDGET_GONK
ClosingService* ClosingService::sInstance = nullptr;
@ -83,6 +85,7 @@ ClosingService::ClosingService()
void
ClosingService::Start()
{
#ifndef MOZ_WIDGET_GONK
if (!sTcpUdpPRCloseLayerMethodsPtr) {
sTcpUdpPRCloseLayerId = PR_GetUniqueIdentity("TCP and UDP PRClose layer");
PR_ASSERT(PR_INVALID_IO_LAYER != sTcpUdpPRCloseLayerId);
@ -101,6 +104,7 @@ ClosingService::Start()
delete service;
}
}
#endif
}
nsresult
@ -119,6 +123,12 @@ ClosingService::StartInternal()
nsresult
ClosingService::AttachIOLayer(PRFileDesc *aFd)
{
#ifdef MOZ_WIDGET_GONK
return NS_OK;
#else
if (!sTcpUdpPRCloseLayerMethodsPtr) {
return NS_OK;
}
@ -143,6 +153,8 @@ ClosingService::AttachIOLayer(PRFileDesc *aFd)
PR_DELETE(layer);
}
return NS_OK;
#endif //MOZ_WIDGET_GONK
}
void
@ -171,12 +183,14 @@ ClosingService::PostRequest(PRFileDesc *aFd)
void
ClosingService::Shutdown()
{
#ifndef MOZ_WIDGET_GONK
MOZ_ASSERT(NS_IsMainThread());
if (sInstance) {
sInstance->ShutdownInternal();
NS_RELEASE(sInstance);
}
#endif //MOZ_WIDGET_GONK
}
void