Bug 1382099 - Remove MOZ_WIDGET_GONK from several dom/ subdirectories. r=mccr8,jdm.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 21 Jul 2017 10:52:44 +1000
changeset 418729 79bc99d25a3ff9f1129537dddaf169e189a3ddab
parent 418728 906db68ff15f88d05f50c1354b0fc51cf618bed0
child 418730 95c74751877910cf2649fc6b4c3e2eeca6b7951e
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, jdm
bugs1382099
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1382099 - Remove MOZ_WIDGET_GONK from several dom/ subdirectories. r=mccr8,jdm. As well as the obvious #ifdef stuff, the patch removes TCPSocket::SetAppIdAndBrowser(), which means {TCPSocketParent,TCPServerSocketParent}::{GetAppId,GetInIsolatedMozBrowser}() can also be removed.
dom/audiochannel/AudioChannelService.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/WebGLContext.cpp
dom/events/EventListenerManager.cpp
dom/events/EventNameList.h
dom/geolocation/nsGeolocation.cpp
dom/html/nsIFormControl.h
dom/indexedDB/ActorsParent.cpp
dom/network/TCPServerSocket.cpp
dom/network/TCPServerSocketParent.cpp
dom/network/TCPServerSocketParent.h
dom/network/TCPSocket.cpp
dom/network/TCPSocket.h
dom/network/TCPSocketParent.cpp
dom/network/TCPSocketParent.h
dom/performance/Performance.cpp
dom/presentation/PresentationSessionInfo.cpp
dom/presentation/provider/PresentationDeviceProviderModule.cpp
dom/system/OSFileConstants.cpp
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -17,20 +17,16 @@
 #include "nsISupportsPrimitives.h"
 #include "nsThreadUtils.h"
 #include "nsHashPropertyBag.h"
 #include "nsComponentManagerUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsServiceManagerUtils.h"
 
