diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-01-14 20:21:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 20:21:16 +0100 |
commit | fb1d4c9712eb1898d89f90edfc6120ff169e6357 (patch) | |
tree | 677d602abee695200146c4d51ba8db10146bc38c /netwerk/base/nsSocketTransport2.cpp | |
parent | f38edc94a31de3bae839cf63ed57c3851908ac46 (diff) | |
parent | 6335404642a019df481275f4f290ea76b4d8f597 (diff) | |
download | UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar.gz UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar.lz UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.tar.xz UXP-fb1d4c9712eb1898d89f90edfc6120ff169e6357.zip |
Merge pull request #929 from adeshkp/remove-telemetry-stubs
Telemetry: Remove stubs and related code
Diffstat (limited to 'netwerk/base/nsSocketTransport2.cpp')
-rw-r--r-- | netwerk/base/nsSocketTransport2.cpp | 90 |
1 files changed, 5 insertions, 85 deletions
diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp index f9b55ead4..0c8434813 100644 --- a/netwerk/base/nsSocketTransport2.cpp +++ b/netwerk/base/nsSocketTransport2.cpp @@ -7,7 +7,6 @@ #include "nsSocketTransport2.h" #include "mozilla/Attributes.h" -#include "mozilla/Telemetry.h" #include "nsIOService.h" #include "nsStreamUtils.h" #include "nsNetSegmentUtils.h" @@ -1226,8 +1225,7 @@ nsSocketTransport::BuildSocket(PRFileDesc *&fd, bool &proxyTransparent, bool &us if (NS_FAILED(rv)) { SOCKET_LOG((" error pushing io layer [%u:%s rv=%x]\n", i, mTypes[i], rv)); if (fd) { - CloseSocket(fd, - mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()); + CloseSocket(fd); } } } @@ -1395,8 +1393,7 @@ nsSocketTransport::InitiateSocket() // inform socket transport about this newly created socket... rv = mSocketTransportService->AttachSocket(fd, this); if (NS_FAILED(rv)) { - CloseSocket(fd, - mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()); + CloseSocket(fd); return rv; } mAttached = true; @@ -1453,26 +1450,8 @@ nsSocketTransport::InitiateSocket() } #endif - // We use PRIntervalTime here because we need - // nsIOService::LastOfflineStateChange time and - // nsIOService::LastConectivityChange time to be atomic. - PRIntervalTime connectStarted = 0; - if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()) { - connectStarted = PR_IntervalNow(); - } - status = PR_Connect(fd, &prAddr, NS_SOCKET_CONNECT_TIMEOUT); - if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase() && - connectStarted) { - SendPRBlockingTelemetry(connectStarted, - Telemetry::PRCONNECT_BLOCKING_TIME_NORMAL, - Telemetry::PRCONNECT_BLOCKING_TIME_SHUTDOWN, - Telemetry::PRCONNECT_BLOCKING_TIME_CONNECTIVITY_CHANGE, - Telemetry::PRCONNECT_BLOCKING_TIME_LINK_CHANGE, - Telemetry::PRCONNECT_BLOCKING_TIME_OFFLINE); - } - if (status == PR_SUCCESS) { // // we are connected! @@ -1531,16 +1510,6 @@ nsSocketTransport::InitiateSocket() // The connection was refused... // else { - if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase() && - connectStarted) { - SendPRBlockingTelemetry(connectStarted, - Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_NORMAL, - Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_SHUTDOWN, - Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_CONNECTIVITY_CHANGE, - Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_LINK_CHANGE, - Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_OFFLINE); - } - rv = ErrorAccordingToNSPR(code); if ((rv == NS_ERROR_CONNECTION_REFUSED) && !mProxyHost.IsEmpty()) rv = NS_ERROR_PROXY_CONNECTION_REFUSED; @@ -1763,8 +1732,7 @@ public: NS_IMETHOD Run() override { - nsSocketTransport::CloseSocket(mFD, - gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()); + nsSocketTransport::CloseSocket(mFD); return NS_OK; } private: @@ -1801,8 +1769,7 @@ nsSocketTransport::ReleaseFD_Locked(PRFileDesc *fd) SOCKET_LOG(("Intentional leak")); } else if (PR_GetCurrentThread() == gSocketThread) { SOCKET_LOG(("nsSocketTransport: calling PR_Close [this=%p]\n", this)); - CloseSocket(mFD, - mSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()); + CloseSocket(mFD); } else { // Can't PR_Close() a socket off STS thread. Thunk it to STS to die STS_PRCloseOnSocketTransport(mFD); @@ -1960,26 +1927,7 @@ nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags) // We do not need to do PR_ConnectContinue when we are already // shutting down. - // We use PRIntervalTime here because we need - // nsIOService::LastOfflineStateChange time and - // nsIOService::LastConectivityChange time to be atomic. - PRIntervalTime connectStarted = 0; - if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase()) { - connectStarted = PR_IntervalNow(); - } - PRStatus status = PR_ConnectContinue(fd, outFlags); - - if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase() && - connectStarted) { - SendPRBlockingTelemetry(connectStarted, - Telemetry::PRCONNECTCONTINUE_BLOCKING_TIME_NORMAL, - Telemetry::PRCONNECTCONTINUE_BLOCKING_TIME_SHUTDOWN, - Telemetry::PRCONNECTCONTINUE_BLOCKING_TIME_CONNECTIVITY_CHANGE, - Telemetry::PRCONNECTCONTINUE_BLOCKING_TIME_LINK_CHANGE, - Telemetry::PRCONNECTCONTINUE_BLOCKING_TIME_OFFLINE); - } - if (status == PR_SUCCESS) { // // we are connected! @@ -3144,41 +3092,13 @@ nsSocketTransport::PRFileDescAutoLock::SetKeepaliveVals(bool aEnabled, } void -nsSocketTransport::CloseSocket(PRFileDesc *aFd, bool aTelemetryEnabled) +nsSocketTransport::CloseSocket(PRFileDesc *aFd) { #if defined(XP_WIN) AttachShutdownLayer(aFd); #endif - // We use PRIntervalTime here because we need - // nsIOService::LastOfflineStateChange time and - // nsIOService::LastConectivityChange time to be atomic. - PRIntervalTime closeStarted; - if (aTelemetryEnabled) { - closeStarted = PR_IntervalNow(); - } - PR_Close(aFd); - - if (aTelemetryEnabled) { - SendPRBlockingTelemetry(closeStarted, - Telemetry::PRCLOSE_TCP_BLOCKING_TIME_NORMAL, - Telemetry::PRCLOSE_TCP_BLOCKING_TIME_SHUTDOWN, - Telemetry::PRCLOSE_TCP_BLOCKING_TIME_CONNECTIVITY_CHANGE, - Telemetry::PRCLOSE_TCP_BLOCKING_TIME_LINK_CHANGE, - Telemetry::PRCLOSE_TCP_BLOCKING_TIME_OFFLINE); - } -} - -void -nsSocketTransport::SendPRBlockingTelemetry(PRIntervalTime aStart, - Telemetry::ID aIDNormal, - Telemetry::ID aIDShutdown, - Telemetry::ID aIDConnectivityChange, - Telemetry::ID aIDLinkChange, - Telemetry::ID aIDOffline) -{ - /* STUB */ } } // namespace net |