summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-13 00:08:52 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-13 00:08:52 +0200
commite16bcd08aae85a7d9c2de5a4b1c733280cb81112 (patch)
tree220026724ceb8fbcf18bf627fde022c2d8df0e91 /netwerk/protocol
parent6571d2ceb42930dab01677ef0e95e732d5076fb8 (diff)
downloadUXP-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')
-rw-r--r--netwerk/protocol/ftp/nsFtpConnectionThread.cpp47
-rw-r--r--netwerk/protocol/ftp/nsFtpConnectionThread.h9
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp25
-rw-r--r--netwerk/protocol/http/nsHttpTransaction.cpp46
-rw-r--r--netwerk/protocol/http/nsHttpTransaction.h8
-rw-r--r--netwerk/protocol/websocket/WebSocketChannel.cpp48
-rw-r--r--netwerk/protocol/websocket/WebSocketChannel.h8
7 files changed, 0 insertions, 191 deletions
diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
index 1119fcff5..2ae12846a 100644
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -45,10 +45,6 @@
#include "nsIAuthPrompt2.h"
#include "nsIFTPChannelParentInternal.h"
-#ifdef MOZ_WIDGET_GONK
-#include "NetStatistics.h"
-#endif
-
using namespace mozilla;
using namespace mozilla::net;
@@ -1619,13 +1615,6 @@ nsFtpState::Init(nsFtpChannel *channel)
// initialize counter for network metering
mCountRecv = 0;
-#ifdef MOZ_WIDGET_GONK
- nsCOMPtr<nsINetworkInfo> activeNetworkInfo;
- GetActiveNetworkInfo(activeNetworkInfo);
- mActiveNetworkInfo =
- new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo);
-#endif
-
mKeepRunning = true;
mSuppliedEntityID = channel->EntityID();
@@ -2104,43 +2093,7 @@ nsFtpState::ReadSegments(nsWriteSegmentFun writer, void *closure,
nsresult
nsFtpState::SaveNetworkStats(bool enforce)
{
-#ifdef MOZ_WIDGET_GONK
- // Obtain app id
- uint32_t appId;
- bool isInBrowser;
- NS_GetAppInfo(mChannel, &appId, &isInBrowser);
-
- // Check if active network and appid are valid.
- if (!mActiveNetworkInfo || appId == NECKO_NO_APP_ID) {
- return NS_OK;
- }
-
- if (mCountRecv <= 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.
- if (!enforce && mCountRecv < NETWORK_STATS_THRESHOLD) {
- return NS_OK;
- }
-
- // Create the event to save the network statistics.
- // the event is then dispathed to the main thread.
- RefPtr<Runnable> event =
- new SaveNetworkStatsEvent(appId, isInBrowser, mActiveNetworkInfo,
- mCountRecv, 0, false);
- NS_DispatchToMainThread(event);
-
- // Reset the counters after saving.
- mCountRecv = 0;
-
- return NS_OK;
-#else
return NS_ERROR_NOT_IMPLEMENTED;
-#endif
}
NS_IMETHODIMP
diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.h b/netwerk/protocol/ftp/nsFtpConnectionThread.h
index dd48da562..b4e71bd10 100644
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.h
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.h
@@ -17,11 +17,6 @@
#include "nsFtpControlConnection.h"
#include "nsIProtocolProxyCallback.h"
-#ifdef MOZ_WIDGET_GONK
-#include "nsINetworkInterface.h"
-#include "nsProxyRelease.h"
-#endif
-
// ftp server types
#define FTP_GENERIC_TYPE 0
#define FTP_UNIX_TYPE 1
@@ -215,11 +210,7 @@ private:
bool mDeferredCallbackPending;
// These members are used for network per-app metering (bug 855948)
-// Currently, they are only available on gonk.
uint64_t mCountRecv;
-#ifdef MOZ_WIDGET_GONK
- nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo;
-#endif
nsresult SaveNetworkStats(bool);
void CountRecvBytes(uint64_t recvBytes)
{
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 67e29a029..f9bcc391d 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -848,31 +848,6 @@ nsHttpHandler::InitUserAgentComponents()
}
#endif // MOZ_MULET
-#if defined(MOZ_WIDGET_GONK)
- // Device model identifier should be a simple token, which can be composed
- // of letters, numbers, hyphen ("-") and dot (".").
- // Any other characters means the identifier is invalid and ignored.
- nsCString deviceId;
- rv = Preferences::GetCString("general.useragent.device_id", &deviceId);
- if (NS_SUCCEEDED(rv)) {
- bool valid = true;
- deviceId.Trim(" ", true, true);
- for (size_t i = 0; i < deviceId.Length(); i++) {
- char c = deviceId.CharAt(i);
- if (!(isalnum(c) || c == '-' || c == '.')) {
- valid = false;
- break;
- }
- }
- if (valid) {
- mDeviceModelId = deviceId;
- } else {
- LOG(("nsHttpHandler: Ignore invalid device ID: [%s]\n",
- deviceId.get()));
- }
- }
-#endif
-
#ifndef MOZ_UA_OS_AGNOSTIC
// Gather OS/CPU.
#if defined(XP_WIN)
diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp
index 706710d89..8d837d172 100644
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -43,10 +43,6 @@
#include "sslerr.h"
#include <algorithm>
-#ifdef MOZ_WIDGET_GONK
-#include "NetStatistics.h"
-#endif
-
//-----------------------------------------------------------------------------
static NS_DEFINE_CID(kMultiplexInputStream, NS_MULTIPLEXINPUTSTREAM_CID);
@@ -266,15 +262,6 @@ nsHttpTransaction::Init(uint32_t caps,
NS_GetAppInfo(channel, &mAppId, &mIsInIsolatedMozBrowser);
}
-#ifdef MOZ_WIDGET_GONK
- if (mAppId != NECKO_NO_APP_ID) {
- nsCOMPtr<nsINetworkInfo> activeNetworkInfo;
- GetActiveNetworkInfo(activeNetworkInfo);
- mActiveNetworkInfo =
- new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo);
- }
-#endif
-
nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal =
do_QueryInterface(eventsink);
if (httpChannelInternal) {
@@ -937,40 +924,7 @@ nsHttpTransaction::WriteSegments(nsAHttpSegmentWriter *writer,
nsresult
nsHttpTransaction::SaveNetworkStats(bool enforce)
{
-#ifdef MOZ_WIDGET_GONK
- // Check if active network and appid are valid.
- if (!mActiveNetworkInfo || mAppId == NECKO_NO_APP_ID) {
- return NS_OK;
- }
-
- if (mCountRecv <= 0 && mCountSent <= 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 = mCountRecv + mCountSent;
- 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,
- mCountRecv, mCountSent, false);
- NS_DispatchToMainThread(event);
-
- // Reset the counters after saving.
- mCountSent = 0;
- mCountRecv = 0;
-
- return NS_OK;
-#else
return NS_ERROR_NOT_IMPLEMENTED;
-#endif
}
void
diff --git a/netwerk/protocol/http/nsHttpTransaction.h b/netwerk/protocol/http/nsHttpTransaction.h
index 5bf97d41e..262796d71 100644
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -19,11 +19,6 @@
#include "ARefBase.h"
#include "AlternateServices.h"
-#ifdef MOZ_WIDGET_GONK
-#include "nsINetworkInterface.h"
-#include "nsProxyRelease.h"
-#endif
-
//-----------------------------------------------------------------------------
class nsIHttpActivityObserver;
@@ -435,9 +430,6 @@ private:
uint64_t mCountSent;
uint32_t mAppId;
bool mIsInIsolatedMozBrowser;
-#ifdef MOZ_WIDGET_GONK
- nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo;
-#endif
nsresult SaveNetworkStats(bool);
void CountRecvBytes(uint64_t recvBytes)
{
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
diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h
index e2f332dab..341a357a0 100644
--- a/netwerk/protocol/websocket/WebSocketChannel.h
+++ b/netwerk/protocol/websocket/WebSocketChannel.h
@@ -21,11 +21,6 @@
#include "nsIStringStream.h"
#include "BaseWebSocketChannel.h"
-#ifdef MOZ_WIDGET_GONK
-#include "nsINetworkInterface.h"
-#include "nsProxyRelease.h"
-#endif
-
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsDeque.h"
@@ -307,9 +302,6 @@ private:
Atomic<uint64_t, Relaxed> mCountSent;
uint32_t mAppId;
bool mIsInIsolatedMozBrowser;
-#ifdef MOZ_WIDGET_GONK
- nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo;
-#endif
nsresult SaveNetworkStats(bool);
void CountRecvBytes(uint64_t recvBytes)
{