-#ifdef MOZ_WIDGET_GONK
-#include "nsJSUtils.h"
-#endif
-
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static mozilla::LazyLogModule gAudioChannelLog("AudioChannel");
 
 namespace {
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -140,20 +140,16 @@
 using mozilla::gl::GLContext;
 using mozilla::gl::SkiaGLGlue;
 using mozilla::gl::GLContextProvider;
 
 #ifdef XP_WIN
 #include "gfxWindowsPlatform.h"
 #endif
 
-#ifdef MOZ_WIDGET_GONK
-#include "mozilla/layers/ShadowLayers.h"
-#endif
-
 // windows.h (included by chromium code) defines this, in its infinite wisdom
 #undef DrawText
 
 using namespace mozilla;
 using namespace mozilla::CanvasUtils;
 using namespace mozilla::css;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -47,20 +47,16 @@
 #include "nsIXPConnect.h"
 #include "nsServiceManagerUtils.h"
 #include "nsSVGEffects.h"
 #include "prenv.h"
 #include "ScopedGLHelpers.h"
 #include "VRManagerChild.h"
 #include "mozilla/layers/TextureClientSharedSurface.h"
 
-#ifdef MOZ_WIDGET_GONK
-#include "mozilla/layers/ShadowLayers.h"
-#endif
-
 // Local
 #include "CanvasUtils.h"
 #include "WebGL1Context.h"
 #include "WebGLActiveInfo.h"
 #include "WebGLBuffer.h"
 #include "WebGLContextLossHandler.h"
 #include "WebGLContextUtils.h"
 #include "WebGLExtensions.h"
@@ -544,40 +540,16 @@ BaseCaps(const WebGLContextOptions& opti
     if (!baseCaps.alpha)
         baseCaps.premultAlpha = true;
 
     // we should really have this behind a
     // |gfxPlatform::GetPlatform()->GetScreenDepth() == 16| check, but
     // for now it's just behind a pref for testing/evaluation.
     baseCaps.bpp16 = gfxPrefs::WebGLPrefer16bpp();
 
-#ifdef MOZ_WIDGET_GONK
-    do {
-        auto canvasElement = webgl->GetCanvas();
-        if (!canvasElement)
-            break;
-
-        auto ownerDoc = canvasElement->OwnerDoc();
-        nsIWidget* docWidget = nsContentUtils::WidgetForDocument(ownerDoc);
-        if (!docWidget)
-            break;
-
-        layers::LayerManager* layerManager = docWidget->GetLayerManager();
-        if (!layerManager)
-            break;
-
-        // XXX we really want "AsSurfaceAllocator" here for generality
-        layers::ShadowLayerForwarder* forwarder = layerManager->AsShadowForwarder();
-        if (!forwarder)
-            break;
-
-        baseCaps.surfaceAllocator = forwarder->GetTextureForwarder();
-    } while (false);
-#endif
-
     // Done with baseCaps construction.
 
     if (!gfxPrefs::WebGLForceMSAA()) {
         const nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
 
         nsCString blocklistId;
         if (IsFeatureInBlacklist(gfxInfo, nsIGfxInfo::FEATURE_WEBGL_MSAA, &blocklistId)) {
             webgl->GenerateWarning("Disallowing antialiased backbuffers due"
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -340,17 +340,17 @@ EventListenerManager::AddEventListenerIn
   } else if (aTypeAtom == nsGkAtoms::onabsolutedeviceorientation) {
     EnableDevice(eAbsoluteDeviceOrientation);
   } else if (aTypeAtom == nsGkAtoms::ondeviceproximity || aTypeAtom == nsGkAtoms::onuserproximity) {
     EnableDevice(eDeviceProximity);
   } else if (aTypeAtom == nsGkAtoms::ondevicelight) {
     EnableDevice(eDeviceLight);
   } else if (aTypeAtom == nsGkAtoms::ondevicemotion) {
     EnableDevice(eDeviceMotion);
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
   } else if (aTypeAtom == nsGkAtoms::onorientationchange) {
     EnableDevice(eOrientationChange);
 #endif
 #ifdef MOZ_B2G
   } else if (aTypeAtom == nsGkAtoms::onmoztimechange) {
     EnableDevice(eTimeChange);
   } else if (aTypeAtom == nsGkAtoms::onmoznetworkupload) {
     EnableDevice(eNetworkUpload);
@@ -484,17 +484,17 @@ EventListenerManager::IsDeviceType(Event
 {
   switch (aEventMessage) {
     case eDeviceOrientation:
     case eAbsoluteDeviceOrientation:
     case eDeviceMotion:
     case eDeviceLight:
     case eDeviceProximity:
     case eUserProximity:
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
     case eOrientationChange:
 #endif
 #ifdef MOZ_B2G
     case eTimeChange:
     case eNetworkUpload:
     case eNetworkDownload:
 #endif
       return true;
@@ -538,17 +538,17 @@ EventListenerManager::EnableDevice(Event
     case eDeviceLight:
       window->EnableDeviceSensor(SENSOR_LIGHT);
       break;
     case eDeviceMotion:
       window->EnableDeviceSensor(SENSOR_ACCELERATION);
       window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION);
       window->EnableDeviceSensor(SENSOR_GYROSCOPE);
       break;
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
     case eOrientationChange:
       window->EnableOrientationChangeListener();
       break;
 #endif
 #ifdef MOZ_B2G
     case eTimeChange:
       window->EnableTimeChangeNotifications();
       break;
@@ -593,17 +593,17 @@ EventListenerManager::DisableDevice(Even
       break;
     case eDeviceProximity:
     case eUserProximity:
       window->DisableDeviceSensor(SENSOR_PROXIMITY);
       break;
     case eDeviceLight:
       window->DisableDeviceSensor(SENSOR_LIGHT);
       break;
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
     case eOrientationChange:
       window->DisableOrientationChangeListener();
       break;
 #endif
 #ifdef MOZ_B2G
     case eTimeChange:
       window->DisableTimeChangeNotifications();
       break;
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -554,17 +554,17 @@ WINDOW_EVENT(message,
 WINDOW_EVENT(offline,
              eOffline,
              EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
              eBasicEventClass)
 WINDOW_EVENT(online,
              eOnline,
              EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
              eBasicEventClass)
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
 WINDOW_EVENT(orientationchange,
              eOrientationChange,
              EventNameType_HTMLBodyOrFramesetOnly,
              eBasicEventClass)
 #endif
 WINDOW_EVENT(pagehide,
              ePageHide,
              EventNameType_HTMLBodyOrFramesetOnly,
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -29,20 +29,16 @@
 #include "nsXULAppAPI.h"
 
 class nsIPrincipal;
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidLocationProvider.h"
 #endif
 
-#ifdef MOZ_WIDGET_GONK
-#include "GonkGPSGeolocationProvider.h"
-#endif
-
 #ifdef MOZ_GPSD
 #include "GpsdLocationProvider.h"
 #endif
 
 #ifdef MOZ_WIDGET_COCOA
 #include "CoreLocationLocationProvider.h"
 #endif
 
--- a/dom/html/nsIFormControl.h
+++ b/dom/html/nsIFormControl.h
@@ -270,17 +270,17 @@ bool
 nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
 {
   return aType == NS_FORM_INPUT_TEXT ||
          aType == NS_FORM_INPUT_EMAIL ||
          aType == NS_FORM_INPUT_SEARCH ||
          aType == NS_FORM_INPUT_TEL ||
          aType == NS_FORM_INPUT_URL ||
          // TODO: those are temporary until bug 773205 is fixed.
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
          // On Android/B2G, date/time input appears as a normal text box.
          aType == NS_FORM_INPUT_TIME ||
          aType == NS_FORM_INPUT_DATE ||
 #endif
          aType == NS_FORM_INPUT_MONTH ||
          aType == NS_FORM_INPUT_WEEK ||
          aType == NS_FORM_INPUT_DATETIME_LOCAL ||
          (!aExcludePassword && aType == NS_FORM_INPUT_PASSWORD);
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -119,17 +119,17 @@
 #define ASSERT_UNLESS_FUZZING(...) MOZ_ASSERT(false, __VA_ARGS__)
 #endif
 
 #define IDB_DEBUG_LOG(_args)                                                   \
   MOZ_LOG(IndexedDatabaseManager::GetLoggingModule(),                           \
          LogLevel::Debug,                                                         \
          _args )
 
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_ANDROID)
 #define IDB_MOBILE
 #endif
 
 namespace mozilla {
 
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc,
                                           PRFileDesc,
                                           PR_Close);
--- a/dom/network/TCPServerSocket.cpp
+++ b/dom/network/TCPServerSocket.cpp
@@ -143,20 +143,16 @@ TCPServerSocket::FireEvent(const nsAStri
   }
 }
 
 NS_IMETHODIMP
 TCPServerSocket::OnSocketAccepted(nsIServerSocket* aServer, nsISocketTransport* aTransport)
 {
   nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal();
   RefPtr<TCPSocket> socket = TCPSocket::CreateAcceptedSocket(global, aTransport, mUseArrayBuffers);
-  if (mServerBridgeParent) {
-    socket->SetAppIdAndBrowser(mServerBridgeParent->GetAppId(),
-                               mServerBridgeParent->GetInIsolatedMozBrowser());
-  }
   FireEvent(NS_LITERAL_STRING("connect"), socket);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TCPServerSocket::OnStopListening(nsIServerSocket* aServer, nsresult aStatus)
 {
   if (aStatus != NS_BINDING_ABORTED) {
--- a/dom/network/TCPServerSocketParent.cpp
+++ b/dom/network/TCPServerSocketParent.cpp
@@ -56,34 +56,16 @@ TCPServerSocketParent::~TCPServerSocketP
 }
 
 void
 TCPServerSocketParent::Init()
 {
   NS_ENSURE_SUCCESS_VOID(mServerSocket->Init());
 }
 
-uint32_t
-TCPServerSocketParent::GetAppId()
-{
-  return nsIScriptSecurityManager::UNKNOWN_APP_ID;
-}
-
-bool
-TCPServerSocketParent::GetInIsolatedMozBrowser()
-{
-  const PContentParent *content = Manager()->Manager();
-  if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
-    TabParent *tab = TabParent::GetFrom(browser);
-    return tab->IsIsolatedMozBrowserElement();
-  } else {
-    return false;
-  }
-}
-
 nsresult
 TCPServerSocketParent::SendCallbackAccept(TCPSocketParent *socket)
 {
   socket->AddIPDLReference();
 
   nsresult rv;
 
   nsString host;
@@ -138,17 +120,16 @@ TCPServerSocketParent::RecvRequestDelete
   mozilla::Unused << Send__delete__(this);
   return IPC_OK();
 }
 
 void
 TCPServerSocketParent::OnConnect(TCPServerSocketEvent* event)
 {
   RefPtr<TCPSocket> socket = event->Socket();
-  socket->SetAppIdAndBrowser(GetAppId(), GetInIsolatedMozBrowser());
 
   RefPtr<TCPSocketParent> socketParent = new TCPSocketParent();
   socketParent->SetSocket(socket);
 
   socket->SetSocketBridgeParent(socketParent);
 
   SendCallbackAccept(socketParent);
 }
--- a/dom/network/TCPServerSocketParent.h
+++ b/dom/network/TCPServerSocketParent.h
@@ -29,19 +29,16 @@ public:
   TCPServerSocketParent(PNeckoParent* neckoParent, uint16_t aLocalPort,
                         uint16_t aBacklog, bool aUseArrayBuffers);
 
   void Init();
 
   virtual mozilla::ipc::IPCResult RecvClose() override;
   virtual mozilla::ipc::IPCResult RecvRequestDelete() override;
 
-  uint32_t GetAppId();
-  bool GetInIsolatedMozBrowser();
-
   void AddIPDLReference();
   void ReleaseIPDLReference();
 
   void OnConnect(TCPServerSocketEvent* event);
 
 private:
   ~TCPServerSocketParent();
 
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -28,20 +28,16 @@
 #include "nsISupportsPrimitives.h"
 #include "nsITransport.h"
 #include "nsIOutputStream.h"
 #include "nsINSSErrorsService.h"
 #include "nsISSLSocketControl.h"
 #include "nsStringStream.h"
 #include "secerr.h"
 #include "sslerr.h"
-#ifdef MOZ_WIDGET_GONK
-#include "nsINetworkManager.h"
-#include "nsINetworkInterface.h"
-#endif
 
 #define BUFFER_SIZE 65536
 #define NETWORK_STATS_THRESHOLD 65536
 
 using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTION(LegacyMozTCPSocket, mGlobal)
 
@@ -157,20 +153,16 @@ TCPSocket::TCPSocket(nsIGlobalObject* aG
   , mAsyncCopierActive(false)
   , mWaitingForDrain(false)
   , mInnerWindowID(0)
   , mBufferedAmount(0)
   , mSuspendCount(0)
   , mTrackingNumber(0)
   , mWaitingForStartTLS(false)
   , mObserversActive(false)
-#ifdef MOZ_WIDGET_GONK
-  , mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID)
-  , mInIsolatedMozBrowser(false)
-#endif
 {
   if (aGlobal) {
     nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal);
     if (window) {
       mInnerWindowID = window->WindowID();
     }
   }
 }
@@ -317,23 +309,16 @@ TCPSocket::InitWithTransport(nsISocketTr
 
   nsAutoCString host;
   mTransport->GetHost(host);
   mHost = NS_ConvertUTF8toUTF16(host);
   int32_t port;
   mTransport->GetPort(&port);
   mPort = port;
 
-#ifdef MOZ_WIDGET_GONK
-  nsCOMPtr<nsINetworkManager> networkManager = do_GetService("@mozilla.org/network/manager;1");
-  if (networkManager) {
-    networkManager->GetActiveNetworkInfo(getter_AddRefs(mActiveNetworkInfo));
-  }
-#endif
-
   return NS_OK;
 }
 
 void
 TCPSocket::UpgradeToSecure(mozilla::ErrorResult& aRv)
 {
   if (mReadyState != TCPReadyState::Open) {
     aRv.Throw(NS_ERROR_FAILURE);
@@ -1133,25 +1118,16 @@ TCPSocket::OnStopRequest(nsIRequest* aRe
 }
 
 void
 TCPSocket::SetSocketBridgeParent(TCPSocketParent* aBridgeParent)
 {
   mSocketBridgeParent = aBridgeParent;
 }
 
-void
-TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedMozBrowser)
-{
-#ifdef MOZ_WIDGET_GONK
-  mAppId = aAppId;
-  mInIsolatedMozBrowser = aInIsolatedMozBrowser;
-#endif
-}
-
 NS_IMETHODIMP
 TCPSocket::UpdateReadyState(uint32_t aReadyState)
 {
   MOZ_ASSERT(mSocketBridgeChild);
   mReadyState = static_cast<TCPReadyState>(aReadyState);
   return NS_OK;
 }
 
--- a/dom/network/TCPSocket.h
+++ b/dom/network/TCPSocket.h
@@ -132,18 +132,16 @@ public:
   // Used by the TCPServerSocket implementation when a new connection is accepted.
   static already_AddRefed<TCPSocket>
   CreateAcceptedSocket(nsIGlobalObject* aGlobal, nsISocketTransport* aTransport, bool aUseArrayBuffers);
   // Create a TCPSocket object from an existing child-side IPC actor.
   // Used by the TCPServerSocketChild implementation when a new connection is accepted.
   static already_AddRefed<TCPSocket>
   CreateAcceptedSocket(nsIGlobalObject* aGlobal, TCPSocketChild* aSocketBridge, bool aUseArrayBuffers);
 
-  // Initialize this socket's associated app and browser information.
-  void SetAppIdAndBrowser(uint32_t aAppId, bool aInBrowser);
   // Initialize this socket's associated IPC actor in the parent process.
   void SetSocketBridgeParent(TCPSocketParent* aBridgeParent);
 
   static bool SocketEnabled();
 
   IMPL_EVENT_HANDLER(open);
   IMPL_EVENT_HANDLER(drain);
   IMPL_EVENT_HANDLER(data);
@@ -237,23 +235,14 @@ private:
   bool mWaitingForStartTLS;
   // The buffered data awaiting the TLS upgrade to finish.
   nsTArray<nsCOMPtr<nsIInputStream>> mPendingDataAfterStartTLS;
 
   // The data to be sent while AsyncCopier is still active.
   nsTArray<nsCOMPtr<nsIInputStream>> mPendingDataWhileCopierActive;
 
   bool mObserversActive;
-
-#ifdef MOZ_WIDGET_GONK
-  // The app that owns this socket.
-  uint32_t mAppId;
-  // Was this socket created inside of an isolated browser frame?
-  bool mInIsolatedMozBrowser;
-  // The name of the active network used by this socket.
-  nsCOMPtr<nsINetworkInfo> mActiveNetworkInfo;
-#endif
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_TCPSocket_h
--- a/dom/network/TCPSocketParent.cpp
+++ b/dom/network/TCPSocketParent.cpp
@@ -64,34 +64,16 @@ TCPSocketParentBase::TCPSocketParentBase
 : mIPCOpen(false)
 {
 }
 
 TCPSocketParentBase::~TCPSocketParentBase()
 {
 }
 
-uint32_t
-TCPSocketParent::GetAppId()
-{
-  return nsIScriptSecurityManager::UNKNOWN_APP_ID;
-};
-
-bool
-TCPSocketParent::GetInIsolatedMozBrowser()
-{
-  const PContentParent *content = Manager()->Manager();
-  if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
-    TabParent *tab = TabParent::GetFrom(browser);
-    return tab->IsIsolatedMozBrowserElement();
-  } else {
-    return false;
-  }
-}
-
 void
 TCPSocketParentBase::ReleaseIPDLReference()
 {
   MOZ_ASSERT(mIPCOpen);
   mIPCOpen = false;
   this->Release();
 }
 
@@ -112,22 +94,17 @@ NS_IMETHODIMP_(MozExternalRefCountType) 
   }
   return refcnt;
 }
 
 mozilla::ipc::IPCResult
 TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bool& aUseSSL,
                           const bool& aUseArrayBuffers)
 {
-  // Obtain App ID
-  uint32_t appId = GetAppId();
-  bool     inIsolatedMozBrowser = GetInIsolatedMozBrowser();
-
   mSocket = new TCPSocket(nullptr, aHost, aPort, aUseSSL, aUseArrayBuffers);
-  mSocket->SetAppIdAndBrowser(appId, inIsolatedMozBrowser);
   mSocket->SetSocketBridgeParent(this);
   NS_ENSURE_SUCCESS(mSocket->Init(), IPC_OK());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 TCPSocketParent::RecvOpenBind(const nsCString& aRemoteHost,
                               const uint16_t& aRemotePort,
@@ -199,25 +176,17 @@ TCPSocketParent::RecvOpenBind(const nsCS
     rv = filterHandler->NewFilter(getter_AddRefs(mFilter));
     if (NS_FAILED(rv)) {
       NS_ERROR("Cannot create filter that content specified");
       FireInteralError(this, __LINE__);
       return IPC_OK();
     }
   }
 
-  bool     inIsolatedMozBrowser = false;
-  const PContentParent *content = Manager()->Manager();
-  if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
-    TabParent *tab = TabParent::GetFrom(browser);
-    inIsolatedMozBrowser = tab->IsIsolatedMozBrowserElement();
-  }
-
   mSocket = new TCPSocket(nullptr, NS_ConvertUTF8toUTF16(aRemoteHost), aRemotePort, aUseSSL, aUseArrayBuffers);
-  mSocket->SetAppIdAndBrowser(nsIScriptSecurityManager::NO_APP_ID, inIsolatedMozBrowser);
   mSocket->SetSocketBridgeParent(this);
   rv = mSocket->InitWithUnconnectedTransport(socketTransport);
   NS_ENSURE_SUCCESS(rv, IPC_OK());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 TCPSocketParent::RecvStartTLS()
--- a/dom/network/TCPSocketParent.h
+++ b/dom/network/TCPSocketParent.h
@@ -61,29 +61,27 @@ public:
 
   virtual mozilla::ipc::IPCResult RecvStartTLS() override;
   virtual mozilla::ipc::IPCResult RecvSuspend() override;
   virtual mozilla::ipc::IPCResult RecvResume() override;
   virtual mozilla::ipc::IPCResult RecvClose() override;
   virtual mozilla::ipc::IPCResult RecvData(const SendableData& aData,
                                            const uint32_t& aTrackingNumber) override;
   virtual mozilla::ipc::IPCResult RecvRequestDelete() override;
-  bool GetInIsolatedMozBrowser();
 
   void FireErrorEvent(const nsAString& aName, const nsAString& aType, TCPReadyState aReadyState);
   void FireEvent(const nsAString& aType, TCPReadyState aReadyState);
   void FireArrayBufferDataEvent(nsTArray<uint8_t>& aBuffer, TCPReadyState aReadyState);
   void FireStringDataEvent(const nsACString& aData, TCPReadyState aReadyState);
 
   void SetSocket(TCPSocket *socket);
   nsresult GetHost(nsAString& aHost);
   nsresult GetPort(uint16_t* aPort);
 
 private:
-  virtual uint32_t GetAppId();
   virtual void ActorDestroy(ActorDestroyReason why) override;
   void SendEvent(const nsAString& aType, CallbackData aData, TCPReadyState aReadyState);
   nsresult SetFilter(const nsCString& aFilter);
 
   nsCOMPtr<nsISocketFilter> mFilter;
 };
 
 } // namespace dom
--- a/dom/performance/Performance.cpp
+++ b/dom/performance/Performance.cpp
@@ -22,21 +22,17 @@
 #include "mozilla/dom/PerformanceEntryEvent.h"
 #include "mozilla/dom/PerformanceNavigationBinding.h"
 #include "mozilla/dom/PerformanceObserverBinding.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Preferences.h"
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 
-#ifdef MOZ_WIDGET_GONK
-#define PERFLOG(msg, ...)  __android_log_print(ANDROID_LOG_INFO, "PerformanceTiming", msg, ##__VA_ARGS__)
-#else
 #define PERFLOG(msg, ...) printf_stderr(msg, ##__VA_ARGS__)
-#endif
 
 namespace mozilla {
 namespace dom {
 
 using namespace workers;
 
 namespace {
 
--- a/dom/presentation/PresentationSessionInfo.cpp
+++ b/dom/presentation/PresentationSessionInfo.cpp
@@ -25,21 +25,16 @@
 #include "PresentationLog.h"
 #include "PresentationService.h"
 #include "PresentationSessionInfo.h"
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "nsIPresentationNetworkHelper.h"
 #endif // MOZ_WIDGET_ANDROID
 
-#ifdef MOZ_WIDGET_GONK
-#include "nsINetworkInterface.h"
-#include "nsINetworkManager.h"
-#endif
-
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::services;
 
 /*
  * Implementation of PresentationChannelDescription
  */
 
@@ -645,60 +640,17 @@ PresentationControllingInfo::Shutdown(ns
     Unused << NS_WARN_IF(NS_FAILED(mServerSocket->Close()));
     mServerSocket = nullptr;
   }
 }
 
 nsresult
 PresentationControllingInfo::GetAddress()
 {
-#if defined(MOZ_WIDGET_GONK)
-  nsCOMPtr<nsINetworkManager> networkManager =
-    do_GetService("@mozilla.org/network/manager;1");
-  if (NS_WARN_IF(!networkManager)) {
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  nsCOMPtr<nsINetworkInfo> activeNetworkInfo;
-  networkManager->GetActiveNetworkInfo(getter_AddRefs(activeNetworkInfo));
-  if (NS_WARN_IF(!activeNetworkInfo)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  char16_t** ips = nullptr;
-  uint32_t* prefixes = nullptr;
-  uint32_t count = 0;
-  activeNetworkInfo->GetAddresses(&ips, &prefixes, &count);
-  if (NS_WARN_IF(!count)) {
-    NS_Free(prefixes);
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips);
-    return NS_ERROR_FAILURE;
-  }
-
-  // TODO bug 1228504 Take all IP addresses in PresentationChannelDescription
-  // into account. And at the first stage Presentation API is only exposed on
-  // Firefox OS where the first IP appears enough for most scenarios.
-
-  nsAutoString ip;
-  ip.Assign(ips[0]);
-
-  // On Android platform, the IP address is retrieved from a callback function.
-  // To make consistent code sequence, following function call is dispatched
-  // into main thread instead of calling it directly.
-  NS_DispatchToMainThread(
-    NewRunnableMethod<nsCString>(
-      "dom::PresentationControllingInfo::OnGetAddress",
-      this,
-      &PresentationControllingInfo::OnGetAddress,
-      NS_ConvertUTF16toUTF8(ip)));
-
-  NS_Free(prefixes);
-  NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips);
-
-#elif defined(MOZ_WIDGET_ANDROID)
+#if defined(MOZ_WIDGET_ANDROID)
   RefPtr<PresentationNetworkHelper> networkHelper =
     new PresentationNetworkHelper(this,
                                   &PresentationControllingInfo::OnGetAddress);
   nsresult rv = networkHelper->GetWifiIPAddress();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
--- a/dom/presentation/provider/PresentationDeviceProviderModule.cpp
+++ b/dom/presentation/provider/PresentationDeviceProviderModule.cpp
@@ -23,17 +23,17 @@ static const mozilla::Module::CIDEntry k
 };
 
 static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContracts[] = {
   { MULTICAST_DNS_PROVIDER_CONTRACT_ID, &kMULTICAST_DNS_PROVIDER_CID },
   { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kPresentationDeviceProviderCategories[] = {
-#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID) || (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16)
+#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID)
   { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", MULTICAST_DNS_PROVIDER_CONTRACT_ID },
 #endif
   { nullptr }
 };
 
 static const mozilla::Module kPresentationDeviceProviderModule = {
   mozilla::Module::kVersion,
   kPresentationDeviceProviderCIDs,
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -920,43 +920,32 @@ bool DefineOSFileConstants(JSContext *cx
 
   // Build OS.Constants.Sys
 
   JS::Rooted<JSObject*> objSys(cx);
   if (!(objSys = GetOrCreateObjectProperty(cx, objConstants, "Sys"))) {
     return false;
   }
 
-#if defined(MOZ_WIDGET_GONK)
-    JSString* strVersion = JS_NewStringCopyZ(cx, "Gonk");
-    if (!strVersion){
-      return false;
-    }
-    JS::Rooted<JS::Value> valVersion(cx, JS::StringValue(strVersion));
-    if (!JS_SetProperty(cx, objSys, "Name", valVersion)) {
-      return false;
-  }
-#else
   nsCOMPtr<nsIXULRuntime> runtime = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
   if (runtime) {
     nsAutoCString os;
     DebugOnly<nsresult> rv = runtime->GetOS(os);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
 
     JSString* strVersion = JS_NewStringCopyZ(cx, os.get());
     if (!strVersion) {
       return false;
     }
 
     JS::Rooted<JS::Value> valVersion(cx, JS::StringValue(strVersion));
     if (!JS_SetProperty(cx, objSys, "Name", valVersion)) {
       return false;
     }
   }
-#endif // defined(MOZ_WIDGET_GONK)
 
 #if defined(DEBUG)
   JS::Rooted<JS::Value> valDebug(cx, JS::TrueValue());
   if (!JS_SetProperty(cx, objSys, "DEBUG", valDebug)) {
     return false;
   }
 #endif