From 6571d2ceb42930dab01677ef0e95e732d5076fb8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 12 May 2018 16:19:33 +0200 Subject: Remove MOZ_WIDGET_GONK [1/2] Tag #288 --- config/system-headers | 3 - dom/apps/AppsUtils.jsm | 3 - dom/audiochannel/AudioChannelService.cpp | 32 ----- dom/audiochannel/AudioChannelService.h | 22 ---- dom/base/Navigator.cpp | 6 - dom/base/ScreenOrientation.cpp | 2 +- dom/base/nsContentPermissionHelper.cpp | 3 - dom/base/nsGlobalWindow.cpp | 10 +- dom/base/nsGlobalWindow.h | 8 +- dom/base/nsPIDOMWindow.h | 2 +- dom/canvas/CanvasRenderingContext2D.cpp | 4 - dom/canvas/WebGLContext.cpp | 28 ----- dom/events/EventListenerManager.cpp | 8 +- dom/events/EventNameList.h | 2 +- dom/geolocation/nsGeolocation.cpp | 13 -- dom/html/nsIFormControl.h | 4 +- dom/indexedDB/ActorsParent.cpp | 2 +- dom/ipc/ContentChild.cpp | 52 +------- dom/ipc/ContentParent.cpp | 137 +-------------------- dom/network/TCPSocket.cpp | 72 +---------- dom/network/TCPSocket.h | 17 --- dom/plugins/base/PluginPRLibrary.cpp | 6 - dom/plugins/base/PluginPRLibrary.h | 2 +- dom/plugins/base/nsNPAPIPlugin.cpp | 1 - dom/plugins/ipc/PluginLibrary.h | 2 +- dom/plugins/ipc/PluginModuleParent.cpp | 4 +- dom/plugins/ipc/PluginModuleParent.h | 4 +- dom/presentation/PresentationSessionInfo.cpp | 49 +------- .../provider/PresentationDeviceProviderModule.cpp | 5 +- dom/system/OSFileConstants.cpp | 11 -- dom/webidl/Window.webidl | 2 +- hal/Hal.cpp | 6 - hal/linux/LinuxPower.cpp | 31 ----- layout/base/nsCSSFrameConstructor.cpp | 2 +- layout/build/nsLayoutModule.cpp | 85 ------------- layout/build/nsLayoutStatics.cpp | 9 -- security/manager/pki/nsNSSDialogHelper.cpp | 6 - tools/profiler/core/GeckoSampler.cpp | 8 +- tools/profiler/core/platform.cpp | 21 +--- tools/profiler/core/platform.h | 5 +- tools/profiler/core/shared-libraries-linux.cc | 18 +-- tools/profiler/gecko/SaveProfileTask.cpp | 2 +- tools/profiler/lul/AutoObjectMapper.cpp | 6 +- tools/profiler/lul/AutoObjectMapper.h | 4 +- tools/profiler/lul/platform-linux-lul.cpp | 2 +- tools/profiler/public/GeckoProfilerImpl.h | 7 -- xpcom/base/nsMemoryReporterManager.cpp | 4 - xpcom/base/nsSystemInfo.cpp | 44 ------- xpcom/build/BinaryPath.h | 5 - xpcom/build/XPCOMInit.cpp | 11 -- xpcom/build/XREChildData.h | 2 +- xpcom/glue/FileUtils.h | 11 +- xpcom/threads/ThreadStackHelper.cpp | 5 - 53 files changed, 60 insertions(+), 750 deletions(-) diff --git a/config/system-headers b/config/system-headers index be3162f58..683c9d337 100644 --- a/config/system-headers +++ b/config/system-headers @@ -391,9 +391,6 @@ DiskInit.h dlfcn.h dlgs.h dl.h -#ifdef MOZ_WIDGET_GONK -dns_sd.h -#endif docobj.h dos/dosextens.h dos.h diff --git a/dom/apps/AppsUtils.jsm b/dom/apps/AppsUtils.jsm index 3ca3f8552..2bd6a4133 100644 --- a/dom/apps/AppsUtils.jsm +++ b/dom/apps/AppsUtils.jsm @@ -312,9 +312,6 @@ this.AppsUtils = { // Instead, we check if the app is installed under /system/b2g let isCoreApp = false; -#ifdef MOZ_WIDGET_GONK - isCoreApp = app.basePath == this.getCoreAppsBasePath(); -#endif debug(app.basePath + " isCoreApp: " + isCoreApp); return { "path": app.basePath + "/" + app.id, diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index 87cde41e9..db6f2037b 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -27,11 +27,6 @@ #include "nsServiceManagerUtils.h" #include "mozilla/dom/SettingChangeNotificationBinding.h" -#ifdef MOZ_WIDGET_GONK -#include "nsJSUtils.h" -#include "SpeakerManagerService.h" -#endif - #include "mozilla/Preferences.h" using namespace mozilla; @@ -237,20 +232,12 @@ AudioChannelService::Shutdown() if (IsParentProcess()) { obs->RemoveObserver(gAudioChannelService, "ipc:content-shutdown"); - -#ifdef MOZ_WIDGET_GONK - // To monitor the volume settings based on audio channel. - obs->RemoveObserver(gAudioChannelService, "mozsettings-changed"); -#endif } } gAudioChannelService->mWindows.Clear(); gAudioChannelService->mPlayingChildren.Clear(); gAudioChannelService->mTabParents.Clear(); -#ifdef MOZ_WIDGET_GONK - gAudioChannelService->mSpeakerManager.Clear(); -#endif gAudioChannelService = nullptr; } @@ -284,11 +271,6 @@ AudioChannelService::AudioChannelService() obs->AddObserver(this, "outer-window-destroyed", false); if (IsParentProcess()) { obs->AddObserver(this, "ipc:content-shutdown", false); - -#ifdef MOZ_WIDGET_GONK - // To monitor the volume settings based on audio channel. - obs->AddObserver(this, "mozsettings-changed", false); -#endif } } @@ -342,13 +324,6 @@ AudioChannelService::UnregisterAudioChannelAgent(AudioChannelAgent* aAgent) RefPtr kungFuDeathGrip(aAgent); winData->RemoveAgent(aAgent); -#ifdef MOZ_WIDGET_GONK - bool active = AnyAudioChannelIsActive(); - for (uint32_t i = 0; i < mSpeakerManager.Length(); i++) { - mSpeakerManager[i]->SetAudioChannelActive(active); - } -#endif - MaybeSendStatusUpdate(); } @@ -573,13 +548,6 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic, iter.GetNext()->WindowVolumeChanged(); } } - -#ifdef MOZ_WIDGET_GONK - bool active = AnyAudioChannelIsActive(); - for (uint32_t i = 0; i < mSpeakerManager.Length(); i++) { - mSpeakerManager[i]->SetAudioChannelActive(active); - } -#endif } else if (!strcmp(aTopic, "ipc:content-shutdown")) { nsCOMPtr props = do_QueryInterface(aSubject); if (!props) { diff --git a/dom/audiochannel/AudioChannelService.h b/dom/audiochannel/AudioChannelService.h index b16832b5f..7d3de8a46 100644 --- a/dom/audiochannel/AudioChannelService.h +++ b/dom/audiochannel/AudioChannelService.h @@ -25,10 +25,6 @@ struct PRLogModuleInfo; namespace mozilla { namespace dom { -#ifdef MOZ_WIDGET_GONK -class SpeakerManagerService; -#endif - class TabParent; #define NUMBER_OF_AUDIO_CHANNELS (uint32_t)AudioChannel::EndGuard_ @@ -189,20 +185,6 @@ public: uint64_t aInnerWindowID, bool aCapture); -#ifdef MOZ_WIDGET_GONK - void RegisterSpeakerManager(SpeakerManagerService* aSpeakerManager) - { - if (!mSpeakerManager.Contains(aSpeakerManager)) { - mSpeakerManager.AppendElement(aSpeakerManager); - } - } - - void UnregisterSpeakerManager(SpeakerManagerService* aSpeakerManager) - { - mSpeakerManager.RemoveElement(aSpeakerManager); - } -#endif - static const nsAttrValue::EnumTable* GetAudioChannelTable(); static AudioChannel GetAudioChannel(const nsAString& aString); static AudioChannel GetDefaultAudioChannel(); @@ -347,10 +329,6 @@ private: nsTObserverArray> mPlayingChildren; -#ifdef MOZ_WIDGET_GONK - nsTArray mSpeakerManager; -#endif - // Raw pointers because TabParents must unregister themselves. nsTArray mTabParents; diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 5c315517c..ed96ee23b 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -767,12 +767,6 @@ StaticRefPtr gVibrateWindowListener; static bool MayVibrate(nsIDocument* doc) { -#if MOZ_WIDGET_GONK - if (XRE_IsParentProcess()) { - return true; // The system app can always vibrate - } -#endif // MOZ_WIDGET_GONK - // Hidden documents cannot start or stop a vibration. return (doc && !doc->Hidden()); } diff --git a/dom/base/ScreenOrientation.cpp b/dom/base/ScreenOrientation.cpp index bb3ccf5c3..ec9c4fa29 100644 --- a/dom/base/ScreenOrientation.cpp +++ b/dom/base/ScreenOrientation.cpp @@ -309,7 +309,7 @@ ScreenOrientation::LockInternal(ScreenOrientationInternal aOrientation, ErrorRes return nullptr; } -#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) +#if !defined(MOZ_WIDGET_ANDROID) // User agent does not support locking the screen orientation. p->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return p.forget(); diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index fd04b1013..c57fc6233 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -5,9 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include -#ifdef MOZ_WIDGET_GONK -#include "GonkPermission.h" -#endif // MOZ_WIDGET_GONK #include "nsCOMPtr.h" #include "nsIDOMElement.h" #include "nsIPrincipal.h" diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 9663a6dbf..4e384c4d2 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -25,7 +25,7 @@ #include "mozilla/dom/Timeout.h" #include "mozilla/dom/TimeoutHandler.h" #include "mozilla/IntegerPrintfMacros.h" -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) #include "mozilla/dom/WindowOrientationObserver.h" #endif #include "nsDOMOfflineResourceList.h" @@ -1948,7 +1948,7 @@ nsGlobalWindow::CleanUp() mSpeechSynthesis = nullptr; #endif -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) mOrientationChangeObserver = nullptr; #endif @@ -2076,7 +2076,7 @@ nsGlobalWindow::FreeInnerObjects() mScreen = nullptr; } -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) mOrientationChangeObserver = nullptr; #endif @@ -14009,7 +14009,7 @@ nsGlobalWindow::DisableDeviceSensor(uint32_t aType) } } -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) void nsGlobalWindow::EnableOrientationChangeListener() { @@ -14902,7 +14902,7 @@ nsGlobalWindow::IsModalContentWindow(JSContext* aCx, JSObject* aGlobal) return xpc::WindowOrNull(aGlobal)->IsModalContentWindow(); } -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) int16_t nsGlobalWindow::Orientation(CallerType aCallerType) const { diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 94d565bf3..467bc6796 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -138,7 +138,7 @@ class U2F; class VRDisplay; class VREventObserver; class WakeLock; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) class WindowOrientationObserver; #endif class Worklet; @@ -631,7 +631,7 @@ public: virtual void EnableDeviceSensor(uint32_t aType) override; virtual void DisableDeviceSensor(uint32_t aType) override; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) virtual void EnableOrientationChangeListener() override; virtual void DisableOrientationChangeListener() override; #endif @@ -905,7 +905,7 @@ public: nsIDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError); already_AddRefed GetApplicationCache() override; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) int16_t Orientation(mozilla::dom::CallerType aCallerType) const; #endif @@ -1971,7 +1971,7 @@ protected: nsTArray mEnabledSensors; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) nsAutoPtr mOrientationChangeObserver; #endif diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 3fd666beb..47affbb06 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -444,7 +444,7 @@ public: */ virtual void DisableDeviceSensor(uint32_t aType) = 0; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) virtual void EnableOrientationChangeListener() = 0; virtual void DisableOrientationChangeListener() = 0; #endif diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index a38c38293..f4c4259f6 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -141,10 +141,6 @@ using mozilla::gl::GLContextProvider; #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 diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 176d56f8c..2a92084b4 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -51,10 +51,6 @@ #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" @@ -545,30 +541,6 @@ BaseCaps(const WebGLContextOptions& options, WebGLContext* webgl) // 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()) { diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index ae8bf1b1a..fe896870c 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -352,7 +352,7 @@ EventListenerManager::AddEventListenerInternal( 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 @@ -481,7 +481,7 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage) case eDeviceLight: case eDeviceProximity: case eUserProximity: -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) case eOrientationChange: #endif return true; @@ -529,7 +529,7 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage) 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; @@ -575,7 +575,7 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage) 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; diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 3f0af9fe9..214b844e7 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -563,7 +563,7 @@ 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, diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp index 9fcdb350a..2d84a3e11 100644 --- a/dom/geolocation/nsGeolocation.cpp +++ b/dom/geolocation/nsGeolocation.cpp @@ -33,10 +33,6 @@ class nsIPrincipal; #include "AndroidLocationProvider.h" #endif -#ifdef MOZ_WIDGET_GONK -#include "GonkGPSGeolocationProvider.h" -#endif - #ifdef MOZ_GPSD #include "GpsdLocationProvider.h" #endif @@ -688,15 +684,6 @@ nsresult nsGeolocationService::Init() mProvider = new AndroidLocationProvider(); #endif -#ifdef MOZ_WIDGET_GONK - // GonkGPSGeolocationProvider can be started at boot up time for initialization reasons. - // do_getService gets hold of the already initialized component and starts - // processing location requests immediately. - // do_Createinstance will create multiple instances of the provider which is not right. - // bug 993041 - mProvider = do_GetService(GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID); -#endif - #ifdef MOZ_WIDGET_GTK #ifdef MOZ_GPSD if (Preferences::GetBool("geo.provider.use_gpsd", false)) { diff --git a/dom/html/nsIFormControl.h b/dom/html/nsIFormControl.h index e07f7c829..34380bc67 100644 --- a/dom/html/nsIFormControl.h +++ b/dom/html/nsIFormControl.h @@ -267,8 +267,8 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType) 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) - // On Android/B2G, date/time input appears as a normal text box. +#if defined(MOZ_WIDGET_ANDROID) + // On Android, date/time input appears as a normal text box. aType == NS_FORM_INPUT_TIME || aType == NS_FORM_INPUT_DATE || #endif diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 39e039c0f..9678fb49f 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -121,7 +121,7 @@ LogLevel::Debug, \ _args ) -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) #define IDB_MOBILE #endif diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index d7068c6c3..9e1c7e8cb 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -137,12 +137,6 @@ #include "APKOpen.h" #endif -#if defined(MOZ_WIDGET_GONK) -#include "nsVolume.h" -#include "nsVolumeService.h" -#include "SpeakerManagerService.h" -#endif - #ifdef XP_WIN #include #define getpid _getpid @@ -196,9 +190,6 @@ using namespace mozilla::net; using namespace mozilla::jsipc; using namespace mozilla::psm; using namespace mozilla::widget; -#if defined(MOZ_WIDGET_GONK) -using namespace mozilla::system; -#endif using namespace mozilla::widget; namespace mozilla { @@ -585,15 +576,7 @@ ContentChild::Init(MessageLoop* aIOLoop, void ContentChild::InitProcessAttributes() { -#ifdef MOZ_WIDGET_GONK - if (mIsForApp && !mIsForBrowser) { - SetProcessName(NS_LITERAL_STRING("(Preallocated app)"), false); - } else { - SetProcessName(NS_LITERAL_STRING("Browser"), false); - } -#else SetProcessName(NS_LITERAL_STRING("Web Content"), true); -#endif } void @@ -1257,15 +1240,6 @@ ContentChild::RecvNotifyLayerAllocated(const dom::TabId& aTabId, const uint64_t& bool ContentChild::RecvSpeakerManagerNotify() { -#ifdef MOZ_WIDGET_GONK - // Only notify the process which has the SpeakerManager instance. - RefPtr service = - SpeakerManagerService::GetSpeakerManagerService(); - if (service) { - service->Notify(); - } - return true; -#endif return false; } @@ -2284,12 +2258,6 @@ ContentChild::RecvLastPrivateDocShellDestroyed() bool ContentChild::RecvVolumes(nsTArray&& aVolumes) { -#ifdef MOZ_WIDGET_GONK - RefPtr vs = nsVolumeService::GetSingleton(); - if (vs) { - vs->RecvVolumesFromParent(aVolumes); - } -#endif return true; } @@ -2306,17 +2274,6 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName, const bool& aIsRemovable, const bool& aIsHotSwappable) { -#ifdef MOZ_WIDGET_GONK - RefPtr volume = new nsVolume(aFsName, aVolumeName, aState, - aMountGeneration, aIsMediaPresent, - aIsSharing, aIsFormatting, aIsFake, - aIsUnmounting, aIsRemovable, aIsHotSwappable); - - RefPtr vs = nsVolumeService::GetSingleton(); - if (vs) { - vs->UpdateVolume(volume); - } -#else // Remove warnings about unused arguments Unused << aFsName; Unused << aVolumeName; @@ -2329,22 +2286,15 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName, Unused << aIsUnmounting; Unused << aIsRemovable; Unused << aIsHotSwappable; -#endif + return true; } bool ContentChild::RecvVolumeRemoved(const nsString& aFsName) { -#ifdef MOZ_WIDGET_GONK - RefPtr vs = nsVolumeService::GetSingleton(); - if (vs) { - vs->RemoveVolumeByName(aFsName); - } -#else // Remove warnings about unused arguments Unused << aFsName; -#endif return true; } diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 582490d7b..8b9ab4442 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -16,11 +16,6 @@ # include #endif -#ifdef MOZ_WIDGET_GONK -#include -#include -#endif - #include "chrome/common/process_watcher.h" #include "mozilla/a11y/PDocAccessible.h" @@ -210,14 +205,6 @@ # include "AndroidBridge.h" #endif -#ifdef MOZ_WIDGET_GONK -#include "nsIVolume.h" -#include "nsVolumeService.h" -#include "nsIVolumeService.h" -#include "SpeakerManagerService.h" -using namespace mozilla::system; -#endif - #ifdef MOZ_WIDGET_GTK #include #endif @@ -526,11 +513,6 @@ static const char* sObserverTopics[] = { "child-mmu-request", "last-pb-context-exited", "file-watcher-update", -#ifdef MOZ_WIDGET_GONK - NS_VOLUME_STATE_CHANGED, - NS_VOLUME_REMOVED, - "phone-state-changed", -#endif #ifdef ACCESSIBILITY "a11y-init-or-shutdown", #endif @@ -1355,14 +1337,6 @@ ContentParent::ForwardKnownInfo() if (!mMetamorphosed) { return; } -#ifdef MOZ_WIDGET_GONK - InfallibleTArray volumeInfo; - RefPtr vs = nsVolumeService::GetSingleton(); - if (vs) { - vs->GetVolumesForIPC(&volumeInfo); - Unused << SendVolumes(volumeInfo); - } -#endif /* MOZ_WIDGET_GONK */ } namespace { @@ -1410,23 +1384,6 @@ bool ContentParent::SetPriorityAndCheckIsAlive(ProcessPriority aPriority) { ProcessPriorityManager::SetProcessPriority(this, aPriority); - - // Now that we've set this process's priority, check whether the process is - // still alive. Hopefully we've set the priority to FOREGROUND*, so the - // process won't unexpectedly crash after this point! - // - // Bug 943174: use waitid() with WNOWAIT so that, if the process - // did exit, we won't consume its zombie and confuse the - // GeckoChildProcessHost dtor. -#ifdef MOZ_WIDGET_GONK - siginfo_t info; - info.si_pid = 0; - if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0 - && info.si_pid != 0) { - return false; - } -#endif - return true; } @@ -2686,50 +2643,6 @@ ContentParent::Observe(nsISupports* aSubject, else if (!strcmp(aTopic, "last-pb-context-exited")) { Unused << SendLastPrivateDocShellDestroyed(); } -#ifdef MOZ_WIDGET_GONK - else if(!strcmp(aTopic, NS_VOLUME_STATE_CHANGED)) { - nsCOMPtr vol = do_QueryInterface(aSubject); - if (!vol) { - return NS_ERROR_NOT_AVAILABLE; - } - - nsString volName; - nsString mountPoint; - int32_t state; - int32_t mountGeneration; - bool isMediaPresent; - bool isSharing; - bool isFormatting; - bool isFake; - bool isUnmounting; - bool isRemovable; - bool isHotSwappable; - - vol->GetName(volName); - vol->GetMountPoint(mountPoint); - vol->GetState(&state); - vol->GetMountGeneration(&mountGeneration); - vol->GetIsMediaPresent(&isMediaPresent); - vol->GetIsSharing(&isSharing); - vol->GetIsFormatting(&isFormatting); - vol->GetIsFake(&isFake); - vol->GetIsUnmounting(&isUnmounting); - vol->GetIsRemovable(&isRemovable); - vol->GetIsHotSwappable(&isHotSwappable); - - Unused << SendFileSystemUpdate(volName, mountPoint, state, - mountGeneration, isMediaPresent, - isSharing, isFormatting, isFake, - isUnmounting, isRemovable, isHotSwappable); - } else if (!strcmp(aTopic, "phone-state-changed")) { - nsString state(aData); - Unused << SendNotifyPhoneStateChange(state); - } - else if(!strcmp(aTopic, NS_VOLUME_REMOVED)) { - nsString volName(aData); - Unused << SendVolumeRemoved(volName); - } -#endif #ifdef ACCESSIBILITY else if (aData && !strcmp(aTopic, "a11y-init-or-shutdown")) { if (*aData == '1') { @@ -3398,29 +3311,12 @@ ContentParent::RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor) bool ContentParent::RecvSpeakerManagerGetSpeakerStatus(bool* aValue) { -#ifdef MOZ_WIDGET_GONK - *aValue = false; - RefPtr service = - SpeakerManagerService::GetOrCreateSpeakerManagerService(); - MOZ_ASSERT(service); - - *aValue = service->GetSpeakerStatus(); - return true; -#endif return false; } bool ContentParent::RecvSpeakerManagerForceSpeaker(const bool& aEnable) { -#ifdef MOZ_WIDGET_GONK - RefPtr service = - SpeakerManagerService::GetOrCreateSpeakerManagerService(); - MOZ_ASSERT(service); - service->ForceSpeaker(aEnable, mChildID); - - return true; -#endif return false; } @@ -3976,49 +3872,22 @@ bool ContentParent::RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) { -#ifdef MOZ_WIDGET_GONK - nsresult rv; - nsCOMPtr vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv); - if (vs) { - vs->CreateFakeVolume(fsName, mountPoint); - } - return true; -#else - NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called when MOZ_WIDGET_GONK is not defined"); + NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called"); return false; -#endif } bool ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) { -#ifdef MOZ_WIDGET_GONK - nsresult rv; - nsCOMPtr vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv); - if (vs) { - vs->SetFakeVolumeState(fsName, fsState); - } - return true; -#else - NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called when MOZ_WIDGET_GONK is not defined"); + NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called"); return false; -#endif } bool ContentParent::RecvRemoveFakeVolume(const nsString& fsName) { -#ifdef MOZ_WIDGET_GONK - nsresult rv; - nsCOMPtr vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv); - if (vs) { - vs->RemoveFakeVolume(fsName); - } - return true; -#else - NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called when MOZ_WIDGET_GONK is not defined"); + NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called"); return false; -#endif } bool diff --git a/dom/network/TCPSocket.cpp b/dom/network/TCPSocket.cpp index 4eb2f72f6..38827a9ac 100644 --- a/dom/network/TCPSocket.cpp +++ b/dom/network/TCPSocket.cpp @@ -33,11 +33,6 @@ #include "nsStringStream.h" #include "secerr.h" #include "sslerr.h" -#ifdef MOZ_WIDGET_GONK -#include "nsINetworkStatsServiceProxy.h" -#include "nsINetworkManager.h" -#include "nsINetworkInterface.h" -#endif #define BUFFER_SIZE 65536 #define NETWORK_STATS_THRESHOLD 65536 @@ -163,12 +158,6 @@ TCPSocket::TCPSocket(nsIGlobalObject* aGlobal, const nsAString& aHost, uint16_t , mTrackingNumber(0) , mWaitingForStartTLS(false) , mObserversActive(false) -#ifdef MOZ_WIDGET_GONK - , mTxBytes(0) - , mRxBytes(0) - , mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID) - , mInIsolatedMozBrowser(false) -#endif { if (aGlobal) { nsCOMPtr window = do_QueryInterface(aGlobal); @@ -323,13 +312,6 @@ TCPSocket::InitWithTransport(nsISocketTransport* aTransport) mTransport->GetPort(&port); mPort = port; -#ifdef MOZ_WIDGET_GONK - nsCOMPtr networkManager = do_GetService("@mozilla.org/network/manager;1"); - if (networkManager) { - networkManager->GetActiveNetworkInfo(getter_AddRefs(mActiveNetworkInfo)); - } -#endif - return NS_OK; } @@ -651,12 +633,6 @@ TCPSocket::Resume(mozilla::ErrorResult& aRv) nsresult TCPSocket::MaybeReportErrorAndCloseIfOpen(nsresult status) { -#ifdef MOZ_WIDGET_GONK - // Save network statistics once the connection is closed. - // For now this function is Gonk-specific. - SaveNetworkStats(true); -#endif - // If we're closed, we've already reported the error or just don't need to // report the error. if (mReadyState == TCPReadyState::Closed) { @@ -941,12 +917,6 @@ TCPSocket::Send(nsIInputStream* aStream, uint32_t aByteLength) EnsureCopying(); -#ifdef MOZ_WIDGET_GONK - // Collect transmitted amount for network statistics. - mTxBytes += aByteLength; - SaveNetworkStats(false); -#endif - return !bufferFull; } @@ -1069,12 +1039,6 @@ NS_IMETHODIMP TCPSocket::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream, uint64_t aOffset, uint32_t aCount) { -#ifdef MOZ_WIDGET_GONK - // Collect received amount for network statistics. - mRxBytes += aCount; - SaveNetworkStats(false); -#endif - if (mUseArrayBuffers) { nsTArray buffer; buffer.SetCapacity(aCount); @@ -1160,10 +1124,7 @@ TCPSocket::SetSocketBridgeParent(TCPSocketParent* aBridgeParent) void TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedMozBrowser) { -#ifdef MOZ_WIDGET_GONK - mAppId = aAppId; - mInIsolatedMozBrowser = aInIsolatedMozBrowser; -#endif + /*** STUB ***/ } NS_IMETHODIMP @@ -1190,37 +1151,6 @@ TCPSocket::UpdateBufferedAmount(uint32_t aBufferedAmount, uint32_t aTrackingNumb return NS_OK; } -#ifdef MOZ_WIDGET_GONK -void -TCPSocket::SaveNetworkStats(bool aEnforce) -{ - if (!mTxBytes && !mRxBytes) { - // There is no traffic at all. No need to save statistics. - return; - } - - // If "enforce" is false, the traffic amount is saved to NetworkStatsServiceProxy - // only when the total amount exceeds the predefined threshold value. - // The purpose is to avoid too much overhead for collecting statistics. - uint32_t totalBytes = mTxBytes + mRxBytes; - if (!aEnforce && totalBytes < NETWORK_STATS_THRESHOLD) { - return; - } - - nsCOMPtr nssProxy = - do_GetService("@mozilla.org/networkstatsServiceProxy;1"); - if (!nssProxy) { - return; - } - - nssProxy->SaveAppStats(mAppId, mInIsolatedMozBrowser, mActiveNetworkInfo, - PR_Now(), mRxBytes, mTxBytes, false, nullptr); - - // Reset the counters once the statistics is saved to NetworkStatsServiceProxy. - mTxBytes = mRxBytes = 0; -} -#endif - NS_IMETHODIMP TCPSocket::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { diff --git a/dom/network/TCPSocket.h b/dom/network/TCPSocket.h index e98c03ca5..4ad425b9e 100644 --- a/dom/network/TCPSocket.h +++ b/dom/network/TCPSocket.h @@ -179,10 +179,6 @@ private: void ActivateTLS(); // Dispatch an error event if necessary, then dispatch a "close" event. nsresult MaybeReportErrorAndCloseIfOpen(nsresult status); -#ifdef MOZ_WIDGET_GONK - // Store and reset any saved network stats for this socket. - void SaveNetworkStats(bool aEnforce); -#endif // Helper for FireDataStringEvent/FireDataArrayEvent. nsresult FireDataEvent(JSContext* aCx, const nsAString& aType, @@ -246,19 +242,6 @@ private: nsTArray> mPendingDataWhileCopierActive; bool mObserversActive; - -#ifdef MOZ_WIDGET_GONK - // Number of bytes sent. - uint32_t mTxBytes; - // Number of bytes received. - uint32_t mRxBytes; - // 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 mActiveNetworkInfo; -#endif }; } // namespace dom diff --git a/dom/plugins/base/PluginPRLibrary.cpp b/dom/plugins/base/PluginPRLibrary.cpp index a7ad76ea4..ecc55d455 100644 --- a/dom/plugins/base/PluginPRLibrary.cpp +++ b/dom/plugins/base/PluginPRLibrary.cpp @@ -57,12 +57,6 @@ PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs, mNPP_GetSitesWithData = pFuncs->getsiteswithdata; return NS_OK; } -#elif defined(MOZ_WIDGET_GONK) -nsresult -PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) -{ - return NS_OK; -} #elif defined(XP_UNIX) && !defined(XP_MACOSX) nsresult PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs, diff --git a/dom/plugins/base/PluginPRLibrary.h b/dom/plugins/base/PluginPRLibrary.h index 602ad8cf8..ffd3de934 100644 --- a/dom/plugins/base/PluginPRLibrary.h +++ b/dom/plugins/base/PluginPRLibrary.h @@ -81,7 +81,7 @@ public: return true; } -#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) +#if defined(XP_UNIX) && !defined(XP_MACOSX) virtual nsresult NP_Initialize(NPNetscapeFuncs* aNetscapeFuncs, NPPluginFuncs* aFuncs, NPError* aError) override; #else diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 1bea269cd..697bfacd4 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -320,7 +320,6 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult) if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) { return NS_ERROR_FAILURE; } -#elif defined(MOZ_WIDGET_GONK) #else NPError pluginCallError; nsresult rv = pluginLib->NP_Initialize(&sBrowserFuncs, &plugin->mPluginFuncs, &pluginCallError); diff --git a/dom/plugins/ipc/PluginLibrary.h b/dom/plugins/ipc/PluginLibrary.h index c9499ee0d..2f9a3f81b 100644 --- a/dom/plugins/ipc/PluginLibrary.h +++ b/dom/plugins/ipc/PluginLibrary.h @@ -57,7 +57,7 @@ public: virtual bool HasRequiredFunctions() = 0; -#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) +#if defined(XP_UNIX) && !defined(XP_MACOSX) virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0; #else virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0; diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 73f9c1025..ae6da8787 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -529,7 +529,7 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded) if (NS_SUCCEEDED(mAsyncInitRv)) #endif { -#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) +#if defined(XP_UNIX) && !defined(XP_MACOSX) mAsyncInitRv = NP_Initialize(mNPNIface, mNPPIface, &mAsyncInitError); @@ -1745,7 +1745,7 @@ PluginModuleChromeParent::CachedSettingChanged(const char* aPref, void* aModule) module->CachedSettingChanged(); } -#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) +#if defined(XP_UNIX) && !defined(XP_MACOSX) nsresult PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) { diff --git a/dom/plugins/ipc/PluginModuleParent.h b/dom/plugins/ipc/PluginModuleParent.h index 946d4c236..d00a01401 100644 --- a/dom/plugins/ipc/PluginModuleParent.h +++ b/dom/plugins/ipc/PluginModuleParent.h @@ -267,7 +267,7 @@ protected: const mozilla::NativeEventData& aNativeKeyData, bool aIsConsumed) override; -#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) +#if defined(XP_UNIX) && !defined(XP_MACOSX) virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) override; #else virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override; @@ -517,7 +517,7 @@ private: PluginProcessParent* Process() const { return mSubprocess; } base::ProcessHandle ChildProcessHandle() { return mSubprocess->GetChildProcessHandle(); } -#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) +#if defined(XP_UNIX) && !defined(XP_MACOSX) virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) override; #else virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override; diff --git a/dom/presentation/PresentationSessionInfo.cpp b/dom/presentation/PresentationSessionInfo.cpp index f93909864..1dd92ab69 100644 --- a/dom/presentation/PresentationSessionInfo.cpp +++ b/dom/presentation/PresentationSessionInfo.cpp @@ -31,11 +31,6 @@ #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; @@ -647,49 +642,7 @@ PresentationControllingInfo::Shutdown(nsresult aReason) nsresult PresentationControllingInfo::GetAddress() { -#if defined(MOZ_WIDGET_GONK) - nsCOMPtr networkManager = - do_GetService("@mozilla.org/network/manager;1"); - if (NS_WARN_IF(!networkManager)) { - return NS_ERROR_NOT_AVAILABLE; - } - - nsCOMPtr 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( - 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 networkHelper = new PresentationNetworkHelper(this, &PresentationControllingInfo::OnGetAddress); diff --git a/dom/presentation/provider/PresentationDeviceProviderModule.cpp b/dom/presentation/provider/PresentationDeviceProviderModule.cpp index 9100fa49b..9c084e7db 100644 --- a/dom/presentation/provider/PresentationDeviceProviderModule.cpp +++ b/dom/presentation/provider/PresentationDeviceProviderModule.cpp @@ -68,12 +68,9 @@ static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContrac }; 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 -#if defined(MOZ_WIDGET_GONK) - { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "DisplayDeviceProvider", DISPLAY_DEVICE_PROVIDER_CONTRACT_ID }, -#endif #ifdef MOZ_WIDGET_ANDROID { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "LegacyMDNSDeviceProvider", LEGACY_MDNS_PROVIDER_CONTRACT_ID }, #endif //MOZ_WIDGET_ANDROID diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp index 945233f4c..86377e75a 100644 --- a/dom/system/OSFileConstants.cpp +++ b/dom/system/OSFileConstants.cpp @@ -924,16 +924,6 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle global) return false; } -#if defined(MOZ_WIDGET_GONK) - JSString* strVersion = JS_NewStringCopyZ(cx, "Gonk"); - if (!strVersion){ - return false; - } - JS::Rooted valVersion(cx, JS::StringValue(strVersion)); - if (!JS_SetProperty(cx, objSys, "Name", valVersion)) { - return false; - } -#else nsCOMPtr runtime = do_GetService(XULRUNTIME_SERVICE_CONTRACTID); if (runtime) { nsAutoCString os; @@ -950,7 +940,6 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle global) return false; } } -#endif // defined(MOZ_WIDGET_GONK) #if defined(DEBUG) JS::Rooted valDebug(cx, JS::TrueValue()); diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl index 560313680..468f1cc8a 100644 --- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl @@ -379,7 +379,7 @@ Window implements TouchEventHandlers; Window implements OnErrorEventHandlerForWindow; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) // https://compat.spec.whatwg.org/#windoworientation-interface partial interface Window { [NeedsCallerType] diff --git a/hal/Hal.cpp b/hal/Hal.cpp index 44be2f510..8ac9e6847 100644 --- a/hal/Hal.cpp +++ b/hal/Hal.cpp @@ -89,8 +89,6 @@ AssertMainProcess() MOZ_ASSERT(GeckoProcessType_Default == XRE_GetProcessType()); } -#if !defined(MOZ_WIDGET_GONK) - bool WindowIsActive(nsPIDOMWindowInner* aWindow) { @@ -100,8 +98,6 @@ WindowIsActive(nsPIDOMWindowInner* aWindow) return !document->Hidden(); } -#endif // !defined(MOZ_WIDGET_GONK) - StaticAutoPtr gLastIDToVibrate; void InitLastIDToVibrate() @@ -123,7 +119,6 @@ Vibrate(const nsTArray& pattern, const WindowIdentifier &id) { AssertMainThread(); -#if !defined(MOZ_WIDGET_GONK) // Only active windows may start vibrations. If |id| hasn't gone // through the IPC layer -- that is, if our caller is the outside // world, not hal_proxy -- check whether the window is active. If @@ -134,7 +129,6 @@ Vibrate(const nsTArray& pattern, const WindowIdentifier &id) HAL_LOG("Vibrate: Window is inactive, dropping vibrate."); return; } -#endif // !defined(MOZ_WIDGET_GONK) if (!InSandbox()) { if (!gLastIDToVibrate) { diff --git a/hal/linux/LinuxPower.cpp b/hal/linux/LinuxPower.cpp index 70ab4a3f6..626d1ac0c 100644 --- a/hal/linux/LinuxPower.cpp +++ b/hal/linux/LinuxPower.cpp @@ -12,28 +12,9 @@ #include "mozilla/Services.h" #include "MainThreadUtils.h" -#if defined(MOZ_WIDGET_GONK) -#include "cutils/android_reboot.h" -#include "cutils/properties.h" -#endif - namespace mozilla { namespace hal_impl { -#if (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 19) -static void -PowerCtl(const char* aValue, int aCmd) -{ - // this invokes init's powerctl builtin via /init.rc - property_set("sys.powerctl", aValue); - // device should reboot in few moments, but if it doesn't - call - // android_reboot() to make sure that init isn't stuck somewhere - sleep(10); - HAL_LOG("Powerctl call takes too long, forcing %s.", aValue); - android_reboot(aCmd, 0, nullptr); -} -#endif - void Reboot() { @@ -44,14 +25,8 @@ Reboot() } } -#if !defined(MOZ_WIDGET_GONK) sync(); reboot(RB_AUTOBOOT); -#elif (ANDROID_VERSION < 19) - android_reboot(ANDROID_RB_RESTART, 0, nullptr); -#else - PowerCtl("reboot", ANDROID_RB_RESTART); -#endif } void @@ -64,14 +39,8 @@ PowerOff() } } -#if !defined(MOZ_WIDGET_GONK) sync(); reboot(RB_POWER_OFF); -#elif (ANDROID_VERSION < 19) - android_reboot(ANDROID_RB_POWEROFF, 0, nullptr); -#else - PowerCtl("shutdown", ANDROID_RB_POWEROFF); -#endif } // Structure to specify how watchdog pthread is going to work. diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 767298b85..c63374541 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3658,7 +3658,7 @@ nsCSSFrameConstructor::FindInputData(Element* aElement, nsCSSAnonBoxes::buttonContent) }, // TODO: this is temporary until a frame is written: bug 635240. SIMPLE_INT_CREATE(NS_FORM_INPUT_NUMBER, NS_NewNumberControlFrame), -#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. SIMPLE_INT_CREATE(NS_FORM_INPUT_TIME, NS_NewTextControlFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame), diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index ae0db06ab..748bc11d8 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -100,20 +100,6 @@ #include "mozilla/dom/nsSynthVoiceRegistry.h" #endif -#ifdef MOZ_WIDGET_GONK -#include "SystemWorkerManager.h" -using mozilla::dom::gonk::SystemWorkerManager; -#define SYSTEMWORKERMANAGER_CID \ - {0xd53b6524, 0x6ac3, 0x42b0, {0xae, 0xca, 0x62, 0xb3, 0xc4, 0xe5, 0x2b, 0x04}} -#endif - -#ifdef MOZ_WIDGET_GONK -#include "AudioManager.h" -using mozilla::dom::gonk::AudioManager; -#include "nsVolumeService.h" -using mozilla::system::nsVolumeService; -#endif - #include "mozilla/dom/PushNotifier.h" using mozilla::dom::PushNotifier; #define PUSHNOTIFIER_CID \ @@ -135,11 +121,9 @@ using mozilla::dom::AudioChannelAgent; #include "nsSystemPrincipal.h" #include "nsNullPrincipal.h" #include "nsNetCID.h" -#ifndef MOZ_WIDGET_GONK #if defined(MOZ_WIDGET_ANDROID) #include "nsHapticFeedback.h" #endif -#endif #include "nsParserUtils.h" #include "nsHTMLCanvasFrame.h" @@ -201,9 +185,6 @@ static void Shutdown(); #include "nsIPresentationService.h" -#ifdef MOZ_WIDGET_GONK -#include "GonkGPSGeolocationProvider.h" -#endif #include "MediaManager.h" #include "GMPService.h" @@ -284,30 +265,18 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WorkerDebuggerManager, WorkerDebuggerManager::GetInstance) -#ifdef MOZ_WIDGET_GONK -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager, - SystemWorkerManager::FactoryCreate) -#endif - #ifdef MOZ_WEBSPEECH NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSynthVoiceRegistry, nsSynthVoiceRegistry::GetInstanceForService) #endif -#ifdef MOZ_WIDGET_GONK -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioManager, - AudioManager::GetInstance) -#endif - NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors) -#ifndef MOZ_WIDGET_GONK #if defined(ANDROID) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback) #endif -#endif NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService, PowerManagerService::GetInstance) @@ -316,16 +285,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITimeService, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIStreamingProtocolControllerService, StreamingProtocolControllerService::GetInstance) -#ifdef MOZ_WIDGET_GONK -#ifndef DISABLE_MOZ_RIL_GEOLOC -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIGeolocationProvider, - GonkGPSGeolocationProvider::GetSingleton) -#endif -// Since the nsVolumeService constructor calls into nsIPowerManagerService, -// we need it to be constructed sometime after nsIPowerManagerService. -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService, - nsVolumeService::GetSingleton) -#endif NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService, MediaManager::GetInstance) NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager) @@ -702,13 +661,6 @@ NS_DEFINE_NAMED_CID(NOTIFICATIONTELEMETRYSERVICE_CID); NS_DEFINE_NAMED_CID(PUSHNOTIFIER_CID); NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_CID); -#ifdef MOZ_WIDGET_GONK -NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID); -#endif -#ifdef MOZ_WIDGET_GONK -NS_DEFINE_NAMED_CID(NS_AUDIOMANAGER_CID); -NS_DEFINE_NAMED_CID(NS_VOLUMESERVICE_CID); -#endif NS_DEFINE_NAMED_CID(NS_AUDIOCHANNELAGENT_CID); @@ -740,16 +692,9 @@ NS_DEFINE_NAMED_CID(THIRDPARTYUTIL_CID); NS_DEFINE_NAMED_CID(NS_STRUCTUREDCLONECONTAINER_CID); NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID); -#ifndef MOZ_WIDGET_GONK #if defined(ANDROID) NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID); #endif -#endif -#ifndef DISABLE_MOZ_RIL_GEOLOC -#ifdef MOZ_WIDGET_GONK -NS_DEFINE_NAMED_CID(GONK_GPS_GEOLOCATION_PROVIDER_CID); -#endif -#endif NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID); NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID); NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID); @@ -983,13 +928,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor }, { &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor }, { &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor }, -#ifdef MOZ_WIDGET_GONK - { &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor }, -#endif -#ifdef MOZ_WIDGET_GONK - { &kNS_AUDIOMANAGER_CID, true, nullptr, AudioManagerConstructor }, - { &kNS_VOLUMESERVICE_CID, true, nullptr, nsVolumeServiceConstructor }, -#endif { &kNS_AUDIOCHANNELAGENT_CID, true, nullptr, AudioChannelAgentConstructor }, { &kNS_HTMLEDITOR_CID, false, nullptr, HTMLEditorConstructor }, { &kNS_EDITORCONTROLLER_CID, false, nullptr, EditorControllerConstructor }, @@ -1025,10 +963,8 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, nsSystemPrincipalConstructor }, { &kNS_NULLPRINCIPAL_CID, false, nullptr, nsNullPrincipalConstructor }, { &kNS_DEVICE_SENSORS_CID, false, nullptr, nsDeviceSensorsConstructor }, -#ifndef MOZ_WIDGET_GONK #if defined(ANDROID) { &kNS_HAPTICFEEDBACK_CID, false, nullptr, nsHapticFeedbackConstructor }, -#endif #endif { &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor }, { &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor }, @@ -1038,9 +974,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor }, { &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor }, { &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor }, -#if defined(MOZ_WIDGET_GONK) && !defined(DISABLE_MOZ_RIL_GEOLOC) - { &kGONK_GPS_GEOLOCATION_PROVIDER_CID, false, nullptr, nsIGeolocationProviderConstructor }, -#endif { &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor }, #ifdef ACCESSIBILITY { &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService }, @@ -1127,13 +1060,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID }, { PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID }, { WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_CID }, -#ifdef MOZ_WIDGET_GONK - { SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID }, -#endif -#ifdef MOZ_WIDGET_GONK - { NS_AUDIOMANAGER_CONTRACTID, &kNS_AUDIOMANAGER_CID }, - { NS_VOLUMESERVICE_CONTRACTID, &kNS_VOLUMESERVICE_CID }, -#endif { NS_AUDIOCHANNELAGENT_CONTRACTID, &kNS_AUDIOCHANNELAGENT_CID }, { "@mozilla.org/editor/htmleditor;1", &kNS_HTMLEDITOR_CID }, { "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID }, @@ -1168,10 +1094,8 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { NS_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID }, { NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID }, { NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID }, -#ifndef MOZ_WIDGET_GONK #if defined(ANDROID) { "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID }, -#endif #endif { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID }, { NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID }, @@ -1180,9 +1104,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { "@mozilla.org/udp-socket-child;1", &kUDPSOCKETCHILD_CID }, { TIMESERVICE_CONTRACTID, &kNS_TIMESERVICE_CID }, { MEDIASTREAMCONTROLLERSERVICE_CONTRACTID, &kNS_MEDIASTREAMCONTROLLERSERVICE_CID }, -#if defined(MOZ_WIDGET_GONK) && !defined(DISABLE_MOZ_RIL_GEOLOC) - { GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID, &kGONK_GPS_GEOLOCATION_PROVIDER_CID }, -#endif { MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID }, #ifdef ACCESSIBILITY { "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID }, @@ -1208,13 +1129,7 @@ static const mozilla::Module::CategoryEntry kLayoutCategories[] = { { "app-startup", "Push Notifier", "service," PUSHNOTIFIER_CONTRACTID }, { "clear-origin-attributes-data", "QuotaManagerService", "service," QUOTAMANAGER_SERVICE_CONTRACTID }, { OBSERVER_TOPIC_IDLE_DAILY, "QuotaManagerService", QUOTAMANAGER_SERVICE_CONTRACTID }, -#ifdef MOZ_WIDGET_GONK - { "app-startup", "Volume Service", "service," NS_VOLUMESERVICE_CONTRACTID }, -#endif CONTENTDLF_CATEGORIES -#ifdef MOZ_WIDGET_GONK - { "profile-after-change", "Gonk System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID }, -#endif { "profile-after-change", "PresentationDeviceManager", PRESENTATION_DEVICE_MANAGER_CONTRACTID }, { "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID }, { "profile-after-change", "Notification Telemetry Service", NOTIFICATIONTELEMETRYSERVICE_CONTRACTID }, diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index 3f534c8d8..0306626c4 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -100,11 +100,6 @@ #include "Latency.h" #include "WebAudioUtils.h" -#ifdef MOZ_WIDGET_GONK -#include "nsVolumeService.h" -using namespace mozilla::system; -#endif - #include "nsError.h" #include "nsJSEnvironment.h" @@ -395,10 +390,6 @@ nsLayoutStatics::Shutdown() AsyncLatencyLogger::ShutdownLogger(); WebAudioUtils::Shutdown(); -#ifdef MOZ_WIDGET_GONK - nsVolumeService::Shutdown(); -#endif - #ifdef MOZ_WEBSPEECH nsSynthVoiceRegistry::Shutdown(); #endif diff --git a/security/manager/pki/nsNSSDialogHelper.cpp b/security/manager/pki/nsNSSDialogHelper.cpp index 1ec161b81..95d02a981 100644 --- a/security/manager/pki/nsNSSDialogHelper.cpp +++ b/security/manager/pki/nsNSSDialogHelper.cpp @@ -19,12 +19,6 @@ nsresult nsNSSDialogHelper::openDialog(mozIDOMWindowProxy* window, const char* url, nsISupports* params, bool modal) { -#ifdef MOZ_WIDGET_GONK - // On b2g devices, we need to proxy the dialog creation & management - // to Gaia. - return NS_ERROR_NOT_IMPLEMENTED; -#endif - nsresult rv; nsCOMPtr windowWatcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv); diff --git a/tools/profiler/core/GeckoSampler.cpp b/tools/profiler/core/GeckoSampler.cpp index f4249a7a5..4283542f6 100644 --- a/tools/profiler/core/GeckoSampler.cpp +++ b/tools/profiler/core/GeckoSampler.cpp @@ -44,7 +44,7 @@ #include "mozilla/ProfileGatherer.h" #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) #include "FennecJNIWrappers.h" #endif @@ -213,7 +213,7 @@ GeckoSampler::GeckoSampler(double aInterval, int aEntrySize, } #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) mProfileJava = mozilla::jni::IsFennec() && hasFeature(aFeatures, aFeatureCount, "java"); #else @@ -462,7 +462,7 @@ void SubProcessCallback(const char* aProfile, void* aClosure) } -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) static void BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter) { @@ -567,7 +567,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime) } } - #if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) + #if defined(SPS_OS_android) if (ProfileJava()) { java::GeckoJavaSampler::Pause(); diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index 0d3cb1648..a8a09d66f 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -36,11 +36,11 @@ #include "GeckoTaskTracer.h" #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) #include "FennecJNIWrappers.h" #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) #include "FennecJNINatives.h" #endif @@ -52,7 +52,7 @@ #endif #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) class GeckoJavaSampler : public java::GeckoJavaSampler::Natives { private: @@ -502,7 +502,7 @@ void mozilla_sampler_init(void* stackTop) set_stderr_callback(mozilla_sampler_log); #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) if (mozilla::jni::IsFennec()) { GeckoJavaSampler::Init(); } @@ -524,7 +524,7 @@ void mozilla_sampler_init(void* stackTop) || defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux) , "stackwalk" #endif -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) , "java" #endif }; @@ -819,7 +819,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval, } } -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) if (t->ProfileJava()) { int javaInterval = aInterval; // Java sampling doesn't accuratly keep up with 1ms sampling @@ -1021,15 +1021,6 @@ bool mozilla_sampler_register_thread(const char* aName, void* aGuessStackTop) return false; } -#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_PROFILING) - // The only way to profile secondary threads on b2g - // is to build with profiling OR have the profiler - // running on startup. - if (!profiler_is_active()) { - return false; - } -#endif - MOZ_ASSERT(tlsPseudoStack.get() == nullptr); PseudoStack* stack = PseudoStack::create(); tlsPseudoStack.set(stack); diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h index 2e736d97c..17c8dd25c 100644 --- a/tools/profiler/core/platform.h +++ b/tools/profiler/core/platform.h @@ -393,10 +393,7 @@ class Sampler { static mozilla::UniquePtr sRegisteredThreadsMutex; static bool CanNotifyObservers() { -#ifdef MOZ_WIDGET_GONK - // We use profile.sh on b2g to manually select threads and options per process. - return false; -#elif defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) // Android ANR reporter uses the profiler off the main thread return NS_IsMainThread(); #else diff --git a/tools/profiler/core/shared-libraries-linux.cc b/tools/profiler/core/shared-libraries-linux.cc index 24437fb4e..553039fb7 100644 --- a/tools/profiler/core/shared-libraries-linux.cc +++ b/tools/profiler/core/shared-libraries-linux.cc @@ -37,7 +37,6 @@ static std::string getId(const char *bin_name) return ""; } -#if !defined(MOZ_WIDGET_GONK) // TODO fix me with proper include #include "nsDebug.h" #ifdef ANDROID @@ -86,13 +85,10 @@ dl_iterate_callback(struct dl_phdr_info *dl_info, size_t size, void *data) return 0; } -#endif // !MOZ_WIDGET_GONK - SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { SharedLibraryInfo info; -#if !defined(MOZ_WIDGET_GONK) #ifdef ANDROID if (!dl_iterate_phdr) { // On ARM Android, dl_iterate_phdr is provided by the custom linker. @@ -104,9 +100,8 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() #endif // ANDROID dl_iterate_phdr(dl_iterate_callback, &info); -#endif // !MOZ_WIDGET_GONK -#if defined(ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(ANDROID) pid_t pid = getpid(); char path[PATH_MAX]; snprintf(path, PATH_MAX, "/proc/%d/maps", pid); @@ -132,19 +127,10 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() LOG("Get maps line failed"); continue; } -#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK) // Use proc/pid/maps to get the dalvik-jit section since it has // no associated phdrs if (strcmp(name, "/dev/ashmem/dalvik-jit-code-cache") != 0) continue; -#else - if (strcmp(perm, "r-xp") != 0) { - // Ignore entries that are writable and/or shared. - // At least one graphics driver uses short-lived "rwxs" mappings - // (see bug 926734 comment 5), so just checking for 'x' isn't enough. - continue; - } -#endif SharedLibrary shlib(start, end, offset, getId(name), name); info.AddSharedLibrary(shlib); if (count > 10000) { @@ -153,7 +139,7 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() } count++; } -#endif // ANDROID || MOZ_WIDGET_GONK +#endif // ANDROID return info; } diff --git a/tools/profiler/gecko/SaveProfileTask.cpp b/tools/profiler/gecko/SaveProfileTask.cpp index 497385355..dbbbe4836 100644 --- a/tools/profiler/gecko/SaveProfileTask.cpp +++ b/tools/profiler/gecko/SaveProfileTask.cpp @@ -9,7 +9,7 @@ nsresult SaveProfileTask::Run() { // Get file path -#if defined(SPS_PLAT_arm_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_PLAT_arm_android) nsCString tmpPath; tmpPath.AppendPrintf("/sdcard/profile_%i_%i.txt", XRE_GetProcessType(), getpid()); #else diff --git a/tools/profiler/lul/AutoObjectMapper.cpp b/tools/profiler/lul/AutoObjectMapper.cpp index a5dc902fd..1bc5ce62a 100644 --- a/tools/profiler/lul/AutoObjectMapper.cpp +++ b/tools/profiler/lul/AutoObjectMapper.cpp @@ -16,7 +16,7 @@ #include "PlatformMacros.h" #include "AutoObjectMapper.h" -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) # include # include "mozilla/Types.h" // FIXME move these out of mozglue/linker/ElfLoader.h into their @@ -108,7 +108,7 @@ bool AutoObjectMapperPOSIX::Map(/*OUT*/void** start, /*OUT*/size_t* length, } -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) // A helper function for AutoObjectMapperFaultyLib::Map. Finds out // where the installation's lib directory is, since we'll have to look // in there to get hold of libmozglue.so. Returned C string is heap @@ -204,4 +204,4 @@ bool AutoObjectMapperFaultyLib::Map(/*OUT*/void** start, /*OUT*/size_t* length, } } -#endif // defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#endif // defined(SPS_OS_android) diff --git a/tools/profiler/lul/AutoObjectMapper.h b/tools/profiler/lul/AutoObjectMapper.h index 1f813d6f2..3f60dc44d 100644 --- a/tools/profiler/lul/AutoObjectMapper.h +++ b/tools/profiler/lul/AutoObjectMapper.h @@ -62,7 +62,7 @@ private: }; -#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#if defined(SPS_OS_android) // This is a variant of AutoObjectMapperPOSIX suitable for use in // conjunction with faulty.lib on Android. How it behaves depends on // the name of the file to be mapped. There are three possible cases: @@ -110,6 +110,6 @@ private: void operator delete[](void*); }; -#endif // defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +#endif // defined(SPS_OS_android) #endif // AutoObjectMapper_h diff --git a/tools/profiler/lul/platform-linux-lul.cpp b/tools/profiler/lul/platform-linux-lul.cpp index 9541534a1..da764f3cf 100644 --- a/tools/profiler/lul/platform-linux-lul.cpp +++ b/tools/profiler/lul/platform-linux-lul.cpp @@ -32,7 +32,7 @@ read_procmaps(lul::LUL* aLUL) for (size_t i = 0; i < info.GetSize(); i++) { const SharedLibrary& lib = info.GetEntry(i); -# if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +# if defined(SPS_OS_android) // We're using faulty.lib. Use a special-case object mapper. AutoObjectMapperFaultyLib mapper(aLUL->mLog); # else diff --git a/tools/profiler/public/GeckoProfilerImpl.h b/tools/profiler/public/GeckoProfilerImpl.h index a32096b94..7011e5cdb 100644 --- a/tools/profiler/public/GeckoProfilerImpl.h +++ b/tools/profiler/public/GeckoProfilerImpl.h @@ -346,13 +346,6 @@ static inline void profiler_tracing(const char* aCategory, const char* aInfo, #define PROFILER_MAIN_THREAD_LABEL_PRINTF(name_space, info, category, ...) MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, category, __LINE__, __VA_ARGS__) -/* FIXME/bug 789667: memory constraints wouldn't much of a problem for - * this small a sample buffer size, except that serializing the - * profile data is extremely, unnecessarily memory intensive. */ -#ifdef MOZ_WIDGET_GONK -# define PLATFORM_LIKELY_MEMORY_CONSTRAINED -#endif - #if !defined(PLATFORM_LIKELY_MEMORY_CONSTRAINED) && !defined(ARCH_ARMV6) # define PROFILE_DEFAULT_ENTRY 1000000 #else diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 616eefbdc..7c62e2af5 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -1596,10 +1596,6 @@ nsMemoryReporterManager::~nsMemoryReporterManager() NS_ASSERTION(!mSavedWeakReporters, "failed to restore weak reporters"); } -#ifdef MOZ_WIDGET_GONK -#define DEBUG_CHILD_PROCESS_MEMORY_REPORTING 1 -#endif - #ifdef DEBUG_CHILD_PROCESS_MEMORY_REPORTING #define MEMORY_REPORTING_LOG(format, ...) \ printf_stderr("++++ MEMORY REPORTING: " format, ##__VA_ARGS__); diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index a72dd3826..4a92a2eb4 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -50,12 +50,6 @@ #include "mozilla/dom/ContentChild.h" #endif -#ifdef MOZ_WIDGET_GONK -#include -#include "mozilla/Preferences.h" -#include "nsPrintfCString.h" -#endif - #ifdef ANDROID extern "C" { NS_EXPORT int android_sdk_version; @@ -747,44 +741,6 @@ nsSystemInfo::Init() } #endif -#ifdef MOZ_WIDGET_GONK - char sdk[PROP_VALUE_MAX]; - if (__system_property_get("ro.build.version.sdk", sdk)) { - android_sdk_version = atoi(sdk); - SetPropertyAsInt32(NS_LITERAL_STRING("sdk_version"), android_sdk_version); - - SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"), - nsPrintfCString("SDK %u", android_sdk_version)); - } - - char characteristics[PROP_VALUE_MAX]; - if (__system_property_get("ro.build.characteristics", characteristics)) { - if (!strcmp(characteristics, "tablet")) { - SetPropertyAsBool(NS_LITERAL_STRING("tablet"), true); - } else if (!strcmp(characteristics, "tv")) { - SetPropertyAsBool(NS_LITERAL_STRING("tv"), true); - } - } - - nsAutoString str; - rv = GetPropertyAsAString(NS_LITERAL_STRING("version"), str); - if (NS_SUCCEEDED(rv)) { - SetPropertyAsAString(NS_LITERAL_STRING("kernel_version"), str); - } - - const nsAdoptingString& b2g_os_name = - mozilla::Preferences::GetString("b2g.osName"); - if (b2g_os_name) { - SetPropertyAsAString(NS_LITERAL_STRING("name"), b2g_os_name); - } - - const nsAdoptingString& b2g_version = - mozilla::Preferences::GetString("b2g.version"); - if (b2g_version) { - SetPropertyAsAString(NS_LITERAL_STRING("version"), b2g_version); - } -#endif - return NS_OK; } diff --git a/xpcom/build/BinaryPath.h b/xpcom/build/BinaryPath.h index 374763c79..53034fcd8 100644 --- a/xpcom/build/BinaryPath.h +++ b/xpcom/build/BinaryPath.h @@ -90,11 +90,6 @@ private: // On Android, we use the GRE_HOME variable that is set by the Java // bootstrap code. const char* greHome = getenv("GRE_HOME"); -#if defined(MOZ_WIDGET_GONK) - if (!greHome) { - greHome = "/system/b2g"; - } -#endif if (!greHome) { return NS_ERROR_FAILURE; diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index 6fb50fc1d..7b220558f 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -1104,17 +1104,6 @@ ShutdownXPCOM(nsIServiceManager* aServMgr) NS_LogTerm(); -#if defined(MOZ_WIDGET_GONK) - // This _exit(0) call is intended to be temporary, to get shutdown leak - // checking working on non-B2G platforms. - // On debug B2G, the child process crashes very late. Instead, just - // give up so at least we exit cleanly. See bug 1071866. - if (XRE_IsContentProcess()) { - NS_WARNING("Exiting child process early!"); - _exit(0); - } -#endif - return NS_OK; } diff --git a/xpcom/build/XREChildData.h b/xpcom/build/XREChildData.h index 96b297d3c..c849131d6 100644 --- a/xpcom/build/XREChildData.h +++ b/xpcom/build/XREChildData.h @@ -20,7 +20,7 @@ class GMPLoader; */ struct XREChildData { -#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) +#if !defined(MOZ_WIDGET_ANDROID) /** * Used to load the GMP binary. */ diff --git a/xpcom/glue/FileUtils.h b/xpcom/glue/FileUtils.h index aaf912b21..b808d52e0 100644 --- a/xpcom/glue/FileUtils.h +++ b/xpcom/glue/FileUtils.h @@ -161,7 +161,7 @@ void ReadAhead(filedesc_t aFd, const size_t aOffset = 0, const size_t aCount = SIZE_MAX); -#if defined(MOZ_WIDGET_GONK) || defined(XP_UNIX) +#if defined(XP_UNIX) #define MOZ_TEMP_FAILURE_RETRY(exp) (__extension__({ \ typeof (exp) _rc; \ do { \ @@ -171,10 +171,9 @@ void ReadAhead(filedesc_t aFd, const size_t aOffset = 0, })) #endif -/* Define ReadSysFile() and WriteSysFile() only on GONK to avoid unnecessary - * libxul bloat. Also define it in debug builds, so that unit tests for it can - * be written and run in non-GONK builds. */ -#if (defined(MOZ_WIDGET_GONK) || defined(DEBUG)) && defined(XP_UNIX) +/* Define ReadSysFile() and WriteSysFile() only in debug builds, so that + * unit tests for it can be written and run. */ +#if defined(DEBUG) && defined(XP_UNIX) #ifndef ReadSysFile_PRESENT #define ReadSysFile_PRESENT @@ -213,7 +212,7 @@ bool ReadSysFile(const char* aFilename, bool* aVal); bool WriteSysFile(const char* aFilename, const char* aBuf); -#endif /* (MOZ_WIDGET_GONK || DEBUG) && XP_UNIX */ +#endif /* DEBUG && XP_UNIX */ } // namespace mozilla diff --git a/xpcom/threads/ThreadStackHelper.cpp b/xpcom/threads/ThreadStackHelper.cpp index d31bf6359..1713c9194 100644 --- a/xpcom/threads/ThreadStackHelper.cpp +++ b/xpcom/threads/ThreadStackHelper.cpp @@ -359,11 +359,6 @@ ThreadStackHelper::PrepareStackBuffer(Stack& aStack) profiler_register_thread). However, on B2G, profiling secondary threads may be disabled despite profiler being enabled. This is by-design and is not an error. */ -#ifdef MOZ_WIDGET_GONK - if (!mPseudoStack) { - return false; - } -#endif MOZ_ASSERT(mPseudoStack); if (!aStack.reserve(mMaxStackSize) || !aStack.reserve(aStack.capacity()) || // reserve up to the capacity -- cgit v1.2.3