Commit 51256752 authored by Fabrice de Gans-Riberi's avatar Fabrice de Gans-Riberi Committed by Commit Bot

Fuchsia: Prepare for OS_POSIX removal in Blink.

This cleans up multi-platform code paths selection and prepares for
the removal of OS_POSIX for the Fuchsia build.

Bug: 836416
Change-Id: Ia326c5b5f0f05d347ee52abc89ad69386761792f
Reviewed-on: https://chromium-review.googlesource.com/1033994
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556918}
parent 98cd6585
...@@ -954,11 +954,9 @@ inline uint32_t GetRandomMagic() { ...@@ -954,11 +954,9 @@ inline uint32_t GetRandomMagic() {
#if defined(OS_WIN) #if defined(OS_WIN)
static const uintptr_t random2 = static const uintptr_t random2 =
~(RotateLeft16(reinterpret_cast<uintptr_t>(::ReadFile))); ~(RotateLeft16(reinterpret_cast<uintptr_t>(::ReadFile)));
#elif defined(OS_POSIX) #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
static const uintptr_t random2 = static const uintptr_t random2 =
~(RotateLeft16(reinterpret_cast<uintptr_t>(::read))); ~(RotateLeft16(reinterpret_cast<uintptr_t>(::read)));
#else
#error OS not supported
#endif #endif
#if defined(ARCH_CPU_64_BITS) #if defined(ARCH_CPU_64_BITS)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include <windows.h> #include <windows.h>
#elif defined(OS_POSIX) #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -36,7 +36,7 @@ WebThreadCreationParams& WebThreadCreationParams::SetFrameScheduler( ...@@ -36,7 +36,7 @@ WebThreadCreationParams& WebThreadCreationParams::SetFrameScheduler(
#if defined(OS_WIN) #if defined(OS_WIN)
static_assert(sizeof(blink::PlatformThreadId) >= sizeof(DWORD), static_assert(sizeof(blink::PlatformThreadId) >= sizeof(DWORD),
"size of platform thread id is too small"); "size of platform thread id is too small");
#elif defined(OS_POSIX) #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
static_assert(sizeof(blink::PlatformThreadId) >= sizeof(pid_t), static_assert(sizeof(blink::PlatformThreadId) >= sizeof(pid_t),
"size of platform thread id is too small"); "size of platform thread id is too small");
#else #else
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_POSIX) #if defined(OS_POSIX) || defined(OS_FUCHSIA)
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
......
...@@ -41,15 +41,19 @@ ...@@ -41,15 +41,19 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include <windows.h> #include <windows.h>
#endif #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
#if defined(OS_POSIX)
#include <pthread.h> #include <pthread.h>
#endif #endif
namespace WTF { namespace WTF {
#if defined(OS_POSIX) #if defined(OS_WIN)
struct PlatformMutex {
CRITICAL_SECTION internal_mutex_;
size_t recursion_count_;
};
typedef CONDITION_VARIABLE PlatformCondition;
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
struct PlatformMutex { struct PlatformMutex {
pthread_mutex_t internal_mutex_; pthread_mutex_t internal_mutex_;
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
...@@ -57,15 +61,6 @@ struct PlatformMutex { ...@@ -57,15 +61,6 @@ struct PlatformMutex {
#endif #endif
}; };
typedef pthread_cond_t PlatformCondition; typedef pthread_cond_t PlatformCondition;
#elif defined(OS_WIN)
struct PlatformMutex {
CRITICAL_SECTION internal_mutex_;
size_t recursion_count_;
};
typedef CONDITION_VARIABLE PlatformCondition;
#else
typedef void* PlatformMutex;
typedef void* PlatformCondition;
#endif #endif
class WTF_EXPORT MutexBase { class WTF_EXPORT MutexBase {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_POSIX) #if defined(OS_POSIX) || defined(OS_FUCHSIA)
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
...@@ -270,4 +270,4 @@ void WillCreateThread() { ...@@ -270,4 +270,4 @@ void WillCreateThread() {
} // namespace WTF } // namespace WTF
#endif // defined(OS_POSIX) #endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment