From 20df43a54968c11da60b5c549b6010827bb4d2cc Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 19 Jul 2017 18:38:48 +1000 Subject: [PATCH] Bug 1382099 - Remove MOZ_WIDGET_GONK from toolkit/. r=glandium. --HG-- extra : rebase_source : 709744b24104b463c8dc4cbe215d2250e7c1a9f5 --- .../components/build/nsToolkitCompsModule.cpp | 2 +- .../diskspacewatcher/DiskSpaceWatcher.cpp | 3 -- .../jsdownloads/src/DownloadIntegration.jsm | 2 -- .../jsdownloads/src/DownloadPlatform.cpp | 2 +- toolkit/components/startup/nsAppStartup.cpp | 4 +-- .../windowwatcher/nsWindowWatcher.cpp | 7 ---- toolkit/crashreporter/nsExceptionHandler.cpp | 9 ++--- toolkit/modules/AppConstants.jsm | 2 -- toolkit/profile/nsProfileLock.cpp | 25 -------------- toolkit/xre/EventTracer.cpp | 33 ------------------- toolkit/xre/nsAppRunner.cpp | 14 ++++---- toolkit/xre/nsEmbedFunctions.cpp | 8 ++--- toolkit/xre/nsXREDirProvider.cpp | 12 ------- 13 files changed, 16 insertions(+), 107 deletions(-) diff --git a/toolkit/components/build/nsToolkitCompsModule.cpp b/toolkit/components/build/nsToolkitCompsModule.cpp index 1bb2d87feaf8..4e95adea7f6f 100644 --- a/toolkit/components/build/nsToolkitCompsModule.cpp +++ b/toolkit/components/build/nsToolkitCompsModule.cpp @@ -47,7 +47,7 @@ #include "nsWebRequestListener.h" -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) #define MOZ_HAS_TERMINATOR #endif diff --git a/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp b/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp index 950d3b4877be..7f3b8cd08a07 100644 --- a/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp +++ b/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp @@ -145,9 +145,6 @@ static const mozilla::Module::ContractIDEntry kDiskSpaceWatcherContracts[] = { }; static const mozilla::Module::CategoryEntry kDiskSpaceWatcherCategories[] = { -#ifdef MOZ_WIDGET_GONK - { "profile-after-change", "Disk Space Watcher Service", DISKSPACEWATCHER_CONTRACTID }, -#endif { nullptr } }; diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 4fde2cf7e938..c1853a6d5dbd 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -373,8 +373,6 @@ this.DownloadIntegration = { directoryPath = await this.getPreferredDownloadsDirectory(); #elifdef MOZ_WIDGET_ANDROID directoryPath = await this.getSystemDownloadsDirectory(); -#elifdef MOZ_WIDGET_GONK - directoryPath = await this.getSystemDownloadsDirectory(); #else directoryPath = this._getDirectory("TmpD"); #endif diff --git a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp index 66601c5cba7d..fd7c8fbd9b18 100644 --- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp +++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp @@ -102,7 +102,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIF const nsACString& aContentType, bool aIsPrivate) { #if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) \ - || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GONK) + || defined(MOZ_WIDGET_GTK) nsAutoString path; if (aTarget && NS_SUCCEEDED(aTarget->GetPath(path))) { diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 38464de31bd5..e2511dd045f9 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -241,7 +241,7 @@ NS_IMPL_ISUPPORTS(nsAppStartup, NS_IMETHODIMP nsAppStartup::CreateHiddenWindow() { -#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_UIKIT) +#if defined(MOZ_WIDGET_UIKIT) return NS_OK; #else nsCOMPtr appShellService @@ -256,7 +256,7 @@ nsAppStartup::CreateHiddenWindow() NS_IMETHODIMP nsAppStartup::DestroyHiddenWindow() { -#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_UIKIT) +#if defined(MOZ_WIDGET_UIKIT) return NS_OK; #else nsCOMPtr appShellService diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp index 67bc9475d7f6..791a951254d5 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp @@ -490,13 +490,6 @@ nsWindowWatcher::CreateChromeWindow(const nsACString& aFeatures, return NS_ERROR_UNEXPECTED; } - // B2G multi-screen support. mozDisplayId is returned from the - // "display-changed" event, it is also platform-dependent. -#ifdef MOZ_WIDGET_GONK - int retval = WinHasOption(aFeatures, "mozDisplayId", 0, nullptr); - windowCreator2->SetScreenId(retval); -#endif - bool cancel = false; nsCOMPtr newWindowChrome; nsresult rv = diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 359a8e148d56..49e1e31ec88f 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -1601,11 +1601,9 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory, if (gExceptionHandler) return NS_ERROR_ALREADY_INITIALIZED; -#if !defined(DEBUG) || defined(MOZ_WIDGET_GONK) +#if !defined(DEBUG) // In non-debug builds, enable the crash reporter by default, and allow // disabling it with the MOZ_CRASHREPORTER_DISABLE environment variable. - // Also enable it by default in debug gonk builds as it is difficult to - // set environment on startup. const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_DISABLE"); if (envvar && *envvar && !force) return NS_OK; @@ -1617,10 +1615,7 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory, return NS_OK; #endif -#if defined(MOZ_WIDGET_GONK) - doReport = false; - headlessClient = true; -#elif defined(XP_WIN) +#if defined(XP_WIN) doReport = ShouldReport(); #else // this environment variable prevents us from launching diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index ffccd42c6bb6..73edbce40457 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -156,8 +156,6 @@ this.AppConstants = Object.freeze({ "macosx", #elif MOZ_WIDGET_ANDROID "android", -#elif MOZ_WIDGET_GONK - "gonk", #elif XP_LINUX "linux", #else diff --git a/toolkit/profile/nsProfileLock.cpp b/toolkit/profile/nsProfileLock.cpp index d2253edd25db..ed5e38064cd1 100644 --- a/toolkit/profile/nsProfileLock.cpp +++ b/toolkit/profile/nsProfileLock.cpp @@ -30,10 +30,6 @@ #include "mozilla/Printf.h" #endif -#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_CRASHREPORTER) -#include -#endif - // ********************************************************************** // class nsProfileLock // @@ -192,27 +188,6 @@ void nsProfileLock::FatalSignalHandler(int signo } } -#ifdef MOZ_WIDGET_GONK - switch (signo) { - case SIGQUIT: - case SIGILL: - case SIGABRT: - case SIGSEGV: -#ifndef MOZ_CRASHREPORTER - // Retrigger the signal for those that can generate a core dump - signal(signo, SIG_DFL); - if (info->si_code <= 0) { - if (syscall(__NR_tgkill, getpid(), syscall(__NR_gettid), signo) < 0) { - break; - } - } -#endif - return; - default: - break; - } -#endif - // Backstop exit call, just in case. _exit(signo); } diff --git a/toolkit/xre/EventTracer.cpp b/toolkit/xre/EventTracer.cpp index c4e65cba72d6..955bdeb2aace 100644 --- a/toolkit/xre/EventTracer.cpp +++ b/toolkit/xre/EventTracer.cpp @@ -66,10 +66,6 @@ #include #include "nsThreadUtils.h" -#ifdef MOZ_WIDGET_GONK -#include "nsIObserverService.h" -#include "mozilla/Services.h" -#endif using mozilla::TimeDuration; using mozilla::TimeStamp; @@ -85,31 +81,6 @@ struct TracerStartClosure { int32_t mThresholdInterval; }; -#ifdef MOZ_WIDGET_GONK -class EventLoopLagDispatcher : public Runnable -{ - public: - explicit EventLoopLagDispatcher(int aLag) - : mLag(aLag) {} - - NS_IMETHOD Run() override - { - nsCOMPtr obsService = - mozilla::services::GetObserverService(); - if (!obsService) { - return NS_ERROR_FAILURE; - } - - nsAutoString value; - value.AppendInt(mLag); - return obsService->NotifyObservers(nullptr, "event-loop-lag", value.get()); - } - - private: - int mLag; -}; -#endif - /* * The tracer thread fires events at the native event loop roughly * every kMeasureInterval. It will sleep to attempt not to send them @@ -180,10 +151,6 @@ void TracerThread(void *arg) fprintf(log, "MOZ_EVENT_TRACE sample %llu %lf\n", now, duration.ToMilliseconds()); -#ifdef MOZ_WIDGET_GONK - NS_DispatchToMainThread( - new EventLoopLagDispatcher(int(duration.ToSecondsSigDigits() * 1000))); -#endif } if (next_sleep > duration.ToMilliseconds()) { diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index d9b4cc084a6e..ef4435fda217 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -4018,7 +4018,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag) return 0; } -#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) +#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID) // Check for and process any available updates nsCOMPtr updRoot; bool persistent; @@ -4211,7 +4211,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag) } #if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) +#if defined(MOZ_CONTENT_SANDBOX) void AddSandboxAnnotations() { // Include the sandbox content level, regardless of platform @@ -4240,7 +4240,7 @@ void AddSandboxAnnotations() NS_LITERAL_CSTRING("ContentSandboxCapable"), sandboxCapable ? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0")); } -#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */ +#endif /* MOZ_CONTENT_SANDBOX */ #endif /* MOZ_CRASHREPORTER */ /* @@ -4561,7 +4561,7 @@ XREMain::XRE_mainRun() } #endif /* MOZ_INSTRUMENT_EVENT_LOOP */ -#if defined(MOZ_SANDBOX) && defined(XP_LINUX) && !defined(MOZ_WIDGET_GONK) +#if defined(MOZ_SANDBOX) && defined(XP_LINUX) // If we're on Linux, we now have information about the OS capabilities // available to us. SandboxInfo sandboxInfo = SandboxInfo::Get(); @@ -4584,12 +4584,12 @@ XREMain::XRE_mainRun() CrashReporter::AnnotateCrashReport( NS_LITERAL_CSTRING("ContentSandboxCapabilities"), flagsString); #endif /* MOZ_CRASHREPORTER */ -#endif /* MOZ_SANDBOX && XP_LINUX && !MOZ_WIDGET_GONK */ +#endif /* MOZ_SANDBOX && XP_LINUX */ #if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) +#if defined(MOZ_CONTENT_SANDBOX) AddSandboxAnnotations(); -#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */ +#endif /* MOZ_CONTENT_SANDBOX */ #endif /* MOZ_CRASHREPORTER */ { diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index 26026380cceb..c64116fa2671 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -89,10 +89,8 @@ #if defined(MOZ_CONTENT_SANDBOX) #include "mozilla/SandboxSettings.h" -#if !defined(MOZ_WIDGET_GONK) #include "mozilla/Preferences.h" #endif -#endif #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX) #include "mozilla/Sandbox.h" @@ -309,7 +307,7 @@ SetTaskbarGroupId(const nsString& aId) #endif #if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) +#if defined(MOZ_CONTENT_SANDBOX) void AddContentSandboxLevelAnnotation() { @@ -321,7 +319,7 @@ AddContentSandboxLevelAnnotation() NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString); } } -#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */ +#endif /* MOZ_CONTENT_SANDBOX */ #endif /* MOZ_CRASHREPORTER */ namespace { @@ -702,7 +700,7 @@ XRE_InitChildProcess(int aArgc, OverrideDefaultLocaleIfNeeded(); #if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) +#if defined(MOZ_CONTENT_SANDBOX) AddContentSandboxLevelAnnotation(); #endif #endif diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index 1a78e8992166..7560e128b811 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -1249,14 +1249,6 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult) { nsCOMPtr updRoot; -#if defined(MOZ_WIDGET_GONK) - - nsresult rv = NS_NewNativeLocalFile(nsDependentCString("/data/local"), - true, - getter_AddRefs(updRoot)); - NS_ENSURE_SUCCESS(rv, rv); - -#else nsCOMPtr appFile; bool per = false; nsresult rv = GetFile(XRE_EXECUTABLE_FILE, &per, getter_AddRefs(appFile)); @@ -1402,7 +1394,6 @@ nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult) NS_ENSURE_SUCCESS(rv, rv); #endif // XP_WIN -#endif updRoot.forget(aResult); return NS_OK; } @@ -1506,9 +1497,6 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal) NS_ENSURE_SUCCESS(rv, rv); rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir)); -#elif defined(MOZ_WIDGET_GONK) - rv = NS_NewNativeLocalFile(NS_LITERAL_CSTRING("/data/b2g"), true, - getter_AddRefs(localDir)); #elif defined(XP_UNIX) const char* homeDir = getenv("HOME"); if (!homeDir || !*homeDir)