diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-13 00:08:52 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-13 00:08:52 +0200 |
commit | e16bcd08aae85a7d9c2de5a4b1c733280cb81112 (patch) | |
tree | 220026724ceb8fbcf18bf627fde022c2d8df0e91 /netwerk/protocol/websocket/WebSocketChannel.cpp | |
parent | 6571d2ceb42930dab01677ef0e95e732d5076fb8 (diff) | |
download | UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.gz UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.lz UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.xz UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.zip |
Remove MOZ_WIDGET_GONK [2/2]
Tag #288
Diffstat (limited to 'netwerk/protocol/websocket/WebSocketChannel.cpp')
-rw-r--r-- | netwerk/protocol/websocket/WebSocketChannel.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index a6254a088..c6dc8d328 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -65,10 +65,6 @@ #include "zlib.h" #include <algorithm> -#ifdef MOZ_WIDGET_GONK -#include "NetStatistics.h" -#endif - // rather than slurp up all of nsIWebSocket.idl, which lives outside necko, just // dupe one constant we need from it #define CLOSE_GOING_AWAY 1001 @@ -1396,15 +1392,6 @@ WebSocketChannel::BeginOpenInternal() NS_GetAppInfo(localChannel, &mAppId, &mIsInIsolatedMozBrowser); } -#ifdef MOZ_WIDGET_GONK - if (mAppId != NECKO_NO_APP_ID) { - nsCOMPtr<nsINetworkInfo> activeNetworkInfo; - GetActiveNetworkInfo(activeNetworkInfo); - mActiveNetworkInfo = - new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo); - } -#endif - rv = NS_MaybeOpenChannelUsingAsyncOpen2(localChannel, this); if (NS_FAILED(rv)) { @@ -4063,42 +4050,7 @@ WebSocketChannel::OnDataAvailable(nsIRequest *aRequest, nsresult WebSocketChannel::SaveNetworkStats(bool enforce) { -#ifdef MOZ_WIDGET_GONK - // Check if the active network and app id are valid. - if(!mActiveNetworkInfo || mAppId == NECKO_NO_APP_ID) { - return NS_OK; - } - - uint64_t countRecv = 0; - uint64_t countSent = 0; - - mCountRecv.exchange(countRecv); - mCountSent.exchange(countSent); - - if (countRecv == 0 && countSent == 0) { - // There is no traffic, no need to save. - return NS_OK; - } - - // If |enforce| is false, the traffic amount is saved - // only when the total amount exceeds the predefined - // threshold. - uint64_t totalBytes = countRecv + countSent; - if (!enforce && totalBytes < NETWORK_STATS_THRESHOLD) { - return NS_OK; - } - - // Create the event to save the network statistics. - // the event is then dispatched to the main thread. - RefPtr<Runnable> event = - new SaveNetworkStatsEvent(mAppId, mIsInIsolatedMozBrowser, mActiveNetworkInfo, - countRecv, countSent, false); - NS_DispatchToMainThread(event); - - return NS_OK; -#else return NS_ERROR_NOT_IMPLEMENTED; -#endif } } // namespace net |