diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-13 00:08:52 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-13 00:08:52 +0200 |
commit | e16bcd08aae85a7d9c2de5a4b1c733280cb81112 (patch) | |
tree | 220026724ceb8fbcf18bf627fde022c2d8df0e91 /ipc | |
parent | 6571d2ceb42930dab01677ef0e95e732d5076fb8 (diff) | |
download | UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.gz UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.lz UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.xz UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.zip |
Remove MOZ_WIDGET_GONK [2/2]
Tag #288
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/chromium/src/base/platform_thread_posix.cc | 4 | ||||
-rw-r--r-- | ipc/chromium/src/base/process_util_linux.cc | 45 | ||||
-rw-r--r-- | ipc/contentproc/plugin-container.cpp | 46 | ||||
-rw-r--r-- | ipc/dbus/DBusHelpers.cpp | 5 | ||||
-rw-r--r-- | ipc/dbus/DBusUtils.cpp | 5 | ||||
-rw-r--r-- | ipc/glue/GeckoChildProcessHost.cpp | 14 | ||||
-rw-r--r-- | ipc/hal/DaemonSocket.cpp | 5 | ||||
-rw-r--r-- | ipc/hal/DaemonSocketConnector.cpp | 5 | ||||
-rw-r--r-- | ipc/hal/DaemonSocketPDU.cpp | 5 | ||||
-rw-r--r-- | ipc/hal/DaemonSocketPDUHelpers.cpp | 14 | ||||
-rw-r--r-- | ipc/keystore/KeyStore.cpp | 5 | ||||
-rw-r--r-- | ipc/keystore/KeyStoreConnector.cpp | 5 | ||||
-rw-r--r-- | ipc/ril/Ril.cpp | 5 | ||||
-rw-r--r-- | ipc/ril/RilConnector.cpp | 4 | ||||
-rw-r--r-- | ipc/unixfd/UnixFdWatcher.cpp | 5 |
15 files changed, 5 insertions, 167 deletions
diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc index 6c978336e..4acd95f23 100644 --- a/ipc/chromium/src/base/platform_thread_posix.cc +++ b/ipc/chromium/src/base/platform_thread_posix.cc @@ -48,11 +48,7 @@ PlatformThreadId PlatformThread::CurrentId() { mach_port_deallocate(mach_task_self(), port); return port; #elif defined(OS_LINUX) -#ifdef MOZ_WIDGET_GONK - return (intptr_t) (pthread_self()); -#else return syscall(__NR_gettid); -#endif #elif defined(OS_OPENBSD) || defined(__GLIBC__) return (intptr_t) (pthread_self()); #elif defined(OS_NETBSD) diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 204017db5..57388ccb0 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -24,24 +24,13 @@ #include "prenv.h" #include "prmem.h" -#ifdef MOZ_WIDGET_GONK /* - * AID_APP is the first application UID used by Android. We're using - * it as our unprivilegied UID. This ensure the UID used is not - * shared with any other processes than our own childs. - */ -# include <private/android_filesystem_config.h> -# define CHILD_UNPRIVILEGED_UID AID_APP -# define CHILD_UNPRIVILEGED_GID AID_APP -#else -/* - * On platforms that are not gonk based, we fall back to an arbitrary - * UID. This is generally the UID for user `nobody', albeit it is not + * On our platforms we use an arbitrary UID. + * This is generally the UID for user `nobody', albeit it is not * always the case. */ # define CHILD_UNPRIVILEGED_UID 65534 # define CHILD_UNPRIVILEGED_GID 65534 -#endif namespace { @@ -229,36 +218,6 @@ void SetCurrentProcessPrivileges(ChildPrivileges privs) { gid_t gid = CHILD_UNPRIVILEGED_GID; uid_t uid = CHILD_UNPRIVILEGED_UID; -#ifdef MOZ_WIDGET_GONK - { - static bool checked_pix_max, pix_max_ok; - if (!checked_pix_max) { - checked_pix_max = true; - int fd = open("/proc/sys/kernel/pid_max", O_CLOEXEC | O_RDONLY); - if (fd < 0) { - DLOG(ERROR) << "Failed to open pid_max"; - _exit(127); - } - char buf[PATH_MAX]; - ssize_t len = read(fd, buf, sizeof(buf) - 1); - close(fd); - if (len < 0) { - DLOG(ERROR) << "Failed to read pid_max"; - _exit(127); - } - buf[len] = '\0'; - int pid_max = atoi(buf); - pix_max_ok = - (pid_max + CHILD_UNPRIVILEGED_UID > CHILD_UNPRIVILEGED_UID); - } - if (!pix_max_ok) { - DLOG(ERROR) << "Can't safely get unique uid/gid"; - _exit(127); - } - gid += getpid(); - uid += getpid(); - } -#endif if (setgid(gid) != 0) { DLOG(ERROR) << "FAILED TO setgid() CHILD PROCESS"; _exit(127); diff --git a/ipc/contentproc/plugin-container.cpp b/ipc/contentproc/plugin-container.cpp index 6a9341d7f..2fb9bd4f5 100644 --- a/ipc/contentproc/plugin-container.cpp +++ b/ipc/contentproc/plugin-container.cpp @@ -22,41 +22,6 @@ #include "GMPLoader.h" -#ifdef MOZ_WIDGET_GONK -# include <sys/time.h> -# include <sys/resource.h> - -# include <binder/ProcessState.h> - -# ifdef LOGE_IF -# undef LOGE_IF -# endif - -# include <android/log.h> -# define LOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_print(ANDROID_LOG_ERROR, \ - "Gecko:MozillaRntimeMain", __VA_ARGS__)) \ - : (void)0 ) - -#endif // MOZ_WIDGET_GONK - -#ifdef MOZ_WIDGET_GONK -static void -InitializeBinder(void *aDummy) { - // Change thread priority to 0 only during calling ProcessState::self(). - // The priority is registered to binder driver and used for default Binder - // Thread's priority. - // To change the process's priority to small value need's root permission. - int curPrio = getpriority(PRIO_PROCESS, 0); - int err = setpriority(PRIO_PROCESS, 0, 0); - MOZ_ASSERT(!err); - LOGE_IF(err, "setpriority failed. Current process needs root permission."); - android::ProcessState::self()->startThreadPool(); - setpriority(PRIO_PROCESS, 0, curPrio); -} -#endif - mozilla::gmp::SandboxStarter* MakeSandboxStarter() { @@ -76,15 +41,6 @@ content_process_main(int argc, char* argv[]) XRE_SetProcessType(argv[--argc]); -#ifdef MOZ_WIDGET_GONK - // This creates a ThreadPool for binder ipc. A ThreadPool is necessary to - // receive binder calls, though not necessary to send binder calls. - // ProcessState::Self() also needs to be called once on the main thread to - // register the main thread with the binder driver. - - InitializeBinder(nullptr); -#endif - #ifdef XP_WIN // For plugins, this is done in PluginProcessChild::Init, as we need to // avoid it for unsupported plugins. See PluginProcessChild::Init for @@ -94,7 +50,7 @@ content_process_main(int argc, char* argv[]) SetDllDirectoryW(L""); } #endif -#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) && defined(MOZ_PLUGIN_CONTAINER) +#if !defined(MOZ_WIDGET_ANDROID) && defined(MOZ_PLUGIN_CONTAINER) // On desktop, the GMPLoader lives in plugin-container, so that its // code can be covered by an EME/GMP vendor's voucher. nsAutoPtr<mozilla::gmp::SandboxStarter> starter(MakeSandboxStarter()); diff --git a/ipc/dbus/DBusHelpers.cpp b/ipc/dbus/DBusHelpers.cpp index 73b4596f2..f5c684572 100644 --- a/ipc/dbus/DBusHelpers.cpp +++ b/ipc/dbus/DBusHelpers.cpp @@ -14,12 +14,7 @@ #include "nsThreadUtils.h" #undef CHROMIUM_LOG -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gonk", args); -#else #define CHROMIUM_LOG(args...) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/dbus/DBusUtils.cpp b/ipc/dbus/DBusUtils.cpp index 6e36bca0f..7bcf749f8 100644 --- a/ipc/dbus/DBusUtils.cpp +++ b/ipc/dbus/DBusUtils.cpp @@ -20,12 +20,7 @@ #include "DBusUtils.h" #undef CHROMIUM_LOG -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gonk", args); -#else #define CHROMIUM_LOG(args...) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index 9ab9cc4d4..e58408e0c 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -62,13 +62,9 @@ static const int kMagicAndroidSystemPropFd = 5; #endif static const bool kLowRightsSubprocesses = - // We currently only attempt to drop privileges on gonk, because we - // have no plugins or extensions to worry about breaking. -#ifdef MOZ_WIDGET_GONK - true -#else + // We only attempted to drop privileges on gonk, because it + // had no plugins or extensions to worry about breaking. false -#endif ; static bool @@ -699,12 +695,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt } #endif // ANDROID -#ifdef MOZ_WIDGET_GONK - if (const char *ldPreloadPath = getenv("LD_PRELOAD")) { - newEnvVars["LD_PRELOAD"] = ldPreloadPath; - } -#endif // MOZ_WIDGET_GONK - // remap the IPC socket fd to a well-known int, as the OS does for // STDOUT_FILENO, for example int srcChannelFd, dstChannelFd; diff --git a/ipc/hal/DaemonSocket.cpp b/ipc/hal/DaemonSocket.cpp index 94c36b955..93b9960c5 100644 --- a/ipc/hal/DaemonSocket.cpp +++ b/ipc/hal/DaemonSocket.cpp @@ -14,14 +14,9 @@ #undef CHROMIUM_LOG #endif -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "I/O", args); -#else #include <stdio.h> #define IODEBUG true #define CHROMIUM_LOG(args...) if (IODEBUG) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/hal/DaemonSocketConnector.cpp b/ipc/hal/DaemonSocketConnector.cpp index 97106bdd0..5f12eff9b 100644 --- a/ipc/hal/DaemonSocketConnector.cpp +++ b/ipc/hal/DaemonSocketConnector.cpp @@ -18,14 +18,9 @@ #undef CHROMIUM_LOG #endif -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "I/O", args); -#else #include <stdio.h> #define IODEBUG true #define CHROMIUM_LOG(args...) if (IODEBUG) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/hal/DaemonSocketPDU.cpp b/ipc/hal/DaemonSocketPDU.cpp index de6aa0da7..7a3e4fdc0 100644 --- a/ipc/hal/DaemonSocketPDU.cpp +++ b/ipc/hal/DaemonSocketPDU.cpp @@ -12,14 +12,9 @@ #undef CHROMIUM_LOG #endif -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "I/O", args); -#else #include <stdio.h> #define IODEBUG true #define CHROMIUM_LOG(args...) if (IODEBUG) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/hal/DaemonSocketPDUHelpers.cpp b/ipc/hal/DaemonSocketPDUHelpers.cpp index 6aaf21c33..1e57ac297 100644 --- a/ipc/hal/DaemonSocketPDUHelpers.cpp +++ b/ipc/hal/DaemonSocketPDUHelpers.cpp @@ -15,26 +15,12 @@ #undef CHROMIUM_LOG #endif -#if defined(MOZ_WIDGET_GONK) - -#include <android/log.h> - -#define CHROMIUM_LOG(args...) \ - __android_log_print(ANDROID_LOG_INFO, "HAL-IPC", args); - -#define CHROMIUM_LOG_VA(fmt, ap) \ - __android_log_vprint(ANDROID_LOG_INFO, "HAL-IPC", fmt, ap); - -#else - #include <stdio.h> #define IODEBUG true #define CHROMIUM_LOG(args...) if (IODEBUG) { printf(args); } #define CHROMIUM_LOG_VA(fmt, ap) if (IODEBUG) { vprintf(fmt, ap); } -#endif - namespace mozilla { namespace ipc { namespace DaemonSocketPDUHelpers { diff --git a/ipc/keystore/KeyStore.cpp b/ipc/keystore/KeyStore.cpp index 992bc9075..5544b698d 100644 --- a/ipc/keystore/KeyStore.cpp +++ b/ipc/keystore/KeyStore.cpp @@ -10,12 +10,7 @@ #include <sys/stat.h> #include <sys/types.h> -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define KEYSTORE_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gonk", args) -#else #define KEYSTORE_LOG(args...) printf(args); -#endif #include "KeyStore.h" #include "jsfriendapi.h" diff --git a/ipc/keystore/KeyStoreConnector.cpp b/ipc/keystore/KeyStoreConnector.cpp index 0e11fcec6..4baf14175 100644 --- a/ipc/keystore/KeyStoreConnector.cpp +++ b/ipc/keystore/KeyStoreConnector.cpp @@ -13,12 +13,7 @@ #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, MOZ_COUNT_DTOR #include "nsThreadUtils.h" // For NS_IsMainThread. -#ifdef MOZ_WIDGET_GONK -#include <android/log.h> -#define KEYSTORE_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gonk", args) -#else #define KEYSTORE_LOG(args...) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/ril/Ril.cpp b/ipc/ril/Ril.cpp index 90fb12052..5c48643cc 100644 --- a/ipc/ril/Ril.cpp +++ b/ipc/ril/Ril.cpp @@ -21,12 +21,7 @@ #undef CHROMIUM_LOG #endif -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gonk", args) -#else #define CHROMIUM_LOG(args...) printf(args); -#endif namespace mozilla { namespace ipc { diff --git a/ipc/ril/RilConnector.cpp b/ipc/ril/RilConnector.cpp index 6e10beed7..7a86befaa 100644 --- a/ipc/ril/RilConnector.cpp +++ b/ipc/ril/RilConnector.cpp @@ -181,11 +181,7 @@ RilConnector::CreateStreamSocket(struct sockaddr* aAddress, socklen_t* aAddressLength, int& aStreamFd) { -#ifdef MOZ_WIDGET_GONK - static const int sDomain = AF_UNIX; -#else static const int sDomain = AF_INET; -#endif ScopedClose fd; diff --git a/ipc/unixfd/UnixFdWatcher.cpp b/ipc/unixfd/UnixFdWatcher.cpp index 41289a90b..367c1f597 100644 --- a/ipc/unixfd/UnixFdWatcher.cpp +++ b/ipc/unixfd/UnixFdWatcher.cpp @@ -11,14 +11,9 @@ #undef CHROMIUM_LOG #endif -#if defined(MOZ_WIDGET_GONK) -#include <android/log.h> -#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "I/O", args); -#else #include <stdio.h> #define IODEBUG true #define CHROMIUM_LOG(args...) if (IODEBUG) printf(args); -#endif namespace mozilla { namespace ipc { |