Bug 1368549 - Remove MOZ_WIDGET_GONK from netwerk/* r=mcmanus

MozReview-Commit-ID: J2njLbNwlco
This commit is contained in:
Valentin Gosu
2017-05-29 22:09:04 +02:00
parent 7877a610a1
commit ee6dca6a9e
16 changed files with 1 additions and 167 deletions

View File

@@ -59,11 +59,6 @@
#include "nsContentUtils.h"
#include "xpcpublic.h"
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkManager.h"
#include "nsINetworkInterface.h"
#endif
namespace mozilla {
namespace net {

View File

@@ -49,27 +49,6 @@ WriteToFile(nsIFile *lf, const char *data, uint32_t len, int32_t flags)
PRFileDesc *fd;
int32_t mode = 0600;
nsresult rv;
#if defined(MOZ_WIDGET_GONK)
// The sdcard on a B2G phone looks like:
// d---rwx--- system sdcard_rw 1970-01-01 01:00:00 sdcard
// On the emulator, xpcshell fails when using 0600 mode to open the file,
// and 0660 works.
nsCOMPtr<nsIFile> parent;
rv = lf->GetParent(getter_AddRefs(parent));
if (NS_FAILED(rv)) {
return rv;
}
uint32_t parentPerm;
rv = parent->GetPermissions(&parentPerm);
if (NS_FAILED(rv)) {
return rv;
}
if ((parentPerm & 0700) == 0) {
// Parent directory has no owner-write, so try to use group permissions
// instead of owner permissions.
mode = 0660;
}
#endif
rv = lf->OpenNSPRFileDesc(flags, mode, &fd);
if (NS_FAILED(rv))
return rv;

View File

@@ -71,11 +71,6 @@
#include "nsNSSComponent.h"
#include "nsIRedirectHistoryEntry.h"
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkManager.h"
#include "nsThreadUtils.h" // for NS_IsMainThread
#endif
#include <limits>
using namespace mozilla;

View File

@@ -33,10 +33,6 @@
#include "nsICancelable.h"
#include "nsWrapperCacheInlines.h"
#ifdef MOZ_WIDGET_GONK
#include "NetStatistics.h"
#endif
namespace mozilla {
namespace net {

View File

@@ -12,11 +12,6 @@
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkInterface.h"
#include "nsProxyRelease.h"
#endif
//-----------------------------------------------------------------------------
namespace mozilla {

View File

@@ -9,10 +9,6 @@
#include "nsXULAppAPI.h"
#include "private/pprio.h"
#ifdef MOZ_WIDGET_GONK
#include <cutils/properties.h>
#endif // MOZ_WIDGET_GONK
namespace mozilla {
namespace net {
@@ -21,29 +17,11 @@ namespace {
inline void
StartService()
{
#ifdef MOZ_WIDGET_GONK
char value[PROPERTY_VALUE_MAX] = { '\0' };
property_get("init.svc.mdnsd", value, "");
if (strcmp(value, "running") == 0) {
return;
}
property_set("ctl.start", "mdnsd");
#endif // MOZ_WIDGET_GONK
}
inline void
StopService()
{
#ifdef MOZ_WIDGET_GONK
char value[PROPERTY_VALUE_MAX] = { '\0' };
property_get("init.svc.mdnsd", value, "");
if (strcmp(value, "stopped") == 0) {
return;
}
property_set("ctl.stop", "mdnsd");
#endif // MOZ_WIDGET_GONK
}
class ServiceCounter
@@ -157,9 +135,6 @@ NS_IMPL_ISUPPORTS(nsDNSServiceDiscovery, nsIDNSServiceDiscovery)
nsDNSServiceDiscovery::~nsDNSServiceDiscovery()
{
#ifdef MOZ_WIDGET_GONK
StopService();
#endif
}
nsresult

View File

@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if defined(MOZ_WIDGET_COCOA) || (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16)
#if defined(MOZ_WIDGET_COCOA)
#define ENABLE_DNS_SERVICE_DISCOVERY
#endif

View File

@@ -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;
@@ -1616,13 +1612,6 @@ nsFtpState::Init(nsFtpChannel *channel)
mChannel = channel; // a straight ref ptr to the channel
#ifdef MOZ_WIDGET_GONK
nsCOMPtr<nsINetworkInfo> activeNetworkInfo;
GetActiveNetworkInfo(activeNetworkInfo);
mActiveNetworkInfo =
new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo);
#endif
mKeepRunning = true;
mSuppliedEntityID = channel->EntityID();

View File

@@ -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
@@ -213,10 +208,6 @@ private:
nsCOMPtr<nsICancelable> mProxyRequest;
bool mDeferredCallbackPending;
#ifdef MOZ_WIDGET_GONK
nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo;
#endif
};
#endif //__nsFtpConnectionThread__h_

View File

@@ -945,31 +945,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)

View File

@@ -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);

View File

@@ -19,11 +19,6 @@
#include "ARefBase.h"
#include "AlternateServices.h"
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkInterface.h"
#include "nsProxyRelease.h"
#endif
//-----------------------------------------------------------------------------
class nsIHttpActivityObserver;

View File

@@ -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

View File

@@ -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"

View File

@@ -8,10 +8,8 @@
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#ifndef MOZ_WIDGET_GONK
#include <ifaddrs.h>
#include <net/if.h>
#endif
#include "nsThreadUtils.h"
#include "nsIObserverService.h"
@@ -28,10 +26,6 @@
#include "mozilla/Sprintf.h"
#include "mozilla/Telemetry.h"
#ifdef MOZ_WIDGET_GONK
#include <cutils/properties.h>
#endif
/* a shorter name that better explains what it does */
#define EINTR_RETRY(x) MOZ_TEMP_FAILURE_RETRY(x)
@@ -210,9 +204,6 @@ void nsNotifyAddrListener::calculateNetworkId(void)
//
void nsNotifyAddrListener::checkLink(void)
{
#ifdef MOZ_WIDGET_GONK
// b2g instead has NetworkManager.js which handles UP/DOWN
#else
struct ifaddrs *list;
struct ifaddrs *ifa;
bool link = false;
@@ -247,7 +238,6 @@ void nsNotifyAddrListener::checkLink(void)
SendEvent(mLinkUp ?
NS_NETWORK_LINK_DATA_UP : NS_NETWORK_LINK_DATA_DOWN);
}
#endif
}
void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket)

View File

@@ -48,7 +48,6 @@ class nsWifiListener
bool mHasSentData;
};
#ifndef MOZ_WIDGET_GONK
class nsWifiMonitor final : nsIRunnable, nsIWifiMonitor, nsIObserver
{
public:
@@ -79,32 +78,5 @@ class nsWifiMonitor final : nsIRunnable, nsIWifiMonitor, nsIObserver
nsAutoPtr<WinWifiScanner> mWinWifiScanner;
#endif
};
#else
#include "nsIWifi.h"
class nsWifiMonitor final : nsIWifiMonitor, nsIWifiScanResultsReady, nsIObserver
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIWIFIMONITOR
NS_DECL_NSIOBSERVER
NS_DECL_NSIWIFISCANRESULTSREADY
nsWifiMonitor();
private:
~nsWifiMonitor();
void ClearTimer() {
if (mTimer) {
mTimer->Cancel();
mTimer = nullptr;
}
}
void StartScan();
nsCOMArray<nsWifiAccessPoint> mLastAccessPoints;
nsTArray<nsWifiListener> mListeners;
nsCOMPtr<nsITimer> mTimer;
};
#endif
#endif