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 --- 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 ---- 7 files changed, 6 insertions(+), 76 deletions(-) (limited to 'xpcom') 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