summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-17 17:19:41 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-01 15:47:43 +0200
commitce0cefe0534a01af0a055a0a781d898e8b9f18ca (patch)
tree9a855f8e126937ef84352d01bacda2b34fb1c130 /ipc
parent35e71030933059c0c312ec2dc35c616e31a3af75 (diff)
downloaduxp-ce0cefe0534a01af0a055a0a781d898e8b9f18ca.tar.gz
Issue #1053 - Second pass remove android defines and build system stuff.
Mostly IPC, tools and mozbuild.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/chromium/src/base/condition_variable_posix.cc7
-rw-r--r--ipc/chromium/src/base/file_path.h2
-rw-r--r--ipc/chromium/src/base/file_util.cc2
-rw-r--r--ipc/chromium/src/base/file_util.h2
-rw-r--r--ipc/chromium/src/base/file_util_posix.cc4
-rw-r--r--ipc/chromium/src/base/hash_tables.h24
-rw-r--r--ipc/chromium/src/base/message_loop.cc3
-rw-r--r--ipc/chromium/src/base/message_pump_libevent.cc2
-rw-r--r--ipc/chromium/src/base/observer_list.h4
-rw-r--r--ipc/chromium/src/base/platform_file_posix.cc3
-rw-r--r--ipc/chromium/src/base/process_util_posix.cc9
-rw-r--r--ipc/chromium/src/base/shared_memory_posix.cc34
-rw-r--r--ipc/chromium/src/base/sys_info_posix.cc6
-rw-r--r--ipc/chromium/src/base/time_posix.cc8
14 files changed, 9 insertions, 101 deletions
diff --git a/ipc/chromium/src/base/condition_variable_posix.cc b/ipc/chromium/src/base/condition_variable_posix.cc
index 59e919d697..f39c2d3685 100644
--- a/ipc/chromium/src/base/condition_variable_posix.cc
+++ b/ipc/chromium/src/base/condition_variable_posix.cc
@@ -20,7 +20,7 @@ ConditionVariable::ConditionVariable(Lock* user_lock)
: user_mutex_(user_lock->lock_impl()->os_lock()) {
int rv = 0;
#if !defined(OS_MACOSX) && \
- !(defined(OS_ANDROID) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
+ defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
pthread_condattr_t attrs;
rv = pthread_condattr_init(&attrs);
DCHECK_EQ(0, rv);
@@ -68,12 +68,7 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
absolute_time.tv_nsec %= Time::kNanosecondsPerSecond;
DCHECK_GE(absolute_time.tv_sec, now.tv_sec); // Overflow paranoia
-#if defined(OS_ANDROID) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
- int rv = pthread_cond_timedwait_monotonic_np(
- &condition_, user_mutex_, &absolute_time);
-#else
int rv = pthread_cond_timedwait(&condition_, user_mutex_, &absolute_time);
-#endif // OS_ANDROID && HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC
#endif // OS_MACOSX
DCHECK(rv == 0 || rv == ETIMEDOUT);
diff --git a/ipc/chromium/src/base/file_path.h b/ipc/chromium/src/base/file_path.h
index 78798bf531..42708a5241 100644
--- a/ipc/chromium/src/base/file_path.h
+++ b/ipc/chromium/src/base/file_path.h
@@ -252,7 +252,7 @@ class FilePath {
#endif // OS_WIN
// Implement hash function so that we can use FilePaths in hashsets and maps.
-#if defined(COMPILER_GCC) && !defined(ANDROID)
+#if defined(COMPILER_GCC)
namespace __gnu_cxx {
template<>
diff --git a/ipc/chromium/src/base/file_util.cc b/ipc/chromium/src/base/file_util.cc
index 376309d1eb..233c0949f7 100644
--- a/ipc/chromium/src/base/file_util.cc
+++ b/ipc/chromium/src/base/file_util.cc
@@ -9,7 +9,7 @@
#include <io.h>
#endif
#include <stdio.h>
-#if defined(ANDROID) || defined(OS_POSIX)
+#if defined(OS_POSIX)
#include <unistd.h>
#endif
diff --git a/ipc/chromium/src/base/file_util.h b/ipc/chromium/src/base/file_util.h
index 30e2605064..79686a998c 100644
--- a/ipc/chromium/src/base/file_util.h
+++ b/ipc/chromium/src/base/file_util.h
@@ -13,8 +13,6 @@
#if defined(OS_WIN)
#include <windows.h>
-#elif defined(ANDROID)
-#include <sys/stat.h>
#elif defined(OS_POSIX)
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/ipc/chromium/src/base/file_util_posix.cc b/ipc/chromium/src/base/file_util_posix.cc
index 6a9fa6b960..72c742a94f 100644
--- a/ipc/chromium/src/base/file_util_posix.cc
+++ b/ipc/chromium/src/base/file_util_posix.cc
@@ -165,13 +165,9 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix,
return false;
tmpdir = tmpdir.Append(kTempFileName);
std::string tmpdir_string = tmpdir.value();
-#ifdef ANDROID
- char* dtemp = NULL;
-#else
// this should be OK since mkdtemp just replaces characters in place
char* buffer = const_cast<char*>(tmpdir_string.c_str());
char* dtemp = mkdtemp(buffer);
-#endif
if (!dtemp)
return false;
*new_temp_path = FilePath(dtemp);
diff --git a/ipc/chromium/src/base/hash_tables.h b/ipc/chromium/src/base/hash_tables.h
index 87e50e8dbb..1df618f43e 100644
--- a/ipc/chromium/src/base/hash_tables.h
+++ b/ipc/chromium/src/base/hash_tables.h
@@ -20,38 +20,18 @@
#include "base/string16.h"
-#if defined(COMPILER_MSVC) || (defined(ANDROID) && defined(_STLP_STD_NAME))
-#ifdef COMPILER_MSVC
+#if defined(COMPILER_MSVC)
#pragma push_macro("_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS")
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
-#endif
-
-// Suppress -Wshadow warnings from stlport headers.
-#ifdef __GNUC__
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wshadow"
-# pragma GCC diagnostic ignored "-Wshadow-local"
-#endif
#include <hash_map>
#include <hash_set>
-#ifdef __GNUC__
-# pragma GCC diagnostic pop // -Wshadow-local
-# pragma GCC diagnostic pop // -Wshadow
-#endif
-
-#ifdef COMPILER_MSVC
#pragma pop_macro("_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS")
-#endif
+
namespace base {
-#ifdef ANDROID
-using _STLP_STD_NAME::hash_map;
-using _STLP_STD_NAME::hash_set;
-#else
using stdext::hash_map;
using stdext::hash_set;
-#endif
}
#elif defined(COMPILER_GCC)
// This is a hack to disable the gcc 4.4 warning about hash_map and hash_set
diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc
index 61204cd9bc..69493dccb1 100644
--- a/ipc/chromium/src/base/message_loop.cc
+++ b/ipc/chromium/src/base/message_loop.cc
@@ -25,9 +25,6 @@
#include "base/message_pump_glib.h"
#endif
#endif
-#ifdef ANDROID
-#include "base/message_pump_android.h"
-#endif
#ifdef MOZ_TASK_TRACER
#include "GeckoTaskTracer.h"
#include "TracedTaskCommon.h"
diff --git a/ipc/chromium/src/base/message_pump_libevent.cc b/ipc/chromium/src/base/message_pump_libevent.cc
index 137fdb6b00..44987a00d9 100644
--- a/ipc/chromium/src/base/message_pump_libevent.cc
+++ b/ipc/chromium/src/base/message_pump_libevent.cc
@@ -10,7 +10,7 @@
#ifdef OS_SOLARIS
#include <sys/stat.h>
#endif
-#if defined(ANDROID) || defined(OS_POSIX)
+#if defined(OS_POSIX)
#include <unistd.h>
#endif
diff --git a/ipc/chromium/src/base/observer_list.h b/ipc/chromium/src/base/observer_list.h
index 08777166fd..0523cf6d6c 100644
--- a/ipc/chromium/src/base/observer_list.h
+++ b/ipc/chromium/src/base/observer_list.h
@@ -13,10 +13,6 @@
#include "base/basictypes.h"
#include "base/logging.h"
-#if defined(ANDROID) && defined(_STLP_STD_NAME)
-using _STLP_STD_NAME::find;
-#endif
-
namespace base {
///////////////////////////////////////////////////////////////////////////////
diff --git a/ipc/chromium/src/base/platform_file_posix.cc b/ipc/chromium/src/base/platform_file_posix.cc
index 084264fd8f..fb65a885d5 100644
--- a/ipc/chromium/src/base/platform_file_posix.cc
+++ b/ipc/chromium/src/base/platform_file_posix.cc
@@ -8,9 +8,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-#ifdef ANDROID
-#include <linux/stat.h>
-#endif
#include "base/logging.h"
#include "base/string_util.h"
diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc
index 3b80894a1d..98b6e98230 100644
--- a/ipc/chromium/src/base/process_util_posix.cc
+++ b/ipc/chromium/src/base/process_util_posix.cc
@@ -94,10 +94,6 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
return result;
}
-#ifdef ANDROID
-typedef unsigned long int rlim_t;
-#endif
-
// A class to handle auto-closing of DIR*'s.
class ScopedDIRClose {
public:
@@ -113,10 +109,7 @@ typedef mozilla::UniquePtr<DIR, ScopedDIRClose> ScopedDIR;
void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
// DANGER: no calls to malloc are allowed from now on:
// http://crbug.com/36678
-#if defined(ANDROID)
- static const rlim_t kSystemDefaultMaxFds = 1024;
- static const char kFDDir[] = "/proc/self/fd";
-#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+#if defined(OS_LINUX) || defined(OS_SOLARIS)
static const rlim_t kSystemDefaultMaxFds = 8192;
static const char kFDDir[] = "/proc/self/fd";
#elif defined(OS_MACOSX)
diff --git a/ipc/chromium/src/base/shared_memory_posix.cc b/ipc/chromium/src/base/shared_memory_posix.cc
index 742d1a3832..5aa061fee6 100644
--- a/ipc/chromium/src/base/shared_memory_posix.cc
+++ b/ipc/chromium/src/base/shared_memory_posix.cc
@@ -269,39 +269,6 @@ void SharedMemory::Close(bool unmap_view) {
}
}
-#ifdef ANDROID
-void SharedMemory::LockOrUnlockCommon(int function) {
- DCHECK(mapped_file_ >= 0);
- struct flock lockreq;
- lockreq.l_type = function;
- lockreq.l_whence = SEEK_SET;
- lockreq.l_start = 0;
- lockreq.l_len = 0;
- while (fcntl(mapped_file_, F_SETLKW, &lockreq) < 0) {
- if (errno == EINTR) {
- continue;
- } else if (errno == ENOLCK) {
- // temporary kernel resource exaustion
- PlatformThread::Sleep(500);
- continue;
- } else {
- NOTREACHED() << "lockf() failed."
- << " function:" << function
- << " fd:" << mapped_file_
- << " errno:" << errno
- << " msg:" << strerror(errno);
- }
- }
-}
-
-void SharedMemory::Lock() {
- LockOrUnlockCommon(F_WRLCK);
-}
-
-void SharedMemory::Unlock() {
- LockOrUnlockCommon(F_UNLCK);
-}
-#else
void SharedMemory::LockOrUnlockCommon(int function) {
DCHECK(mapped_file_ >= 0);
while (lockf(mapped_file_, function, 0) < 0) {
@@ -328,7 +295,6 @@ void SharedMemory::Lock() {
void SharedMemory::Unlock() {
LockOrUnlockCommon(F_ULOCK);
}
-#endif
SharedMemoryHandle SharedMemory::handle() const {
return FileDescriptor(mapped_file_, false);
diff --git a/ipc/chromium/src/base/sys_info_posix.cc b/ipc/chromium/src/base/sys_info_posix.cc
index 05dbc0b7b2..7df1dea176 100644
--- a/ipc/chromium/src/base/sys_info_posix.cc
+++ b/ipc/chromium/src/base/sys_info_posix.cc
@@ -8,9 +8,7 @@
#include <errno.h>
#include <string.h>
-#ifndef ANDROID
#include <sys/statvfs.h>
-#endif
#include <sys/utsname.h>
#include <unistd.h>
@@ -90,15 +88,11 @@ int64_t SysInfo::AmountOfPhysicalMemory() {
// static
int64_t SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) {
-#ifndef ANDROID
struct statvfs stats;
if (statvfs(WideToUTF8(path).c_str(), &stats) != 0) {
return -1;
}
return static_cast<int64_t>(stats.f_bavail) * stats.f_frsize;
-#else
- return -1;
-#endif
}
// static
diff --git a/ipc/chromium/src/base/time_posix.cc b/ipc/chromium/src/base/time_posix.cc
index 2eea2a97a1..46b2c5cab1 100644
--- a/ipc/chromium/src/base/time_posix.cc
+++ b/ipc/chromium/src/base/time_posix.cc
@@ -9,12 +9,8 @@
#include <mach/mach_time.h>
#endif
#include <sys/time.h>
-#if defined(ANDROID) && !defined(__LP64__)
-#include <time64.h>
-#else
#include <time.h>
-#endif
-#if defined(ANDROID) || defined(OS_POSIX)
+#if defined(OS_POSIX)
#include <unistd.h>
#endif
@@ -72,7 +68,7 @@ Time Time::FromExploded(bool is_local, const Exploded& exploded) {
#endif
time_t seconds;
-#if defined(ANDROID) || defined(OS_SOLARIS)
+#if defined(OS_SOLARIS)
seconds = mktime(&timestruct);
#else
if (is_local)