Skip to content

Instantly share code, notes, and snippets.

@KapiX KapiX/0000-README.md

Last active Jul 2, 2020
Embed
What would you like to do?
QtWebEngine Haiku patchset

These patches are for qtwebengine-everywhere-src-5.12.3.tar.xz, SHA256: 3ff3bac12d75aa0f3fd993bb7077fe411f7b0e6a3993af6f8b039d48e3dc4317

Linking stage for QtWebEngineCore requires 10+GB of RAM :) (debug build)

Additional stuff needed:

Fixed libxslt.pc (non-packaged/develop/lib/pkgconfig) - qmake checks if directories in .pc files exist and will fail with some libs if libxslt was built with libxml2-2.6.2 and libxml2 was later updated to let's say libxml2-2.9.9, libxslt.pc will contain -L with non-existent directory (because it was not rebuilt with newer libxml2) Custom .pc file fixes this.

Create build directory and build-qtwebengine.sh inside of it:

qmake "CONFIG+=debug" .. -- \
	-no-webengine-printing-and-pdf \
	-no-webengine-pepper-plugins \
	-no-webengine-spellchecker \
	-no-webengine-webrtc
cd build
./build-qtwebengine.sh
make
make examples

Copy libraries and cmake files (build/lib) to non-packaged. Maybe adjust CMakes to point to /build/lib.

Build falkon.

mkdir build && cd build
cmake .. -DECM_DIR=/boot/system/data/cmake/Modules/ECM/cmake -DQt5WebEngine_DIR=/boot/home/config/non-packaged/lib/cmake/Qt5WebEngine -DQt5WebEngineWidgets_DIR=/boot/home/config/non-packaged/lib/cmake/Qt5WebEngineWidgets/ -DQt5WebChannel_DIR=/boot/system/lib/cmake/Qt5WebChannel -DQt5Positioning_DIR=/boot/system/lib/cmake/Qt5Positioning -DDISABLE_DBUS=1 -DNO_X11=1
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 74775e35..21e19faf 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -357,6 +357,9 @@ if (UNIX AND NOT APPLE)
     if (NOT NO_X11)
         target_link_libraries(FalkonPrivate XCB::XCB Qt5::X11Extras)
     endif()
+    if (HAVE_LIBINTL)
+        target_link_libraries(FalkonPrivate intl)
+    endif()

     set_target_properties(FalkonPrivate PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION "3")
     install(TARGETS FalkonPrivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)

Copy from /build/src/core/debug:

  • qtwebengine_devtools_resources.pak
  • qtwebengine_resources_100p.pak
  • qtwebengine_resources_200p.pak
  • qtwebengine_resources.pak
  • qtwebengine_locales

to /build/bin.

Run in /build/bin:

LIBRARY_PATH=<qtwebengine-path>/build/lib:.:$LIBRARY_PATH QTWEBENGINEPROCESS_PATH=<qtwebengine-path>/build/libexec/QtWebEngineProcess" falkon

PROFIT

stderr:

[168503:-752511648:0707/034611.273591:ERROR:broker_posix.cc(40)] Recvmsg error: Socket operation on non-socket (-2147454932)

That's probably why the window is empty (it can't communicate with the process).

It's also possible that I have botched something in the renderer. ¯\_(ツ)_/¯

From 64b8914aad2fd169e7d9153d388739b280c52833 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Sat, 27 Apr 2019 01:09:57 +0200
Subject: [PATCH 1/5] base builds
---
.gitignore | 1 +
mkspecs/features/functions.prf | 1 +
mkspecs/features/platform.prf | 4 +-
src/3rdparty/chromium/BUILD.gn | 5 +-
src/3rdparty/chromium/base/BUILD.gn | 4 +
.../page_allocator_internals_posix.h | 5 +
src/3rdparty/chromium/base/files/file.h | 3 +-
.../chromium/base/files/file_posix.cc | 3 +-
.../chromium/base/files/file_util_posix.cc | 3 +-
.../base/files/memory_mapped_file_posix.cc | 3 +-
.../base/memory/discardable_shared_memory.cc | 7 +
.../base/message_loop/message_pump_for_ui.h | 2 +-
.../chromium/base/posix/unix_domain_socket.cc | 10 +-
.../chromium/base/process/launch_posix.cc | 5 +-
.../chromium/base/process/process_metrics.h | 10 +-
.../base/process/process_metrics_posix.cc | 2 +
.../base/third_party/libevent/BUILD.gn | 7 +
.../base/third_party/libevent/event-config.h | 2 +
.../base/third_party/libevent/haiku/config.h | 272 +++++++++++++++++
.../third_party/libevent/haiku/event-config.h | 280 ++++++++++++++++++
.../base/trace_event/malloc_dump_provider.cc | 2 +-
.../base/trace_event/process_memory_dump.cc | 2 +-
src/3rdparty/chromium/build/build_config.h | 4 +-
.../chromium/build/config/BUILDCONFIG.gn | 38 ++-
.../chromium/build/config/compiler/BUILD.gn | 6 +-
src/3rdparty/chromium/build/config/crypto.gni | 2 +-
.../chromium/build/config/haiku/BUILD.gn | 19 ++
.../chromium/build/config/linux/pkg-config.py | 2 +-
.../third_party/libjpeg_turbo/BUILD.gn | 2 +-
.../build/secondary/third_party/nss/BUILD.gn | 2 +-
.../chromium/build/toolchain/haiku/BUILD.gn | 44 +++
src/3rdparty/chromium/chrome/browser/BUILD.gn | 2 +-
src/3rdparty/chromium/chrome/test/BUILD.gn | 2 +-
src/3rdparty/chromium/components/BUILD.gn | 7 +
.../components/crash/content/browser/BUILD.gn | 2 +-
.../components/crash/core/common/BUILD.gn | 2 +-
.../content/browser/BUILD.gn | 8 +-
src/3rdparty/chromium/content/shell/BUILD.gn | 10 +-
.../chromium/gpu/ipc/common/surface_handle.h | 4 +-
src/3rdparty/chromium/headless/BUILD.gn | 6 +-
.../chromium/third_party/libxml/BUILD.gn | 2 +-
src/core/config/haiku.pri | 71 +++++
src/core/configure.json | 1 -
src/core/core_module.pro | 2 +
44 files changed, 829 insertions(+), 42 deletions(-)
create mode 100644 .gitignore
create mode 100644 src/3rdparty/chromium/base/third_party/libevent/haiku/config.h
create mode 100644 src/3rdparty/chromium/base/third_party/libevent/haiku/event-config.h
create mode 100644 src/3rdparty/chromium/build/config/haiku/BUILD.gn
create mode 100644 src/3rdparty/chromium/build/toolchain/haiku/BUILD.gn
create mode 100644 src/core/config/haiku.pri
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..0d20b6487
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.pyc
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index f6aeea21a..9532d3562 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -82,6 +82,7 @@ defineReplace(gnArgs) {
linux: include($$QTWEBENGINE_ROOT/src/core/config/linux.pri)
macos: include($$QTWEBENGINE_ROOT/src/core/config/mac_osx.pri)
win32: include($$QTWEBENGINE_ROOT/src/core/config/windows.pri)
+ haiku: include($$QTWEBENGINE_ROOT/src/core/config/haiku.pri)
isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.)
return($$gn_args)
}
diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
index 35eb6b89c..41bc19c95 100644
--- a/mkspecs/features/platform.prf
+++ b/mkspecs/features/platform.prf
@@ -57,8 +57,10 @@ defineTest(isPlatformSupported) {
skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
return(false)
}
+ } else:haiku {
+ gcc:!clang:!isGCCVersionSupported(): return(false)
} else {
- skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+ skipBuild("Unknown platform. Qt WebEngine only supports Linux, Haiku, Windows, and macOS.")
return(false)
}
diff --git a/src/3rdparty/chromium/BUILD.gn b/src/3rdparty/chromium/BUILD.gn
index 5a20c9076..b999c70db 100644
--- a/src/3rdparty/chromium/BUILD.gn
+++ b/src/3rdparty/chromium/BUILD.gn
@@ -533,7 +533,7 @@ group("gn_all") {
"//third_party/breakpad:minidump_stackwalk($host_toolchain)",
]
- if (!is_android) {
+ if (!is_android && !is_haiku) {
deps += [
"//chrome/test:chrome_app_unittests",
"//gpu/khronos_glcts_support:khronos_glcts_test",
@@ -607,7 +607,7 @@ group("gn_all") {
host_os == "win" && !use_qt) {
deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
}
- } else if (!is_android && !is_ios && !is_fuchsia) {
+ } else if (!is_android && !is_ios && !is_fuchsia && !is_haiku) {
deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
}
@@ -1165,6 +1165,7 @@ template("assert_valid_out_dir") {
"*\bmac/*",
"*\bposix/*",
"*\bwin/*",
+ "*\bhaiku/*",
])
assert(target_name != "") # Mark as used.
sources = invoker.actual_sources
diff --git a/src/3rdparty/chromium/base/BUILD.gn b/src/3rdparty/chromium/base/BUILD.gn
index 62f54f809..010384706 100644
--- a/src/3rdparty/chromium/base/BUILD.gn
+++ b/src/3rdparty/chromium/base/BUILD.gn
@@ -1455,6 +1455,10 @@ jumbo_component("base") {
]
}
+ if (is_haiku) {
+ defines += [ "_BSD_SOURCE", "__USE_XOPEN2K8" ]
+ }
+
# NaCl.
if (is_nacl) {
# We reset sources_assignment_filter in order to explicitly include
diff --git a/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h b/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h
index a5792666f..48292a8b7 100644
--- a/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h
+++ b/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_internals_posix.h
@@ -21,6 +21,11 @@
#define MAP_ANONYMOUS MAP_ANON
#endif
+#if defined(OS_HAIKU)
+#define madvise posix_madvise
+#define MADV_DONTNEED POSIX_MADV_DONTNEED
+#endif
+
namespace base {
// |mmap| uses a nearby address if the hint address is blocked.
diff --git a/src/3rdparty/chromium/base/files/file.h b/src/3rdparty/chromium/base/files/file.h
index 30f405321..3438bbdc1 100644
--- a/src/3rdparty/chromium/base/files/file.h
+++ b/src/3rdparty/chromium/base/files/file.h
@@ -25,7 +25,8 @@
namespace base {
#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \
- defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
+ defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
+ defined(OS_HAIKU)
typedef struct stat stat_wrapper_t;
#elif defined(OS_POSIX)
typedef struct stat64 stat_wrapper_t;
diff --git a/src/3rdparty/chromium/base/files/file_posix.cc b/src/3rdparty/chromium/base/files/file_posix.cc
index 83018f2f3..bc45d733f 100644
--- a/src/3rdparty/chromium/base/files/file_posix.cc
+++ b/src/3rdparty/chromium/base/files/file_posix.cc
@@ -31,7 +31,8 @@ static_assert(File::FROM_BEGIN == SEEK_SET && File::FROM_CURRENT == SEEK_CUR &&
namespace {
#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \
- defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
+ defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
+ defined(OS_HAIKU)
int CallFstat(int fd, stat_wrapper_t *sb) {
AssertBlockingAllowed();
return fstat(fd, sb);
diff --git a/src/3rdparty/chromium/base/files/file_util_posix.cc b/src/3rdparty/chromium/base/files/file_util_posix.cc
index e888c82e0..cb01fd3dc 100644
--- a/src/3rdparty/chromium/base/files/file_util_posix.cc
+++ b/src/3rdparty/chromium/base/files/file_util_posix.cc
@@ -69,7 +69,8 @@ namespace base {
namespace {
#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \
- defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
+ defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
+ defined(OS_HAIKU)
int CallStat(const char* path, stat_wrapper_t* sb) {
AssertBlockingAllowed();
return stat(path, sb);
diff --git a/src/3rdparty/chromium/base/files/memory_mapped_file_posix.cc b/src/3rdparty/chromium/base/files/memory_mapped_file_posix.cc
index 45a0aea6d..0443c57f6 100644
--- a/src/3rdparty/chromium/base/files/memory_mapped_file_posix.cc
+++ b/src/3rdparty/chromium/base/files/memory_mapped_file_posix.cc
@@ -106,7 +106,8 @@ bool MemoryMappedFile::MapFileRegionToMemory(
// fail if the disk is full and the file is sparse.
bool do_manual_extension = false;
-#if defined(OS_ANDROID) && __ANDROID_API__ < 21
+#if (defined(OS_ANDROID) && __ANDROID_API__ < 21) || defined(OS_HAIKU)
+ // Haiku doesn't support fallocate at all yet (#6285)
// Only Android API>=21 supports the fallocate call. Older versions need
// to manually extend the file by writing zeros at block intervals.
do_manual_extension = true;
diff --git a/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc b/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc
index 3b6b4dbfa..5ce103d6a 100644
--- a/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc
+++ b/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc
@@ -32,6 +32,11 @@
#include "base/win/windows_version.h"
#endif
+#if defined(OS_HAIKU)
+#define madvise posix_madvise
+#define MADV_DONTNEED POSIX_MADV_DONTNEED
+#endif
+
namespace base {
namespace {
@@ -380,6 +385,8 @@ bool DiscardableSharedMemory::Purge(Time current_time) {
// reusable bit, which allows both Activity Monitor and memory-infra to
// correctly track the pages.
#define MADV_PURGE_ARGUMENT MADV_FREE_REUSABLE
+#elif defined(OS_HAIKU)
+#define MADV_PURGE_ARGUMENT POSIX_MADV_DONTNEED
#else
#define MADV_PURGE_ARGUMENT MADV_FREE
#endif
diff --git a/src/3rdparty/chromium/base/message_loop/message_pump_for_ui.h b/src/3rdparty/chromium/base/message_loop/message_pump_for_ui.h
index 6ee02b094..f3b8113a8 100644
--- a/src/3rdparty/chromium/base/message_loop/message_pump_for_ui.h
+++ b/src/3rdparty/chromium/base/message_loop/message_pump_for_ui.h
@@ -44,7 +44,7 @@ using MessagePumpForUI = MessagePump;
// TODO(abarth): Figure out if we need this.
#elif defined(USE_GLIB)
using MessagePumpForUI = MessagePumpGlib;
-#elif defined(OS_LINUX) || defined(OS_BSD)
+#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HAIKU)
using MessagePumpForUI = MessagePumpLibevent;
#elif defined(OS_FUCHSIA)
using MessagePumpForUI = MessagePumpFuchsia;
diff --git a/src/3rdparty/chromium/base/posix/unix_domain_socket.cc b/src/3rdparty/chromium/base/posix/unix_domain_socket.cc
index 7c087a53b..3df3e657f 100644
--- a/src/3rdparty/chromium/base/posix/unix_domain_socket.cc
+++ b/src/3rdparty/chromium/base/posix/unix_domain_socket.cc
@@ -56,7 +56,7 @@ bool CreateSocketPair(ScopedFD* one, ScopedFD* two) {
// static
bool UnixDomainSocket::EnableReceiveProcessId(int fd) {
-#if !defined(OS_MACOSX)
+#if !defined(OS_MACOSX) && !defined(OS_HAIKU)
const int enable = 1;
return setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)) == 0;
#else
@@ -147,11 +147,11 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
const size_t kControlBufferSize =
CMSG_SPACE(sizeof(int) * kMaxFileDescriptors)
-#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
+#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX) && !defined(OS_HAIKU)
// The PNaCl toolchain for Non-SFI binary build and macOS do not support
// ucred. macOS supports xucred, but this structure is insufficient.
+ CMSG_SPACE(sizeof(struct ucred))
-#endif // OS_NACL_NONSFI or OS_MACOSX
+#endif // OS_NACL_NONSFI or OS_MACOSX or OS_HAIKU
;
char control_buffer[kControlBufferSize];
msg.msg_control = control_buffer;
@@ -175,7 +175,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
wire_fds_len = payload_len / sizeof(int);
}
-#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
+#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX) && !defined(OS_HAIKU)
// The PNaCl toolchain for Non-SFI binary build and macOS do not support
// SCM_CREDENTIALS.
if (cmsg->cmsg_level == SOL_SOCKET &&
@@ -184,7 +184,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
DCHECK_EQ(pid, -1);
pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid;
}
-#endif // !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
+#endif // !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX) && !defined(OS_HAIKU)
}
}
diff --git a/src/3rdparty/chromium/base/process/launch_posix.cc b/src/3rdparty/chromium/base/process/launch_posix.cc
index ec584883b..b4ce6ff52 100644
--- a/src/3rdparty/chromium/base/process/launch_posix.cc
+++ b/src/3rdparty/chromium/base/process/launch_posix.cc
@@ -14,7 +14,9 @@
#include <stdint.h>
#include <stdlib.h>
#include <sys/resource.h>
+#if !defined(OS_HAIKU)
#include <sys/syscall.h>
+#endif
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -236,7 +238,7 @@ static const char kFDDir[] = "/proc/self/fd";
void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
// DANGER: no calls to malloc or locks are allowed from now on:
// http://crbug.com/36678
-
+#if !defined(OS_HAIKU)
// Get the maximum number of FDs possible.
size_t max_fds = GetMaxFds();
@@ -291,6 +293,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
int ret = IGNORE_EINTR(close(fd));
DPCHECK(ret == 0);
}
+ #endif
}
Process LaunchProcess(const CommandLine& cmdline,
diff --git a/src/3rdparty/chromium/base/process/process_metrics.h b/src/3rdparty/chromium/base/process/process_metrics.h
index 6bfd93ece..16940b27f 100644
--- a/src/3rdparty/chromium/base/process/process_metrics.h
+++ b/src/3rdparty/chromium/base/process/process_metrics.h
@@ -275,7 +275,8 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_descriptors);
#endif // defined(OS_POSIX)
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
- defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA)
+ defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA) || \
+ defined(OS_HAIKU)
// Data about system-wide memory consumption. Values are in KB. Available on
// Windows, Mac, Linux, Android and Chrome OS.
//
@@ -323,7 +324,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
#endif
#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) || \
- defined(OS_FUCHSIA)
+ defined(OS_FUCHSIA) || defined(OS_HAIKU)
int buffers = 0;
int cached = 0;
int active_anon = 0;
@@ -333,7 +334,7 @@ struct BASE_EXPORT SystemMemoryInfoKB {
int dirty = 0;
int reclaimable = 0;
#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) ||
- // defined(OS_FUCHSIA)
+ // defined(OS_FUCHSIA) || defined(OS_HAIKU)
#if defined(OS_CHROMEOS)
int shmem = 0;
@@ -359,7 +360,8 @@ struct BASE_EXPORT SystemMemoryInfoKB {
BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo);
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ||
- // defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA)
+ // defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA) ||
+ // defined(OS_HAIKU)
#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
// Parse the data found in /proc/<pid>/stat and return the sum of the
diff --git a/src/3rdparty/chromium/base/process/process_metrics_posix.cc b/src/3rdparty/chromium/base/process/process_metrics_posix.cc
index a09bbf2c5..4dae83934 100644
--- a/src/3rdparty/chromium/base/process/process_metrics_posix.cc
+++ b/src/3rdparty/chromium/base/process/process_metrics_posix.cc
@@ -52,6 +52,8 @@ static const rlim_t kSystemDefaultMaxFds = 256;
static const rlim_t kSystemDefaultMaxFds = 1024;
#elif defined(OS_AIX)
static const rlim_t kSystemDefaultMaxFds = 8192;
+#elif defined(OS_HAIKU)
+static const rlim_t kSystemDefaultMaxFds = 8192;
#endif
size_t GetMaxFds() {
diff --git a/src/3rdparty/chromium/base/third_party/libevent/BUILD.gn b/src/3rdparty/chromium/base/third_party/libevent/BUILD.gn
index 62e212870..8961acf64 100644
--- a/src/3rdparty/chromium/base/third_party/libevent/BUILD.gn
+++ b/src/3rdparty/chromium/base/third_party/libevent/BUILD.gn
@@ -78,6 +78,13 @@ static_library("bundled_libevent") {
"nacl_nonsfi/signal_stub.c",
]
include_dirs = [ "nacl_nonsfi" ]
+ } else if (is_haiku) {
+ sources += [
+ "haiku/config.h",
+ "haiku/event-config.h",
+ ]
+ include_dirs = [ "haiku", "compat" ]
+ libs = [ "network" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
diff --git a/src/3rdparty/chromium/base/third_party/libevent/event-config.h b/src/3rdparty/chromium/base/third_party/libevent/event-config.h
index bbd23f1d8..f01bea268 100644
--- a/src/3rdparty/chromium/base/third_party/libevent/event-config.h
+++ b/src/3rdparty/chromium/base/third_party/libevent/event-config.h
@@ -19,6 +19,8 @@
#include "base/third_party/libevent/solaris/event-config.h"
#elif defined(_AIX)
#include "base/third_party/libevent/aix/event-config.h"
+#elif defined(__HAIKU__)
+#include "base/third_party/libevent/haiku/event-config.h"
#else
#error generate event-config.h for your platform
#endif
diff --git a/src/3rdparty/chromium/base/third_party/libevent/haiku/config.h b/src/3rdparty/chromium/base/third_party/libevent/haiku/config.h
new file mode 100644
index 000000000..aee0d1c2f
--- /dev/null
+++ b/src/3rdparty/chromium/base/third_party/libevent/haiku/config.h
@@ -0,0 +1,272 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if clock_gettime is available in libc */
+#define DNS_USE_CPU_CLOCK_FOR_ID 1
+
+/* Define is no secure id variant is available */
+/* #undef DNS_USE_GETTIMEOFDAY_FOR_ID */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define if /dev/poll is available */
+/* #undef HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define if your system supports the epoll system calls */
+/* #undef HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef HAVE_EPOLL_CTL */
+
+/* Define if your system supports event ports */
+/* #undef HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+#define HAVE_FCNTL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if the system has the type `fd_mask'. */
+/* #undef HAVE_FD_MASK */
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getegid' function. */
+#define HAVE_GETEGID 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `issetugid' function. */
+/* #undef HAVE_ISSETUGID */
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef HAVE_KQUEUE */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef HAVE_LIBRT */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the `poll' function. */
+#define HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define HAVE_POLL_H 1
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#define HAVE_SETFD 1
+
+/* Define to 1 if you have the `sigaction' function. */
+#define HAVE_SIGACTION 1
+
+/* Define to 1 if you have the `signal' function. */
+#define HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef HAVE_STRSEP */
+
+/* Define to 1 if you have the `strtok_r' function. */
+#define HAVE_STRTOK_R 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define HAVE_STRTOLL 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef HAVE_SYS_EPOLL_H */
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#define HAVE_SYS_QUEUE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+/* #undef HAVE_TAILQFOREACH */
+
+/* Define if timeradd is defined in <sys/time.h> */
+#define HAVE_TIMERADD 1
+
+/* Define if timerclear is defined in <sys/time.h> */
+#define HAVE_TIMERCLEAR 1
+
+/* Define if timercmp is defined in <sys/time.h> */
+#define HAVE_TIMERCMP 1
+
+/* Define if timerisset is defined in <sys/time.h> */
+#define HAVE_TIMERISSET 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define HAVE_VASPRINTF 1
+
+/* Define if kqueue works correctly with pipes */
+/* #undef HAVE_WORKING_KQUEUE */
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Numeric representation of the version */
+#define NUMERIC_VERSION 0x01040e00
+
+/* Name of package */
+#define PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 8
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "1.4.14b-stable"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+/* #undef __func__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to unsigned int if you dont have it */
+/* #undef socklen_t */
diff --git a/src/3rdparty/chromium/base/third_party/libevent/haiku/event-config.h b/src/3rdparty/chromium/base/third_party/libevent/haiku/event-config.h
new file mode 100644
index 000000000..0a77f14a4
--- /dev/null
+++ b/src/3rdparty/chromium/base/third_party/libevent/haiku/event-config.h
@@ -0,0 +1,280 @@
+/* event-config.h
+ * Generated by autoconf; post-processed by libevent.
+ * Do not edit this file.
+ * Do not rely on macros in this file existing in later versions.
+ */
+#ifndef _EVENT_CONFIG_H_
+#define _EVENT_CONFIG_H_
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if clock_gettime is available in libc */
+#define _EVENT_DNS_USE_CPU_CLOCK_FOR_ID 1
+
+/* Define is no secure id variant is available */
+/* #undef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define _EVENT_HAVE_CLOCK_GETTIME 1
+
+/* Define if /dev/poll is available */
+/* #undef _EVENT_HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define _EVENT_HAVE_DLFCN_H 1
+
+/* Define if your system supports the epoll system calls */
+/* #undef _EVENT_HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef _EVENT_HAVE_EPOLL_CTL */
+
+/* Define if your system supports event ports */
+/* #undef _EVENT_HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+#define _EVENT_HAVE_FCNTL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define _EVENT_HAVE_FCNTL_H 1
+
+/* Define to 1 if the system has the type `fd_mask'. */
+#define _EVENT_HAVE_FD_MASK
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define _EVENT_HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getegid' function. */
+#define _EVENT_HAVE_GETEGID 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define _EVENT_HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define _EVENT_HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define _EVENT_HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define _EVENT_HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define _EVENT_HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `issetugid' function. */
+/* #undef _EVENT_HAVE_ISSETUGID */
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef _EVENT_HAVE_KQUEUE */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef _EVENT_HAVE_LIBNSL */
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef _EVENT_HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef _EVENT_HAVE_LIBRT */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define _EVENT_HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef _EVENT_HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the `poll' function. */
+#define _EVENT_HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define _EVENT_HAVE_POLL_H 1
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef _EVENT_HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef _EVENT_HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+#define _EVENT_HAVE_SELECT 1
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#define _EVENT_HAVE_SETFD 1
+
+/* Define to 1 if you have the `sigaction' function. */
+#define _EVENT_HAVE_SIGACTION 1
+
+/* Define to 1 if you have the `signal' function. */
+#define _EVENT_HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define _EVENT_HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define _EVENT_HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define _EVENT_HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _EVENT_HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _EVENT_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _EVENT_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define _EVENT_HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef _EVENT_HAVE_STRSEP */
+
+/* Define to 1 if you have the `strtok_r' function. */
+#define _EVENT_HAVE_STRTOK_R 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define _EVENT_HAVE_STRTOLL 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef _EVENT_HAVE_SYS_EPOLL_H */
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef _EVENT_HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define _EVENT_HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define _EVENT_HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#define _EVENT_HAVE_SYS_QUEUE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define _EVENT_HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define _EVENT_HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _EVENT_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define _EVENT_HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define _EVENT_HAVE_SYS_TYPES_H 1
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+/* #undef _EVENT_HAVE_TAILQFOREACH */
+
+/* Define if timeradd is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERADD 1
+
+/* Define if timerclear is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERCLEAR 1
+
+/* Define if timercmp is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERCMP 1
+
+/* Define if timerisset is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERISSET 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define _EVENT_HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define _EVENT_HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define _EVENT_HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define _EVENT_HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define _EVENT_HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define _EVENT_HAVE_VASPRINTF 1
+
+/* Define if kqueue works correctly with pipes */
+/* #undef _EVENT_HAVE_WORKING_KQUEUE */
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define _EVENT_LT_OBJDIR ".libs/"
+
+/* Numeric representation of the version */
+#define _EVENT_NUMERIC_VERSION 0x01040e00
+
+/* Name of package */
+#define _EVENT_PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _EVENT_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _EVENT_PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define _EVENT_PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define _EVENT_PACKAGE_TARNAME ""
+
+/* Define to the home page for this package. */
+#define _EVENT_PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define _EVENT_PACKAGE_VERSION ""
+
+/* The size of `int', as computed by sizeof. */
+#define _EVENT_SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define _EVENT_SIZEOF_LONG 8
+
+/* The size of `long long', as computed by sizeof. */
+#define _EVENT_SIZEOF_LONG_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define _EVENT_SIZEOF_SHORT 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define _EVENT_STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define _EVENT_TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define _EVENT_VERSION "1.4.14b-stable"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+/* #undef _EVENT___func__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef _EVENT_const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef _EVENT___cplusplus
+/* #undef _EVENT_inline */
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef _EVENT_pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef _EVENT_size_t */
+
+/* Define to unsigned int if you dont have it */
+/* #undef _EVENT_socklen_t */
+#endif
diff --git a/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc b/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
index 46fdb3e21..14661c914 100644
--- a/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
+++ b/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
@@ -130,7 +130,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
allocated_objects_size = main_heap_info.allocated_size;
allocated_objects_count = main_heap_info.block_count;
}
-#elif defined(OS_FUCHSIA)
+#elif defined(OS_FUCHSIA) || defined(OS_HAIKU)
// TODO(fuchsia): Port, see https://crbug.com/706592.
#else
struct mallinfo info = mallinfo();
diff --git a/src/3rdparty/chromium/base/trace_event/process_memory_dump.cc b/src/3rdparty/chromium/base/trace_event/process_memory_dump.cc
index 362641c40..1248c9e06 100644
--- a/src/3rdparty/chromium/base/trace_event/process_memory_dump.cc
+++ b/src/3rdparty/chromium/base/trace_event/process_memory_dump.cc
@@ -115,7 +115,7 @@ size_t ProcessMemoryDump::CountResidentBytes(void* start_address,
for (size_t i = 0; i < page_count; i++)
resident_page_count += vec[i].VirtualAttributes.Valid;
-#elif defined(OS_FUCHSIA)
+#elif defined(OS_FUCHSIA) || defined(OS_HAIKU)
// TODO(fuchsia): Port, see https://crbug.com/706592.
ALLOW_UNUSED_LOCAL(chunk_start);
ALLOW_UNUSED_LOCAL(page_count);
diff --git a/src/3rdparty/chromium/build/build_config.h b/src/3rdparty/chromium/build/build_config.h
index c7b02664c..d1c6409a4 100644
--- a/src/3rdparty/chromium/build/build_config.h
+++ b/src/3rdparty/chromium/build/build_config.h
@@ -65,6 +65,8 @@
#define OS_AIX 1
#elif defined(__asmjs__)
#define OS_ASMJS
+#elif defined(__HAIKU__)
+#define OS_HAIKU 1
#else
#error Please add support for your platform in build/build_config.h
#endif
@@ -82,7 +84,7 @@
#if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_ASMJS) || \
defined(OS_FREEBSD) || defined(OS_LINUX) || defined(OS_MACOSX) || \
defined(OS_NACL) || defined(OS_NETBSD) || defined(OS_OPENBSD) || \
- defined(OS_QNX) || defined(OS_SOLARIS)
+ defined(OS_QNX) || defined(OS_SOLARIS) || defined(OS_HAIKU)
#define OS_POSIX 1
#endif
diff --git a/src/3rdparty/chromium/build/config/BUILDCONFIG.gn b/src/3rdparty/chromium/build/config/BUILDCONFIG.gn
index 88daf9a25..018e292c0 100644
--- a/src/3rdparty/chromium/build/config/BUILDCONFIG.gn
+++ b/src/3rdparty/chromium/build/config/BUILDCONFIG.gn
@@ -134,10 +134,10 @@ declare_args() {
is_desktop_linux = current_os == "linux"
# Set to true when compiling with the Clang compiler.
- is_clang = current_os != "linux" ||
+ is_clang = current_os != "haiku" && (current_os != "linux" ||
(current_cpu != "s390x" && current_cpu != "s390" &&
current_cpu != "ppc64" && current_cpu != "ppc" &&
- current_cpu != "mips" && current_cpu != "mips64")
+ current_cpu != "mips" && current_cpu != "mips64"))
# Allows the path to a custom target toolchain to be injected as a single
# argument, and set as the default toolchain.
@@ -221,6 +221,8 @@ if (host_toolchain == "") {
}
} else if (host_os == "aix") {
host_toolchain = "//build/toolchain/aix:$host_cpu"
+ } else if (host_os == "haiku") {
+ host_toolchain = "//build/toolchain/haiku:$host_cpu"
} else {
assert(false, "Unsupported host_os: $host_os")
}
@@ -239,6 +241,8 @@ if (target_os == "android") {
} else {
_default_toolchain = "//build/toolchain/linux:$target_cpu"
}
+} else if (target_os == "haiku") {
+ _default_toolchain = "//build/toolchain/haiku:$target_cpu"
} else if (target_os == "fuchsia") {
_default_toolchain = "//build/toolchain/fuchsia:$target_cpu"
} else if (target_os == "ios") {
@@ -306,6 +310,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = false
is_win = true
+ is_haiku = false
} else if (current_os == "mac") {
is_aix = false
is_android = false
@@ -317,6 +322,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = true
is_win = false
+ is_haiku = false
} else if (current_os == "android") {
is_aix = false
is_android = true
@@ -328,6 +334,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = true
is_win = false
+ is_haiku = false
} else if (current_os == "chromeos") {
is_aix = false
is_android = false
@@ -339,6 +346,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = true
is_win = false
+ is_haiku = false
} else if (current_os == "nacl") {
# current_os == "nacl" will be passed by the nacl toolchain definition.
# It is not set by default or on the command line. We treat is as a
@@ -353,6 +361,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = true
is_posix = true
is_win = false
+ is_haiku = false
} else if (current_os == "fuchsia") {
is_aix = false
is_android = false
@@ -364,6 +373,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = false
is_win = false
+ is_haiku = false
} else if (current_os == "ios") {
is_aix = false
is_android = false
@@ -375,6 +385,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = true
is_win = false
+ is_haiku = false
} else if (current_os == "linux") {
is_aix = false
is_android = false
@@ -386,6 +397,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = true
is_win = false
+ is_haiku = false
} else if (current_os == "aix") {
is_aix = true
is_android = false
@@ -397,6 +409,19 @@ if (current_os == "win" || current_os == "winuwp") {
is_nacl = false
is_posix = true
is_win = false
+ is_haiku = false
+} else if (current_os == "haiku") {
+ is_aix = false
+ is_android = false
+ is_chromeos = false
+ is_fuchsia = false
+ is_ios = false
+ is_linux = false
+ is_mac = false
+ is_nacl = false
+ is_posix = true
+ is_win = false
+ is_haiku = true
}
# =============================================================================
@@ -486,6 +511,15 @@ if (!is_chromeos) {
"*\bchromeos/*",
]
}
+if (!is_haiku) {
+ sources_assignment_filter += [
+ "*_haiku.h",
+ "*_haiku.cc",
+ "*_haiku_unittest.h",
+ "*_haiku_unittest.cc",
+ "*\bhaiku/*",
+ ]
+}
# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
# below.
diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
index d223a4f6f..d808ca56c 100644
--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
@@ -227,6 +227,8 @@ config("compiler") {
configs += [ "//build/config/fuchsia:compiler" ]
} else if (current_os == "aix") {
configs += [ "//build/config/aix:compiler" ]
+ } else if (is_haiku) {
+ configs += [ "//build/config/haiku:compiler" ]
}
configs += [
@@ -260,7 +262,7 @@ config("compiler") {
# The x86 toolchain currently has problems with stack-protector.
if (is_android && current_cpu == "x86") {
cflags += [ "-fno-stack-protector" ]
- } else if (current_os != "aix") {
+ } else if (current_os != "aix" && current_os != "haiku") {
# Not available on aix.
cflags += [ "-fstack-protector" ]
}
@@ -1192,6 +1194,8 @@ config("runtime_library") {
configs += [ "//build/config/mac:runtime_library" ]
} else if (is_android) {
configs += [ "//build/config/android:runtime_library" ]
+ } else if (is_haiku) {
+ configs += [ "//build/config/haiku:runtime_library" ]
}
if (is_component_build) {
diff --git a/src/3rdparty/chromium/build/config/crypto.gni b/src/3rdparty/chromium/build/config/crypto.gni
index a3d52deaf..2c07d3c13 100644
--- a/src/3rdparty/chromium/build/config/crypto.gni
+++ b/src/3rdparty/chromium/build/config/crypto.gni
@@ -12,4 +12,4 @@
# to set up feature flags.
# True if NSS is used for certificate handling.
-use_nss_certs = is_linux
+use_nss_certs = is_linux || is_haiku
diff --git a/src/3rdparty/chromium/build/config/haiku/BUILD.gn b/src/3rdparty/chromium/build/config/haiku/BUILD.gn
new file mode 100644
index 000000000..6f5e059cb
--- /dev/null
+++ b/src/3rdparty/chromium/build/config/haiku/BUILD.gn
@@ -0,0 +1,19 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/ui.gni")
+
+# This is included by reference in the //build/config/compiler config that
+# is applied to all targets. It is here to separate out the logic that is
+# Linux-only. This is not applied to Android, but is applied to ChromeOS.
+config("compiler") {
+}
+
+# This is included by reference in the //build/config/compiler:runtime_library
+# config that is applied to all targets. It is here to separate out the logic
+# that is Linux-only. Please see that target for advice on what should go in
+# :runtime_library vs. :compiler.
+config("runtime_library") {
+ libs = [ "be" ]
+}
diff --git a/src/3rdparty/chromium/build/config/linux/pkg-config.py b/src/3rdparty/chromium/build/config/linux/pkg-config.py
index 3327152bf..57c4dcf28 100755
--- a/src/3rdparty/chromium/build/config/linux/pkg-config.py
+++ b/src/3rdparty/chromium/build/config/linux/pkg-config.py
@@ -107,7 +107,7 @@ def main():
# If this is run on non-Linux platforms, just return nothing and indicate
# success. This allows us to "kind of emulate" a Linux build from other
# platforms.
- if "linux" not in sys.platform:
+ if "linux" not in sys.platform and "haiku" not in sys.platform:
print "[[],[],[],[],[]]"
return 0
diff --git a/src/3rdparty/chromium/build/secondary/third_party/libjpeg_turbo/BUILD.gn b/src/3rdparty/chromium/build/secondary/third_party/libjpeg_turbo/BUILD.gn
index 265d30b07..cc331cde3 100644
--- a/src/3rdparty/chromium/build/secondary/third_party/libjpeg_turbo/BUILD.gn
+++ b/src/3rdparty/chromium/build/secondary/third_party/libjpeg_turbo/BUILD.gn
@@ -93,7 +93,7 @@ if (current_cpu == "x86" || current_cpu == "x64") {
}
} else if (is_mac || is_ios) {
defines += [ "MACHO" ]
- } else if (is_linux || is_android || is_fuchsia) {
+ } else if (is_linux || is_android || is_fuchsia || is_haiku) {
defines += [ "ELF" ]
}
}
diff --git a/src/3rdparty/chromium/build/secondary/third_party/nss/BUILD.gn b/src/3rdparty/chromium/build/secondary/third_party/nss/BUILD.gn
index 5788f3e5d..3f6c39e2b 100644
--- a/src/3rdparty/chromium/build/secondary/third_party/nss/BUILD.gn
+++ b/src/3rdparty/chromium/build/secondary/third_party/nss/BUILD.gn
@@ -4,7 +4,7 @@
import("//build/config/linux/pkg_config.gni")
-if (is_linux) {
+if (is_linux || is_haiku) {
# This is a dependency on NSS with no libssl. On Linux we use a built-in SSL
# library but the system NSS libraries. Non-Linux platforms using NSS use the
# hermetic one in //third_party/nss.
diff --git a/src/3rdparty/chromium/build/toolchain/haiku/BUILD.gn b/src/3rdparty/chromium/build/toolchain/haiku/BUILD.gn
new file mode 100644
index 000000000..6ab1fb5f4
--- /dev/null
+++ b/src/3rdparty/chromium/build/toolchain/haiku/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/sysroot.gni")
+import("//build/toolchain/gcc_toolchain.gni")
+
+gcc_toolchain("x86") {
+ cc = "gcc"
+ cxx = "g++"
+
+ readelf = "readelf"
+ nm = "nm"
+ ar = "ar"
+ ld = cxx
+
+ # Output linker map files for binary size analysis.
+ #enable_linker_map = true
+
+ toolchain_args = {
+ current_cpu = "x86"
+ current_os = "haiku"
+ is_clang = false
+ }
+}
+
+gcc_toolchain("x64") {
+ cc = "gcc"
+ cxx = "g++"
+
+ readelf = "readelf"
+ nm = "nm"
+ ar = "ar"
+ ld = cxx
+
+ # Output linker map files for binary size analysis.
+ #enable_linker_map = true
+
+ toolchain_args = {
+ current_cpu = "x64"
+ current_os = "haiku"
+ is_clang = false
+ }
+}
diff --git a/src/3rdparty/chromium/chrome/browser/BUILD.gn b/src/3rdparty/chromium/chrome/browser/BUILD.gn
index 788595bc5..07dc2385d 100644
--- a/src/3rdparty/chromium/chrome/browser/BUILD.gn
+++ b/src/3rdparty/chromium/chrome/browser/BUILD.gn
@@ -3300,7 +3300,7 @@ jumbo_split_static_library("browser") {
]
}
- if (is_posix && !is_mac) {
+ if (is_posix && !is_mac && !is_haiku) {
# TODO(crbug.com/753619): Enable crash reporting on Fuchsia.
sources += [
"//chrome/app/chrome_crash_reporter_client.cc",
diff --git a/src/3rdparty/chromium/chrome/test/BUILD.gn b/src/3rdparty/chromium/chrome/test/BUILD.gn
index 487205fa9..8ccfaa65e 100644
--- a/src/3rdparty/chromium/chrome/test/BUILD.gn
+++ b/src/3rdparty/chromium/chrome/test/BUILD.gn
@@ -5225,7 +5225,7 @@ test("chrome_app_unittests") {
"//components/crash/core/common",
"//components/flags_ui:switches",
]
- if (!is_fuchsia) {
+ if (!is_fuchsia && !is_haiku) {
# TODO(crbug.com/753619): Enable crash reporting on Fuchsia.
deps += [ "//third_party/breakpad:client" ]
}
diff --git a/src/3rdparty/chromium/components/BUILD.gn b/src/3rdparty/chromium/components/BUILD.gn
index 01ceb7d1e..07a9be720 100644
--- a/src/3rdparty/chromium/components/BUILD.gn
+++ b/src/3rdparty/chromium/components/BUILD.gn
@@ -329,6 +329,13 @@ test("components_unittests") {
deps += [ "//components/browser_watcher:unit_tests" ]
}
+ if (is_haiku) {
+ deps -= [
+ "//components/crash/content/browser:unit_tests",
+ "//components/data_reduction_proxy/content/browser:unit_tests",
+ ]
+ }
+
if (enable_basic_printing) {
deps += [ "//components/services/pdf_compositor:unit_tests" ]
}
diff --git a/src/3rdparty/chromium/components/crash/content/browser/BUILD.gn b/src/3rdparty/chromium/components/crash/content/browser/BUILD.gn
index 68c98d4cf..00d4d6c49 100644
--- a/src/3rdparty/chromium/components/crash/content/browser/BUILD.gn
+++ b/src/3rdparty/chromium/components/crash/content/browser/BUILD.gn
@@ -7,7 +7,7 @@ if (is_android) {
}
# TODO(crbug.com/753619): Enable crash reporting on Fuchsia.
-assert(!is_fuchsia)
+assert(!is_fuchsia && !is_haiku)
source_set("browser") {
sources = [
diff --git a/src/3rdparty/chromium/components/crash/core/common/BUILD.gn b/src/3rdparty/chromium/components/crash/core/common/BUILD.gn
index c8e02ebf8..bfecb9bf4 100644
--- a/src/3rdparty/chromium/components/crash/core/common/BUILD.gn
+++ b/src/3rdparty/chromium/components/crash/core/common/BUILD.gn
@@ -6,7 +6,7 @@ import("//build/buildflag_header.gni")
declare_args() {
# If set to true, this will stub out and disable the entire crash key system.
- use_crash_key_stubs = is_fuchsia
+ use_crash_key_stubs = is_fuchsia || is_haiku
}
group("common") {
diff --git a/src/3rdparty/chromium/components/data_reduction_proxy/content/browser/BUILD.gn b/src/3rdparty/chromium/components/data_reduction_proxy/content/browser/BUILD.gn
index 997a9fda9..70286b254 100644
--- a/src/3rdparty/chromium/components/data_reduction_proxy/content/browser/BUILD.gn
+++ b/src/3rdparty/chromium/components/data_reduction_proxy/content/browser/BUILD.gn
@@ -16,7 +16,6 @@ static_library("browser") {
deps = [
"//base",
- "//components/crash/content/browser",
"//components/data_reduction_proxy/core/browser",
"//components/data_reduction_proxy/core/common",
"//components/data_use_measurement/core",
@@ -27,6 +26,9 @@ static_library("browser") {
"//net",
"//services/network/public/cpp",
]
+ if (is_android) {
+ deps += [ "//components/crash/content/browser" ]
+ }
}
source_set("unit_tests") {
@@ -41,7 +43,6 @@ source_set("unit_tests") {
deps = [
":browser",
"//base",
- "//components/crash/content/browser",
"//components/data_reduction_proxy/core/browser:test_support",
"//components/data_reduction_proxy/core/common:test_support",
"//content/public/browser",
@@ -53,4 +54,7 @@ source_set("unit_tests") {
"//testing/gmock",
"//testing/gtest",
]
+ if (is_android) {
+ deps += [ "//components/crash/content/browser" ]
+ }
}
diff --git a/src/3rdparty/chromium/content/shell/BUILD.gn b/src/3rdparty/chromium/content/shell/BUILD.gn
index d06b34303..3de9a35e0 100644
--- a/src/3rdparty/chromium/content/shell/BUILD.gn
+++ b/src/3rdparty/chromium/content/shell/BUILD.gn
@@ -322,6 +322,14 @@ static_library("content_shell_lib") {
]
deps += [ "//third_party/fuchsia-sdk:policy" ]
}
+ if (is_haiku) {
+ sources += [ "app/blink_test_platform_support_fuchsia.cc" ]
+ deps -= [
+ "//components/crash/content/app",
+ "//components/crash/content/app:test_support",
+ "//components/crash/content/browser",
+ ]
+ }
# Annoyingly, this target and layouttest_support have circular includes.
allow_circular_includes_from = [ "//content/test:layouttest_support" ]
@@ -925,7 +933,7 @@ group("content_shell_crash_test") {
if (is_win) {
data_deps += [ "//build/win:copy_cdb_to_output" ]
}
- if (is_posix && !is_android) {
+ if (is_posix && !is_android && !is_haiku) {
data_deps += [
"//third_party/breakpad:dump_syms($host_toolchain)",
"//third_party/breakpad:minidump_stackwalk($host_toolchain)",
diff --git a/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h b/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h
index cb6f279ce..49d20756f 100644
--- a/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h
+++ b/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h
@@ -11,7 +11,7 @@
#if (defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_X11) || \
defined(USE_OZONE)) && \
- !defined(OS_NACL)
+ !defined(OS_NACL) && !defined(OS_HAIKU)
#include "ui/gfx/native_widget_types.h"
#define GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW
#endif
@@ -34,7 +34,7 @@ namespace gpu {
using SurfaceHandle = gfx::AcceleratedWidget;
constexpr SurfaceHandle kNullSurfaceHandle = gfx::kNullAcceleratedWidget;
#elif defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_NACL) || \
- defined(OS_FUCHSIA)
+ defined(OS_FUCHSIA) || defined(OS_HAIKU)
using SurfaceHandle = int32_t;
constexpr SurfaceHandle kNullSurfaceHandle = 0;
#else
diff --git a/src/3rdparty/chromium/headless/BUILD.gn b/src/3rdparty/chromium/headless/BUILD.gn
index 2ee5fa9d0..0ed72ba4d 100644
--- a/src/3rdparty/chromium/headless/BUILD.gn
+++ b/src/3rdparty/chromium/headless/BUILD.gn
@@ -592,7 +592,7 @@ test("headless_unittests") {
"//testing/gtest",
]
- if (!is_fuchsia) {
+ if (!is_fuchsia && !is_haiku) {
deps += [ "//components/crash/content/browser" ]
}
@@ -744,7 +744,7 @@ test("headless_browsertests") {
"//testing/gtest",
]
- if (!is_fuchsia) {
+ if (!is_fuchsia && !is_haiku) {
deps += [
"//components/crash/content/app:test_support",
"//components/crash/content/browser",
@@ -885,7 +885,7 @@ static_library("headless_shell_lib") {
"//base",
]
- if (!is_fuchsia) {
+ if (!is_fuchsia && !is_haiku) {
deps += [ "//components/crash/content/browser" ]
}
diff --git a/src/3rdparty/chromium/third_party/libxml/BUILD.gn b/src/3rdparty/chromium/third_party/libxml/BUILD.gn
index 494dec87d..611e6adbc 100644
--- a/src/3rdparty/chromium/third_party/libxml/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/libxml/BUILD.gn
@@ -4,7 +4,7 @@
# Define an "os_include" variable that points at the OS-specific generated
# headers. These were generated by running the configure script offline.
-if (is_linux || is_android || is_nacl || is_fuchsia) {
+if (is_linux || is_android || is_nacl || is_fuchsia || is_haiku) {
os_include = "linux"
} else if (is_mac || is_ios) {
os_include = "mac"
diff --git a/src/core/config/haiku.pri b/src/core/config/haiku.pri
new file mode 100644
index 000000000..35ce06555
--- /dev/null
+++ b/src/core/config/haiku.pri
@@ -0,0 +1,71 @@
+include(common.pri)
+include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+QT_FOR_CONFIG += gui-private webengine-private
+
+gn_args += \
+ use_cups=false \
+ use_gio=false \
+ use_gnome_keyring=false \
+ use_alsa=false \
+ use_pulseaudio=false \
+ use_kerberos=false \
+ use_sysroot=false \
+ enable_session_service=false \
+ toolkit_views=false \
+ linux_use_bundled_binutils=false \
+ enable_pdf=false \
+ enable_basic_printing=false \
+ enable_print_preview=false \
+ enable_extensions=false \
+ enable_webrtc=false \
+ enable_plugins=false \
+ use_system_zlib=true \
+ use_system_minizip=true \
+ use_system_libpng=true \
+ use_system_freetype=true \
+ use_system_harfbuzz=true \
+ use_system_icu=true \
+ use_system_ffmpeg=true \
+ icu_use_data_file=false \
+ use_system_lcms2=true \
+ use_system_libxml=true \
+ use_system_libxslt=true \
+ pdfium_use_system_zlib=true \
+ pdfium_use_system_libpng=true \
+ is_debug=true
+
+# use_ozone=true \
+# ozone_auto_platforms=false \
+# ozone_platform_headless=true \
+# ozone_platform_external=true \
+# ozone_platform=\"qt\"
+
+gcc:!clang: greaterThan(QT_GCC_MAJOR_VERSION, 5): gn_args += no_delete_null_pointer_checks=true
+
+qtConfig(webengine-system-libevent): gn_args += use_system_libevent=true
+qtConfig(webengine-system-libwebp): gn_args += use_system_libwebp=true
+qtConfig(webengine-system-libxml2): gn_args += use_system_libxml=true use_system_libxslt=true
+qtConfig(webengine-system-opus): gn_args += use_system_opus=true
+qtConfig(webengine-system-snappy): gn_args += use_system_snappy=true
+qtConfig(webengine-system-libvpx): gn_args += use_system_libvpx=true
+qtConfig(webengine-system-icu): gn_args += use_system_icu=true icu_use_data_file=false
+qtConfig(webengine-system-ffmpeg): gn_args += use_system_ffmpeg=true
+qtConfig(webengine-system-re2): gn_args += use_system_re2=true
+qtConfig(webengine-system-lcms2): gn_args += use_system_lcms2=true
+qtConfig(webengine-system-png): gn_args += use_system_libpng=true
+qtConfig(webengine-system-jpeg): gn_args += use_system_libjpeg=true
+qtConfig(webengine-system-freetype): gn_args += use_system_freetype=true
+qtConfig(webengine-system-harfbuzz): gn_args += use_system_harfbuzz=true
+!qtConfig(webengine-system-glib): gn_args += use_glib=false
+# FIXME
+#qtConfig(webengine-system-protobuf): gn_args += use_system_protobuf=true
+#qtConfig(webengine-system-jsoncpp): gn_args += use_system_jsoncpp=true
+#qtConfig(webengine-system-libsrtp: gn_args += use_system_libsrtp=true
+qtConfig(webengine-system-zlib) {
+ qtConfig(webengine-system-minizip): gn_args += use_system_zlib=true use_system_minizip=true
+ qtConfig(webengine-printing-and-pdf): gn_args += pdfium_use_system_zlib=true
+}
+qtConfig(webengine-system-png) {
+ gn_args += use_system_libpng=true
+ qtConfig(webengine-printing-and-pdf): gn_args += pdfium_use_system_libpng=true
+}
diff --git a/src/core/configure.json b/src/core/configure.json
index 044d85527..072766176 100644
--- a/src/core/configure.json
+++ b/src/core/configure.json
@@ -604,7 +604,6 @@
},
"webengine-system-gn": {
"label": "Use System Gn",
- "autoDetect": false,
"condition": "tests.webengine-gn",
"output": [ "privateFeature" ]
},
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 3b5d37f29..43db1fba9 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -30,9 +30,11 @@ for(object, NINJA_OBJECTS): RSP_CONTENT += $$object
write_file($$RSP_FILE, RSP_CONTENT)
macos:LIBS_PRIVATE += -Wl,-filelist,$$shell_quote($$RSP_FILE)
linux:LIBS_PRIVATE += @$$RSP_FILE
+haiku:LIBS_PRIVATE += @$$RSP_FILE
# QTBUG-58710 add main rsp file on windows
win32:QMAKE_LFLAGS += @$$RSP_FILE
linux: LIBS_PRIVATE += -Wl,--start-group $$NINJA_ARCHIVES -Wl,--end-group
+haiku: LIBS_PRIVATE += -Wl,--start-group $$NINJA_ARCHIVES -Wl,--end-group
else: LIBS_PRIVATE += $$NINJA_ARCHIVES
LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
# GN's LFLAGS doesn't always work across all the Linux configurations we support.
--
2.21.0
From 234bd6771c6c3b66ca18084aea6b2fb8acb92228 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Sat, 22 Jun 2019 05:04:18 +0200
Subject: [PATCH 2/5] More fixes
---
src/3rdparty/chromium/base/BUILD.gn | 12 ++
.../chromium/base/base_paths_haiku.cc | 21 +++
src/3rdparty/chromium/base/base_paths_haiku.h | 26 +++
.../chromium/base/debug/stack_trace.cc | 2 +-
.../chromium/base/debug/stack_trace_posix.cc | 12 +-
src/3rdparty/chromium/base/export_template.h | 2 +-
src/3rdparty/chromium/base/logging.cc | 2 +-
src/3rdparty/chromium/base/path_service.cc | 14 +-
.../base/process/process_handle_haiku.cc | 22 +++
.../base/process/process_iterator_haiku.cc | 26 +++
.../base/process/process_metrics_haiku.cc | 32 ++++
src/3rdparty/chromium/base/sys_info_haiku.cc | 39 ++++
src/3rdparty/chromium/base/sys_info_posix.cc | 8 +-
.../base/threading/platform_thread_haiku.cc | 55 ++++++
.../base/threading/platform_thread_posix.cc | 4 +-
.../url_formatter/idn_spoof_checker.cc | 2 +-
.../variations/client_filterable_state.cc | 2 +-
.../content/app/content_main_runner_impl.cc | 4 +
src/3rdparty/chromium/content/child/BUILD.gn | 2 +-
.../content/child/blink_platform_impl.h | 2 +-
.../chromium/ipc/ipc_message_utils.cc | 2 +-
src/3rdparty/chromium/ipc/ipc_message_utils.h | 2 +-
.../public/cpp/manifest_parsing_util.cc | 5 +-
.../chromium/services/catalog/store.cc | 2 +
.../chromium/services/catalog/store.h | 1 +
.../chromium/skia/ext/platform_canvas.h | 2 +-
.../blink/renderer/platform/wtf/stack_util.cc | 19 +-
.../blink/renderer/platform/wtf/stack_util.h | 2 +-
.../renderer/platform/wtf/wtf_thread_data.cc | 2 +-
.../renderer/platform/wtf/wtf_thread_data.h | 4 +-
.../third_party/khronos/EGL/eglplatform.h | 7 +
.../skia/include/core/SkPreConfig.h | 3 +-
.../skia/src/gpu/GrAutoLocaleSetter.h | 2 +-
.../chromium/third_party/webrtc/BUILD.gn | 5 +-
.../third_party/webrtc/rtc_base/BUILD.gn | 4 +
.../third_party/webrtc/rtc_base/ipaddress.cc | 15 +-
.../third_party/webrtc/rtc_base/network.cc | 3 +
.../webrtc/rtc_base/physicalsocketserver.cc | 4 +-
.../webrtc/rtc_base/platform_thread_types.cc | 6 +
.../chromium/third_party/yasm/BUILD.gn | 3 +
.../yasm/source/config/haiku/config.h | 173 +++++++++++++++++
.../yasm/source/config/haiku/libyasm-stdint.h | 9 +
.../chromium/tools/grit/grit/node/base.py | 4 +-
.../chromium/ui/gfx/native_widget_types.h | 8 +
src/3rdparty/chromium/ui/gl/BUILD.gn | 2 +-
src/3rdparty/chromium/ui/gl/features.gni | 2 +-
src/3rdparty/chromium/ui/gl/init/BUILD.gn | 9 +
.../chromium/ui/gl/init/gl_factory_haiku.cc | 157 ++++++++++++++++
.../ui/gl/init/gl_initializer_haiku.cc | 174 ++++++++++++++++++
src/3rdparty/chromium/v8/include/v8config.h | 3 +
.../chromium/v8/src/base/export-template.h | 2 +
.../v8/src/base/platform/platform-posix.cc | 9 +-
.../chromium/v8/src/interface-descriptors.h | 12 +-
.../chromium/v8/src/libsampler/sampler.cc | 22 ++-
54 files changed, 913 insertions(+), 55 deletions(-)
create mode 100644 src/3rdparty/chromium/base/base_paths_haiku.cc
create mode 100644 src/3rdparty/chromium/base/base_paths_haiku.h
create mode 100644 src/3rdparty/chromium/base/process/process_handle_haiku.cc
create mode 100644 src/3rdparty/chromium/base/process/process_iterator_haiku.cc
create mode 100644 src/3rdparty/chromium/base/process/process_metrics_haiku.cc
create mode 100644 src/3rdparty/chromium/base/sys_info_haiku.cc
create mode 100644 src/3rdparty/chromium/base/threading/platform_thread_haiku.cc
create mode 100644 src/3rdparty/chromium/third_party/yasm/source/config/haiku/config.h
create mode 100644 src/3rdparty/chromium/third_party/yasm/source/config/haiku/libyasm-stdint.h
create mode 100644 src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc
diff --git a/src/3rdparty/chromium/base/BUILD.gn b/src/3rdparty/chromium/base/BUILD.gn
index 010384706..bbfa23ed7 100644
--- a/src/3rdparty/chromium/base/BUILD.gn
+++ b/src/3rdparty/chromium/base/BUILD.gn
@@ -1456,6 +1456,18 @@ jumbo_component("base") {
}
if (is_haiku) {
+ sources -= [ "process/memory.cc" ]
+ sources += [
+ "base_paths_haiku.cc",
+ "base_paths_haiku.h",
+ "process/memory_stubs.cc",
+ "process/process_handle_haiku.cc",
+ "process/process_iterator_haiku.cc",
+ "process/process_metrics_haiku.cc",
+ "threading/platform_thread_haiku.cc",
+ "sys_info_haiku.cc"
+ ]
+
defines += [ "_BSD_SOURCE", "__USE_XOPEN2K8" ]
}
diff --git a/src/3rdparty/chromium/base/base_paths_haiku.cc b/src/3rdparty/chromium/base/base_paths_haiku.cc
new file mode 100644
index 000000000..ca8aa43bb
--- /dev/null
+++ b/src/3rdparty/chromium/base/base_paths_haiku.cc
@@ -0,0 +1,21 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/base_paths.h"
+
+#include <stdlib.h>
+
+#include "base/base_paths_haiku.h"
+#include "base/command_line.h"
+#include "base/files/file_util.h"
+#include "base/path_service.h"
+#include "base/process/process.h"
+
+namespace base {
+
+bool PathProviderHaiku(int key, FilePath* result) {
+ return false;
+}
+
+} // namespace base
diff --git a/src/3rdparty/chromium/base/base_paths_haiku.h b/src/3rdparty/chromium/base/base_paths_haiku.h
new file mode 100644
index 000000000..d30b52aaf
--- /dev/null
+++ b/src/3rdparty/chromium/base/base_paths_haiku.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_BASE_PATHS_HAIKU_H_
+#define BASE_BASE_PATHS_HAIKU_H_
+
+#include "base/base_export.h"
+#include "base/files/file_path.h"
+
+namespace base {
+
+// These can be used with the PathService to access various special
+// directories and files.
+enum {
+ PATH_HAIKU_START = 1200,
+
+ // Path to the directory which contains application user data.
+ DIR_APP_DATA,
+
+ PATH_HAIKU_END,
+};
+
+} // namespace base
+
+#endif // BASE_BASE_PATHS_HAIKU_H_
diff --git a/src/3rdparty/chromium/base/debug/stack_trace.cc b/src/3rdparty/chromium/base/debug/stack_trace.cc
index 771512176..9bc06037a 100644
--- a/src/3rdparty/chromium/base/debug/stack_trace.cc
+++ b/src/3rdparty/chromium/base/debug/stack_trace.cc
@@ -214,7 +214,7 @@ const void *const *StackTrace::Addresses(size_t* count) const {
std::string StackTrace::ToString() const {
std::stringstream stream;
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU)
OutputToStream(&stream);
#endif
return stream.str();
diff --git a/src/3rdparty/chromium/base/debug/stack_trace_posix.cc b/src/3rdparty/chromium/base/debug/stack_trace_posix.cc
index 54a22c0cc..bc657e98a 100644
--- a/src/3rdparty/chromium/base/debug/stack_trace_posix.cc
+++ b/src/3rdparty/chromium/base/debug/stack_trace_posix.cc
@@ -27,7 +27,7 @@
#if !defined(USE_SYMBOLIZE)
#include <cxxabi.h>
#endif
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU) && !defined(OS_HAIKU)
#include <execinfo.h>
#endif
@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
// Note: code in this function is NOT async-signal safe (std::string uses
// malloc internally).
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU)
std::string::size_type search_from = 0;
while (search_from < text->size()) {
// Look for the start of a mangled symbol, from search_from.
@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
virtual ~BacktraceOutputHandler() = default;
};
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU)
void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
// This should be more than enough to store a 64-bit number in hex:
// 16 hex digits + 1 for null-terminator.
@@ -806,7 +806,7 @@ StackTrace::StackTrace(size_t count) {
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU)
count = std::min(arraysize(trace_), count);
// Though the backtrace API man page does not list any possible negative
@@ -821,13 +821,13 @@ void StackTrace::Print() const {
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU)
PrintBacktraceOutputHandler handler;
ProcessBacktrace(trace_, count_, &handler);
#endif
}
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_HAIKU)
void StackTrace::OutputToStream(std::ostream* os) const {
StreamBacktraceOutputHandler handler(os);
ProcessBacktrace(trace_, count_, &handler);
diff --git a/src/3rdparty/chromium/base/export_template.h b/src/3rdparty/chromium/base/export_template.h
index aac8b7c7f..51807fe16 100644
--- a/src/3rdparty/chromium/base/export_template.h
+++ b/src/3rdparty/chromium/base/export_template.h
@@ -153,7 +153,7 @@
EXPORT_TEMPLATE_TEST(DEFAULT, );
EXPORT_TEMPLATE_TEST(DEFAULT, __attribute__((visibility("default"))));
-EXPORT_TEMPLATE_TEST(MSVC_HACK, __declspec(dllexport));
+//EXPORT_TEMPLATE_TEST(MSVC_HACK, __declspec(dllexport));
EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
#undef EXPORT_TEMPLATE_TEST
diff --git a/src/3rdparty/chromium/base/logging.cc b/src/3rdparty/chromium/base/logging.cc
index 7752cce58..d2234fd99 100644
--- a/src/3rdparty/chromium/base/logging.cc
+++ b/src/3rdparty/chromium/base/logging.cc
@@ -586,7 +586,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
LogMessage::~LogMessage() {
size_t stack_start = stream_.tellp();
#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
- !defined(OS_AIX)
+ !defined(OS_AIX) && !defined(OS_HAIKU)
if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
// Include a stack trace on a fatal, unless a debugger is attached.
base::debug::StackTrace trace;
diff --git a/src/3rdparty/chromium/base/path_service.cc b/src/3rdparty/chromium/base/path_service.cc
index 6ac501eaf..3c3350d3a 100644
--- a/src/3rdparty/chromium/base/path_service.cc
+++ b/src/3rdparty/chromium/base/path_service.cc
@@ -30,6 +30,8 @@ bool PathProviderMac(int key, FilePath* result);
bool PathProviderAndroid(int key, FilePath* result);
#elif defined(OS_FUCHSIA)
bool PathProviderFuchsia(int key, FilePath* result);
+#elif defined(OS_HAIKU)
+bool PathProviderHaiku(int key, FilePath* result);
#elif defined(OS_POSIX)
// PathProviderPosix is the default path provider on POSIX OSes other than
// Mac and Android.
@@ -102,8 +104,16 @@ Provider base_provider_fuchsia = {PathProviderFuchsia, &base_provider,
true};
#endif
+#if defined(OS_HAIKU)
+Provider base_provider_haiku = {PathProviderHaiku, &base_provider,
+#ifndef NDEBUG
+ 0, 0,
+#endif
+ true};
+#endif
+
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && \
- !defined(OS_FUCHSIA)
+ !defined(OS_FUCHSIA) && !defined(OS_HAIKU)
Provider base_provider_posix = {
PathProviderPosix,
&base_provider,
@@ -132,6 +142,8 @@ struct PathData {
providers = &base_provider_android;
#elif defined(OS_FUCHSIA)
providers = &base_provider_fuchsia;
+#elif defined(OS_HAIKU)
+ providers = &base_provider_haiku;
#elif defined(OS_POSIX)
providers = &base_provider_posix;
#endif
diff --git a/src/3rdparty/chromium/base/process/process_handle_haiku.cc b/src/3rdparty/chromium/base/process/process_handle_haiku.cc
new file mode 100644
index 000000000..35241477c
--- /dev/null
+++ b/src/3rdparty/chromium/base/process/process_handle_haiku.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+#include "base/process/process_handle.h"
+
+#include "base/files/file_util.h"
+
+namespace base {
+
+ProcessId GetParentProcessId(ProcessHandle process) {
+ NOTIMPLEMENTED();
+ return -1;
+}
+
+FilePath GetProcessExecutablePath(ProcessHandle process) {
+ NOTIMPLEMENTED();
+ return FilePath();
+}
+
+} // namespace base
diff --git a/src/3rdparty/chromium/base/process/process_iterator_haiku.cc b/src/3rdparty/chromium/base/process/process_iterator_haiku.cc
new file mode 100644
index 000000000..6d411bad7
--- /dev/null
+++ b/src/3rdparty/chromium/base/process/process_iterator_haiku.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/process/process_iterator.h"
+
+namespace base {
+
+ProcessIterator::ProcessIterator(const ProcessFilter* filter) {
+ // TODO(fuchsia): There's no Fuchsia API to iterate processes currently.
+ NOTREACHED();
+}
+
+ProcessIterator::~ProcessIterator() {}
+
+bool ProcessIterator::CheckForNextProcess() {
+ // TODO(fuchsia): There's no Fuchsia API to iterate processes currently.
+ return false;
+}
+
+bool NamedProcessIterator::IncludeEntry() {
+ // TODO(fuchsia): There's no Fuchsia API to iterate processes currently.
+ return false;
+}
+
+} // namespace base
diff --git a/src/3rdparty/chromium/base/process/process_metrics_haiku.cc b/src/3rdparty/chromium/base/process/process_metrics_haiku.cc
new file mode 100644
index 000000000..e2e782969
--- /dev/null
+++ b/src/3rdparty/chromium/base/process/process_metrics_haiku.cc
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/process/process_metrics.h"
+
+namespace base {
+
+size_t GetSystemCommitCharge() {
+ // Not available, doesn't seem likely that it will be (for the whole system).
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+// static
+std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+ ProcessHandle process) {
+ NOTIMPLEMENTED(); // TODO(fuchsia): https://crbug.com/706592.
+ return nullptr;
+}
+
+TimeDelta ProcessMetrics::GetCumulativeCPUUsage() {
+ NOTIMPLEMENTED(); // TODO(fuchsia): https://crbug.com/706592.
+ return TimeDelta();
+}
+
+bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
+ NOTIMPLEMENTED(); // TODO(fuchsia): https://crbug.com/706592.
+ return false;
+}
+
+} // namespace base
diff --git a/src/3rdparty/chromium/base/sys_info_haiku.cc b/src/3rdparty/chromium/base/sys_info_haiku.cc
new file mode 100644
index 000000000..e38fda171
--- /dev/null
+++ b/src/3rdparty/chromium/base/sys_info_haiku.cc
@@ -0,0 +1,39 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/sys_info.h"
+
+#include "base/logging.h"
+
+#include <kernel/OS.h>
+
+namespace base {
+
+// static
+int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
+ system_info systemInfo;
+ get_system_info(&systemInfo);
+ return static_cast<int64_t>(systemInfo.max_pages * (B_PAGE_SIZE / 1048576.0f) + 0.5f);
+}
+
+// static
+int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
+ // TODO(fuchsia): https://crbug.com/706592 This is not exposed.
+ NOTREACHED();
+ return 0;
+}
+
+// static
+int SysInfo::NumberOfProcessors() {
+ system_info systemInfo;
+ get_system_info(&systemInfo);
+ return static_cast<int>(systemInfo.cpu_count);
+}
+
+// static
+int64_t SysInfo::AmountOfVirtualMemory() {
+ return 0;
+}
+
+} // namespace base
diff --git a/src/3rdparty/chromium/base/sys_info_posix.cc b/src/3rdparty/chromium/base/sys_info_posix.cc
index 464c11a5e..7ca4591d0 100644
--- a/src/3rdparty/chromium/base/sys_info_posix.cc
+++ b/src/3rdparty/chromium/base/sys_info_posix.cc
@@ -38,7 +38,7 @@
namespace {
-#if !defined(OS_OPENBSD) && !defined(OS_FUCHSIA)
+#if !defined(OS_OPENBSD) && !defined(OS_FUCHSIA) && !defined(OS_HAIKU)
int NumberOfProcessors() {
// sysconf returns the number of "logical" (not "physical") processors on both
// Mac and Linux. So we get the number of max available "logical" processors.
@@ -67,7 +67,7 @@ base::LazyInstance<
g_lazy_number_of_processors = LAZY_INSTANCE_INITIALIZER;
#endif // !defined(OS_OPENBSD) && !defined(OS_FUCHSIA)
-#if !defined(OS_FUCHSIA)
+#if !defined(OS_FUCHSIA) && !defined(OS_HAIKU)
int64_t AmountOfVirtualMemory() {
struct rlimit limit;
int result = getrlimit(RLIMIT_DATA, &limit);
@@ -133,13 +133,13 @@ bool GetDiskSpaceInfo(const base::FilePath& path,
namespace base {
-#if !defined(OS_OPENBSD) && !defined(OS_FUCHSIA)
+#if !defined(OS_OPENBSD) && !defined(OS_FUCHSIA) && !defined(OS_HAIKU)
int SysInfo::NumberOfProcessors() {
return g_lazy_number_of_processors.Get().value();
}
#endif
-#if !defined(OS_FUCHSIA)
+#if !defined(OS_FUCHSIA) && !defined(OS_HAIKU)
// static
int64_t SysInfo::AmountOfVirtualMemory() {
return g_lazy_virtual_memory.Get().value();
diff --git a/src/3rdparty/chromium/base/threading/platform_thread_haiku.cc b/src/3rdparty/chromium/base/threading/platform_thread_haiku.cc
new file mode 100644
index 000000000..fb4613851
--- /dev/null
+++ b/src/3rdparty/chromium/base/threading/platform_thread_haiku.cc
@@ -0,0 +1,55 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/threading/platform_thread.h"
+
+#include <pthread.h>
+#include <sched.h>
+
+#include "base/threading/platform_thread_internal_posix.h"
+#include "base/threading/thread_id_name_manager.h"
+
+namespace base {
+
+namespace internal {
+
+const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
+ {ThreadPriority::BACKGROUND, 10},
+ {ThreadPriority::NORMAL, 0},
+ {ThreadPriority::DISPLAY, -8},
+ {ThreadPriority::REALTIME_AUDIO, -10},
+};
+
+bool SetCurrentThreadPriorityForPlatform(ThreadPriority priority) {
+ sched_param prio = {0};
+ prio.sched_priority = ThreadPriorityToNiceValue(priority);
+ return pthread_setschedparam(pthread_self(), SCHED_OTHER, &prio) == 0;
+}
+
+bool GetCurrentThreadPriorityForPlatform(ThreadPriority* priority) {
+ sched_param prio = {0};
+ int policy;
+ if (pthread_getschedparam(pthread_self(), &policy, &prio) != 0) {
+ return false;
+ }
+ *priority = NiceValueToThreadPriority(prio.sched_priority);
+ return true;
+}
+
+} // namespace internal
+
+void InitThreading() {}
+
+void TerminateOnThread() {}
+
+size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ return 0;
+}
+
+// static
+void PlatformThread::SetName(const std::string& name) {
+
+}
+
+} // namespace base
diff --git a/src/3rdparty/chromium/base/threading/platform_thread_posix.cc b/src/3rdparty/chromium/base/threading/platform_thread_posix.cc
index 2466b784d..802c40439 100644
--- a/src/3rdparty/chromium/base/threading/platform_thread_posix.cc
+++ b/src/3rdparty/chromium/base/threading/platform_thread_posix.cc
@@ -253,7 +253,7 @@ bool PlatformThread::CanIncreaseCurrentThreadPriority() {
// static
void PlatformThread::SetCurrentThreadPriority(ThreadPriority priority) {
-#if defined(OS_NACL)
+#if defined(OS_NACL) || defined(OS_HAIKU)
NOTIMPLEMENTED();
#else
if (internal::SetCurrentThreadPriorityForPlatform(priority))
@@ -275,7 +275,7 @@ void PlatformThread::SetCurrentThreadPriority(ThreadPriority priority) {
// static
ThreadPriority PlatformThread::GetCurrentThreadPriority() {
-#if defined(OS_NACL)
+#if defined(OS_NACL) || defined(OS_HAIKU)
NOTIMPLEMENTED();
return ThreadPriority::NORMAL;
#else
diff --git a/src/3rdparty/chromium/components/url_formatter/idn_spoof_checker.cc b/src/3rdparty/chromium/components/url_formatter/idn_spoof_checker.cc
index bf6d5c788..09b51cf12 100644
--- a/src/3rdparty/chromium/components/url_formatter/idn_spoof_checker.cc
+++ b/src/3rdparty/chromium/components/url_formatter/idn_spoof_checker.cc
@@ -396,7 +396,7 @@ bool IDNSpoofChecker::SimilarToTopDomains(base::StringPiece16 hostname) {
if ((u04cf_pos = host.indexOf(0x4CF)) != -1) {
icu::UnicodeString host_alt(host);
size_t length = host_alt.length();
- char16_t* buffer = host_alt.getBuffer(-1);
+ char16_t* buffer = reinterpret_cast<char16_t*>(host_alt.getBuffer(-1));
for (char16_t* uc = buffer + u04cf_pos ; uc < buffer + length; ++uc) {
if (*uc == 0x4CF)
*uc = 0x6C; // Lowercase L
diff --git a/src/3rdparty/chromium/components/variations/client_filterable_state.cc b/src/3rdparty/chromium/components/variations/client_filterable_state.cc
index 6fda4f446..6f7826312 100644
--- a/src/3rdparty/chromium/components/variations/client_filterable_state.cc
+++ b/src/3rdparty/chromium/components/variations/client_filterable_state.cc
@@ -22,7 +22,7 @@ Study::Platform ClientFilterableState::GetCurrentPlatform() {
return Study::PLATFORM_ANDROID;
#elif defined(OS_FUCHSIA)
return Study::PLATFORM_FUCHSIA;
-#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HAIKU)
// Default BSD and SOLARIS to Linux to not break those builds, although these
// platforms are not officially supported by Chrome.
return Study::PLATFORM_LINUX;
diff --git a/src/3rdparty/chromium/content/app/content_main_runner_impl.cc b/src/3rdparty/chromium/content/app/content_main_runner_impl.cc
index 090b6bbd1..9d040c85d 100644
--- a/src/3rdparty/chromium/content/app/content_main_runner_impl.cc
+++ b/src/3rdparty/chromium/content/app/content_main_runner_impl.cc
@@ -519,7 +519,9 @@ int RunZygote(ContentMainDelegate* delegate) {
std::vector<std::unique_ptr<service_manager::ZygoteForkDelegate>>
zygote_fork_delegates;
+#if defined(OS_LINUX)
delegate->ZygoteStarting(&zygote_fork_delegates);
+#endif
media::InitializeMediaLibrary();
#if defined(OS_LINUX)
@@ -531,7 +533,9 @@ int RunZygote(ContentMainDelegate* delegate) {
return 1;
}
+#if defined(OS_LINUX)
delegate->ZygoteForked();
+#endif
// Zygote::HandleForkRequest may have reallocated the command
// line so update it here with the new version.
diff --git a/src/3rdparty/chromium/content/child/BUILD.gn b/src/3rdparty/chromium/content/child/BUILD.gn
index 1f8971c0e..40eb1966e 100644
--- a/src/3rdparty/chromium/content/child/BUILD.gn
+++ b/src/3rdparty/chromium/content/child/BUILD.gn
@@ -133,7 +133,7 @@ target(link_target_type, "child") {
"//v8",
]
- if (!use_default_render_theme) {
+ if (!use_default_render_theme && !is_haiku) {
sources -= [
"webthemeengine_impl_default.cc",
"webthemeengine_impl_default.h",
diff --git a/src/3rdparty/chromium/content/child/blink_platform_impl.h b/src/3rdparty/chromium/content/child/blink_platform_impl.h
index 673290032..994df1288 100644
--- a/src/3rdparty/chromium/content/child/blink_platform_impl.h
+++ b/src/3rdparty/chromium/content/child/blink_platform_impl.h
@@ -23,7 +23,7 @@
#include "third_party/blink/public/public_buildflags.h"
#include "ui/base/layout.h"
-#if BUILDFLAG(USE_DEFAULT_RENDER_THEME)
+#if BUILDFLAG(USE_DEFAULT_RENDER_THEME) || defined(OS_HAIKU)
#include "content/child/webthemeengine_impl_default.h"
#elif defined(OS_WIN)
#include "content/child/webthemeengine_impl_win.h"
diff --git a/src/3rdparty/chromium/ipc/ipc_message_utils.cc b/src/3rdparty/chromium/ipc/ipc_message_utils.cc
index 293c941a5..5c8acd1f5 100644
--- a/src/3rdparty/chromium/ipc/ipc_message_utils.cc
+++ b/src/3rdparty/chromium/ipc/ipc_message_utils.cc
@@ -349,7 +349,7 @@ void ParamTraits<unsigned int>::Log(const param_type& p, std::string* l) {
}
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FUCHSIA) || \
- (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ defined(OS_HAIKU) || (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
void ParamTraits<long>::Log(const param_type& p, std::string* l) {
l->append(base::NumberToString(p));
}
diff --git a/src/3rdparty/chromium/ipc/ipc_message_utils.h b/src/3rdparty/chromium/ipc/ipc_message_utils.h
index 00a164a43..4db73d139 100644
--- a/src/3rdparty/chromium/ipc/ipc_message_utils.h
+++ b/src/3rdparty/chromium/ipc/ipc_message_utils.h
@@ -204,7 +204,7 @@ struct ParamTraits<unsigned int> {
// Since we want to support Android 32<>64 bit IPC, as long as we don't have
// these traits for 32 bit ARM then that'll catch any errors.
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FUCHSIA) || \
- (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
+ defined(OS_HAIKU) || (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
template <>
struct ParamTraits<long> {
typedef long param_type;
diff --git a/src/3rdparty/chromium/services/catalog/public/cpp/manifest_parsing_util.cc b/src/3rdparty/chromium/services/catalog/public/cpp/manifest_parsing_util.cc
index 4a19ec6fb..83f72d654 100644
--- a/src/3rdparty/chromium/services/catalog/public/cpp/manifest_parsing_util.cc
+++ b/src/3rdparty/chromium/services/catalog/public/cpp/manifest_parsing_util.cc
@@ -17,7 +17,8 @@ bool IsValidPlatformName(const std::string& name) {
name == Store::kRequiredFilesKey_PlatformValue_Linux ||
name == Store::kRequiredFilesKey_PlatformValue_MacOSX ||
name == Store::kRequiredFilesKey_PlatformValue_Android ||
- name == Store::kRequiredFilesKey_PlatformValue_Fuchsia;
+ name == Store::kRequiredFilesKey_PlatformValue_Fuchsia ||
+ name == Store::kRequiredFilesKey_PlatformValue_Haiku;
}
bool IsCurrentPlatform(const std::string& name) {
@@ -31,6 +32,8 @@ bool IsCurrentPlatform(const std::string& name) {
return name == Store::kRequiredFilesKey_PlatformValue_Android;
#elif defined(OS_FUCHSIA)
return name == Store::kRequiredFilesKey_PlatformValue_Fuchsia;
+#elif defined(OS_HAIKU)
+ return name == Store::kRequiredFilesKey_PlatformValue_Haiku;
#else
#error This architecture is not supported.
#endif
diff --git a/src/3rdparty/chromium/services/catalog/store.cc b/src/3rdparty/chromium/services/catalog/store.cc
index f59e6d8fb..7e8a734c9 100644
--- a/src/3rdparty/chromium/services/catalog/store.cc
+++ b/src/3rdparty/chromium/services/catalog/store.cc
@@ -36,5 +36,7 @@ const char Store::kRequiredFilesKey_PlatformValue_MacOSX[] = "macosx";
const char Store::kRequiredFilesKey_PlatformValue_Android[] = "android";
// static
const char Store::kRequiredFilesKey_PlatformValue_Fuchsia[] = "fuchsia";
+// static
+const char Store::kRequiredFilesKey_PlatformValue_Haiku[] = "haiku";
} // namespace catalog
diff --git a/src/3rdparty/chromium/services/catalog/store.h b/src/3rdparty/chromium/services/catalog/store.h
index 831ee9fb9..d4cc841b9 100644
--- a/src/3rdparty/chromium/services/catalog/store.h
+++ b/src/3rdparty/chromium/services/catalog/store.h
@@ -36,6 +36,7 @@ class Store {
static const char kRequiredFilesKey_PlatformValue_MacOSX[];
static const char kRequiredFilesKey_PlatformValue_Android[];
static const char kRequiredFilesKey_PlatformValue_Fuchsia[];
+ static const char kRequiredFilesKey_PlatformValue_Haiku[];
};
} // namespace catalog
diff --git a/src/3rdparty/chromium/skia/ext/platform_canvas.h b/src/3rdparty/chromium/skia/ext/platform_canvas.h
index c31e7c021..22bb97a03 100644
--- a/src/3rdparty/chromium/skia/ext/platform_canvas.h
+++ b/src/3rdparty/chromium/skia/ext/platform_canvas.h
@@ -58,7 +58,7 @@ SK_API HDC GetNativeDrawingContext(SkCanvas* canvas);
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__sun) || defined(ANDROID) || defined(__APPLE__) || \
- defined(__Fuchsia__)
+ defined(__Fuchsia__) || defined(__HAIKU__)
// Construct a canvas from the given memory region. The memory is not cleared
// first. @data must be, at least, @height * StrideForWidth(@width) bytes.
SK_API std::unique_ptr<SkCanvas> CreatePlatformCanvasWithPixels(
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
index 10f1c0df1..6f7451449 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
@@ -12,6 +12,8 @@
#include <stddef.h>
#include <windows.h>
#include <winnt.h>
+#elif defined(OS_HAIKU)
+#include <OS.h>
#elif defined(__GLIBC__)
extern "C" void* __libc_stack_end; // NOLINT
#endif
@@ -87,7 +89,7 @@ size_t GetUnderestimatedStackSize() {
#endif
}
return pthread_get_stacksize_np(pthread_self());
-#elif defined(OS_WIN) && defined(COMPILER_MSVC)
+#elif defined(OS_HAIKU) || (defined(OS_WIN) && defined(COMPILER_MSVC))
return WTFThreadData::ThreadStackSize();
#else
#error "Stack frame size estimation not supported on this platform."
@@ -138,6 +140,10 @@ void* GetStackStart() {
#else
return reinterpret_cast<void*>(__readfsdword(offsetof(NT_TIB, StackBase)));
#endif
+#elif defined(OS_HAIKU)
+ thread_info threadInfo;
+ get_thread_info(find_thread(NULL), &threadInfo);
+ return threadInfo.stack_base;
#else
#error Unsupported getStackStart on this platform.
#endif
@@ -193,6 +199,17 @@ size_t ThreadStackSize() {
thread_stack_size -= 4 * 0x1000;
return thread_stack_size;
}
+#elif defined(OS_HAIKU)
+size_t ThreadStackSize() {
+ thread_info threadInfo;
+ get_thread_info(find_thread(NULL), &threadInfo);
+ uint8_t* stack_end = reinterpret_cast<uint8_t*>(threadInfo.stack_end);
+ uint8_t* stack_start = reinterpret_cast<uint8_t*>(threadInfo.stack_base);
+ CHECK(stack_start);
+ CHECK_GT(stack_start, stack_end);
+ size_t thread_stack_size = static_cast<size_t>(stack_start - stack_end);
+ return thread_stack_size;
+}
#endif
} // namespace internal
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.h b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.h
index b94f759bc..6908df7b2 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.h
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.h
@@ -22,7 +22,7 @@ WTF_EXPORT extern uintptr_t g_main_thread_underestimated_stack_size;
WTF_EXPORT void InitializeMainThreadStackEstimate();
-#if defined(OS_WIN) && defined(COMPILER_MSVC)
+#if defined(OS_HAIKU) || (defined(OS_WIN) && defined(COMPILER_MSVC))
size_t ThreadStackSize();
#endif
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.cc
index 1bd1b1032..a41edbdf7 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.cc
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.cc
@@ -49,7 +49,7 @@ void WTFThreadData::Initialize() {
WtfThreadData();
}
-#if defined(OS_WIN) && defined(COMPILER_MSVC)
+#if defined(OS_HAIKU) || (defined(OS_WIN) && defined(COMPILER_MSVC))
size_t WTFThreadData::ThreadStackSize() {
// Needed to bootstrap WTFThreadData on Windows, because this value is needed
// before the main thread data is fully initialized.
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.h b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.h
index 84707d248..c6988be9e 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.h
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/wtf_thread_data.h
@@ -62,7 +62,7 @@ class WTF_EXPORT WTFThreadData {
// Must be called on the main thread before any callers to wtfThreadData().
static void Initialize();
-#if defined(OS_WIN) && defined(COMPILER_MSVC)
+#if defined(OS_HAIKU) || (defined(OS_WIN) && defined(COMPILER_MSVC))
static size_t ThreadStackSize();
#endif
@@ -73,7 +73,7 @@ class WTF_EXPORT WTFThreadData {
ThreadIdentifier thread_id_;
-#if defined(OS_WIN) && defined(COMPILER_MSVC)
+#if defined(OS_HAIKU) || (defined(OS_WIN) && defined(COMPILER_MSVC))
size_t thread_stack_size_ = 0u;
#endif
diff --git a/src/3rdparty/chromium/third_party/khronos/EGL/eglplatform.h b/src/3rdparty/chromium/third_party/khronos/EGL/eglplatform.h
index cf2ce0c4c..3a3fe3bc3 100644
--- a/src/3rdparty/chromium/third_party/khronos/EGL/eglplatform.h
+++ b/src/3rdparty/chromium/third_party/khronos/EGL/eglplatform.h
@@ -99,6 +99,13 @@ typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativeWindowType;
typedef intptr_t EGLNativePixmapType;
+#elif defined(__HAIKU__)
+
+#include <kernel/image.h>
+typedef void *EGLNativeDisplayType;
+typedef uintptr_t EGLNativePixmapType;
+typedef uintptr_t EGLNativeWindowType;
+
#elif defined(__unix__)
/* X11 (tentative) */
diff --git a/src/3rdparty/chromium/third_party/skia/include/core/SkPreConfig.h b/src/3rdparty/chromium/third_party/skia/include/core/SkPreConfig.h
index 11d541d87..5c0d60b37 100644
--- a/src/3rdparty/chromium/third_party/skia/include/core/SkPreConfig.h
+++ b/src/3rdparty/chromium/third_party/skia/include/core/SkPreConfig.h
@@ -31,7 +31,8 @@
#elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || \
defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__) || \
defined(__DragonFly__) || defined(__Fuchsia__) || \
- defined(__GLIBC__) || defined(__GNU__) || defined(__unix__)
+ defined(__GLIBC__) || defined(__GNU__) || defined(__unix__) || \
+ defined(__HAIKU__)
#define SK_BUILD_FOR_UNIX
#elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#define SK_BUILD_FOR_IOS
diff --git a/src/3rdparty/chromium/third_party/skia/src/gpu/GrAutoLocaleSetter.h b/src/3rdparty/chromium/third_party/skia/src/gpu/GrAutoLocaleSetter.h
index f6a10e5b7..1afb8b22e 100644
--- a/src/3rdparty/chromium/third_party/skia/src/gpu/GrAutoLocaleSetter.h
+++ b/src/3rdparty/chromium/third_party/skia/src/gpu/GrAutoLocaleSetter.h
@@ -27,7 +27,7 @@
#define HAVE_XLOCALE 0
#endif
-#if defined(SK_BUILD_FOR_ANDROID) || defined(__UCLIBC__) || defined(_NEWLIB_VERSION)
+#if defined(SK_BUILD_FOR_ANDROID) || defined(__UCLIBC__) || defined(_NEWLIB_VERSION) || defined(__HAIKU__)
#define HAVE_LOCALE_T 0
#else
#define HAVE_LOCALE_T 1
diff --git a/src/3rdparty/chromium/third_party/webrtc/BUILD.gn b/src/3rdparty/chromium/third_party/webrtc/BUILD.gn
index 4420843c6..d99d15ce2 100644
--- a/src/3rdparty/chromium/third_party/webrtc/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/webrtc/BUILD.gn
@@ -120,7 +120,7 @@ config("common_inherited_config") {
".",
]
}
- if (is_posix || is_fuchsia) {
+ if (is_posix || is_fuchsia || is_haiku) {
defines += [ "WEBRTC_POSIX" ]
}
if (is_ios) {
@@ -138,6 +138,9 @@ config("common_inherited_config") {
if (is_fuchsia) {
defines += [ "WEBRTC_FUCHSIA" ]
}
+ if (is_haiku) {
+ defines += [ "WEBRTC_HAIKU", "_BSD_SOURCE" ]
+ }
if (is_win) {
defines += [ "WEBRTC_WIN" ]
}
diff --git a/src/3rdparty/chromium/third_party/webrtc/rtc_base/BUILD.gn b/src/3rdparty/chromium/third_party/webrtc/rtc_base/BUILD.gn
index 982d5c4be..52607d158 100644
--- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/BUILD.gn
@@ -962,6 +962,10 @@ rtc_static_library("rtc_base_generic") {
]
}
+ if (is_haiku) {
+ defines += [ "_BSD_SOURCE" ]
+ }
+
if (is_nacl) {
deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
defines += [ "timezone=_timezone" ]
diff --git a/src/3rdparty/chromium/third_party/webrtc/rtc_base/ipaddress.cc b/src/3rdparty/chromium/third_party/webrtc/rtc_base/ipaddress.cc
index c52c9a4ad..07ffd8872 100644
--- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/ipaddress.cc
+++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/ipaddress.cc
@@ -10,6 +10,9 @@
#if defined(WEBRTC_POSIX)
#include <netinet/in.h>
+#if defined(WEBRTC_HAIKU)
+#include <netinet6/in6.h>
+#endif
#include <sys/socket.h>
#include <sys/types.h>
#ifdef OPENBSD
@@ -40,12 +43,12 @@ namespace rtc {
// Prefixes used for categorizing IPv6 addresses.
static const in6_addr kV4MappedPrefix = {
- {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0}}};
-static const in6_addr k6To4Prefix = {{{0x20, 0x02, 0}}};
-static const in6_addr kTeredoPrefix = {{{0x20, 0x01, 0x00, 0x00}}};
-static const in6_addr kV4CompatibilityPrefix = {{{0}}};
-static const in6_addr k6BonePrefix = {{{0x3f, 0xfe, 0}}};
-static const in6_addr kPrivateNetworkPrefix = {{{0xFD}}};
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0}};
+static const in6_addr k6To4Prefix = {{0x20, 0x02, 0}};
+static const in6_addr kTeredoPrefix = {{0x20, 0x01, 0x00, 0x00}};
+static const in6_addr kV4CompatibilityPrefix = {{0}};
+static const in6_addr k6BonePrefix = {{0x3f, 0xfe, 0}};
+static const in6_addr kPrivateNetworkPrefix = {{0xFD}};
static bool IPIsHelper(const IPAddress& ip,
const in6_addr& tomatch,
diff --git a/src/3rdparty/chromium/third_party/webrtc/rtc_base/network.cc b/src/3rdparty/chromium/third_party/webrtc/rtc_base/network.cc
index 0f42d6fe3..d15ff675c 100644
--- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/network.cc
+++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/network.cc
@@ -17,6 +17,9 @@
#if defined(WEBRTC_LINUX)
#include <linux/if.h>
#include <linux/route.h>
+#elif defined(WEBRTC_HAIKU)
+#include <ifaddrs.h>
+#define IFF_RUNNING IFF_LINK
#elif !defined(__native_client__)
#include <net/if.h>
#endif
diff --git a/src/3rdparty/chromium/third_party/webrtc/rtc_base/physicalsocketserver.cc b/src/3rdparty/chromium/third_party/webrtc/rtc_base/physicalsocketserver.cc
index ca7849917..aea772710 100644
--- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/physicalsocketserver.cc
+++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/physicalsocketserver.cc
@@ -67,7 +67,7 @@ typedef void* SockOptArg;
#endif // WEBRTC_POSIX
-#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
+#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__) && !defined(OS_HAIKU)
int64_t GetSocketRecvTimestamp(int socket) {
struct timeval tv_ioctl;
@@ -538,7 +538,7 @@ int PhysicalSocket::TranslateOption(Option opt, int* slevel, int* sopt) {
*slevel = IPPROTO_IP;
*sopt = IP_DONTFRAGMENT;
break;
-#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
+#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__) || defined(WEBRTC_HAIKU)
RTC_LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
return -1;
#elif defined(WEBRTC_POSIX)
diff --git a/src/3rdparty/chromium/third_party/webrtc/rtc_base/platform_thread_types.cc b/src/3rdparty/chromium/third_party/webrtc/rtc_base/platform_thread_types.cc
index 15d48618b..ac4a04d77 100644
--- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/platform_thread_types.cc
+++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/platform_thread_types.cc
@@ -13,6 +13,8 @@
#if defined(WEBRTC_LINUX)
#include <sys/prctl.h>
#include <sys/syscall.h>
+#elif defined(WEBRTC_HAIKU)
+#include <OS.h>
#endif
namespace rtc {
@@ -27,6 +29,8 @@ PlatformThreadId CurrentThreadId() {
return gettid();
#elif defined(WEBRTC_FUCHSIA)
return zx_thread_self();
+#elif defined(WEBRTC_HAIKU)
+ return find_thread(NULL);
#elif defined(WEBRTC_LINUX)
return syscall(__NR_gettid);
#else
@@ -72,6 +76,8 @@ void SetCurrentThreadName(const char* name) {
prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); // NOLINT
#elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
pthread_setname_np(name);
+#elif defined(WEBRTC_HAIKU)
+ rename_thread(find_thread(NULL), name);
#endif
}
diff --git a/src/3rdparty/chromium/third_party/yasm/BUILD.gn b/src/3rdparty/chromium/third_party/yasm/BUILD.gn
index b261e4d88..858d52d31 100644
--- a/src/3rdparty/chromium/third_party/yasm/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/yasm/BUILD.gn
@@ -75,6 +75,9 @@ if (current_toolchain == host_toolchain) {
if (is_posix || is_fuchsia) {
cflags = [ "-std=gnu99" ]
}
+ if (is_haiku) {
+ libs = [ "intl" ]
+ }
}
executable("genmacro") {
diff --git a/src/3rdparty/chromium/third_party/yasm/source/config/haiku/config.h b/src/3rdparty/chromium/third_party/yasm/source/config/haiku/config.h
new file mode 100644
index 000000000..21eb088fe
--- /dev/null
+++ b/src/3rdparty/chromium/third_party/yasm/source/config/haiku/config.h
@@ -0,0 +1,173 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Command name to run C preprocessor */
+#define CPP_PROG "cc -E"
+
+/* */
+#define ENABLE_NLS 1
+
+/* Define to 1 if you have the `abort' function. */
+#define HAVE_ABORT 1
+
+/* */
+/* #undef HAVE_CATGETS */
+
+/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#define HAVE_DCGETTEXT 1
+
+/* Define to 1 if you have the <direct.h> header file. */
+/* #undef HAVE_DIRECT_H */
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* */
+#define HAVE_GETTEXT 1
+
+/* Define to 1 if you have the GNU C Library */
+/* #undef HAVE_GNU_C_LIBRARY */
+
+/* Define if you have the iconv() function and it works. */
+#define HAVE_ICONV 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mergesort' function. */
+#define HAVE_MERGESORT 1
+
+/* Define to 1 if you have the `popen' function. */
+#define HAVE_POPEN 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* */
+/* #undef HAVE_STPCPY */
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strcmpi' function. */
+/* #undef HAVE_STRCMPI */
+
+/* Define to 1 if you have the `stricmp' function. */
+/* #undef HAVE_STRICMP */
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef HAVE_STRSEP */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `toascii' function. */
+#define HAVE_TOASCII 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `_stricmp' function. */
+/* #undef HAVE__STRICMP */
+
+/* Name of package */
+#define PACKAGE "yasm"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-yasm@tortall.net"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "yasm"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "yasm 1.3.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "yasm"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.3.0"
+
+/* Define to 1 if the C compiler supports function prototypes. */
+#define PROTOTYPES 1
+
+/* The size of `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of `void*', as computed by sizeof. */
+/* #undef SIZEOF_VOIDP */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.3.0"
+
+/* Define if using the dmalloc debugging malloc package */
+/* #undef WITH_DMALLOC */
+
+/* Define like PROTOTYPES; this can be used by system headers. */
+#define __PROTOTYPES 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
diff --git a/src/3rdparty/chromium/third_party/yasm/source/config/haiku/libyasm-stdint.h b/src/3rdparty/chromium/third_party/yasm/source/config/haiku/libyasm-stdint.h
new file mode 100644
index 000000000..5780da8b6
--- /dev/null
+++ b/src/3rdparty/chromium/third_party/yasm/source/config/haiku/libyasm-stdint.h
@@ -0,0 +1,9 @@
+#ifndef _YASM_LIBYASM_STDINT_H
+#define _YASM_LIBYASM_STDINT_H 1
+#ifndef _GENERATED_STDINT_H
+#define _GENERATED_STDINT_H "yasm 1.3.0"
+/* generated using gcc */
+#define _STDINT_HAVE_STDINT_H 1
+#include <stdint.h>
+#endif
+#endif
diff --git a/src/3rdparty/chromium/tools/grit/grit/node/base.py b/src/3rdparty/chromium/tools/grit/grit/node/base.py
index e40bad88f..3093334d6 100755
--- a/src/3rdparty/chromium/tools/grit/grit/node/base.py
+++ b/src/3rdparty/chromium/tools/grit/grit/node/base.py
@@ -477,9 +477,11 @@ class Node(object):
value = target_platform == 'ios'
elif name == 'is_bsd':
value = 'bsd' in target_platform
+ elif name == 'is_haiku':
+ value = target_platform.startswith('haiku')
elif name == 'is_posix':
value = (target_platform in ('darwin', 'linux2', 'linux3', 'sunos5',
- 'android', 'ios')
+ 'android', 'ios', 'haiku1')
or 'bsd' in target_platform)
elif name == 'pp_ifdef':
diff --git a/src/3rdparty/chromium/ui/gfx/native_widget_types.h b/src/3rdparty/chromium/ui/gfx/native_widget_types.h
index 7ceeee14e..b299de8b6 100644
--- a/src/3rdparty/chromium/ui/gfx/native_widget_types.h
+++ b/src/3rdparty/chromium/ui/gfx/native_widget_types.h
@@ -132,6 +132,11 @@ typedef void* NativeCursor;
typedef ui::ViewAndroid* NativeView;
typedef ui::WindowAndroid* NativeWindow;
typedef base::android::ScopedJavaGlobalRef<jobject> NativeEvent;
+#elif defined(OS_HAIKU) // FIXME
+typedef void* NativeCursor;
+typedef void* NativeView;
+typedef void* NativeWindow;
+typedef void* NativeEvent;
#else
#error Unknown build environment.
#endif
@@ -193,6 +198,9 @@ constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(OS_ANDROID)
typedef ANativeWindow* AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
+#elif defined(OS_HAIKU)
+typedef int32_t AcceleratedWidget;
+constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(USE_OZONE)
typedef int32_t AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
diff --git a/src/3rdparty/chromium/ui/gl/BUILD.gn b/src/3rdparty/chromium/ui/gl/BUILD.gn
index d8f31ca14..6e63f1adb 100644
--- a/src/3rdparty/chromium/ui/gl/BUILD.gn
+++ b/src/3rdparty/chromium/ui/gl/BUILD.gn
@@ -200,7 +200,7 @@ component("gl") {
}
}
- if (is_posix && !is_fuchsia && !is_mac) {
+ if (is_posix && !is_fuchsia && !is_mac && !is_haiku) {
# Windows has USE_EGL but doesn't support base::FileDescriptor.
# libsync isn't supported or needed on MacOSX.
# Fuchsia is excluded due to a libsync dependency and because it's
diff --git a/src/3rdparty/chromium/ui/gl/features.gni b/src/3rdparty/chromium/ui/gl/features.gni
index a1860902b..cae1c4319 100644
--- a/src/3rdparty/chromium/ui/gl/features.gni
+++ b/src/3rdparty/chromium/ui/gl/features.gni
@@ -13,7 +13,7 @@ declare_args() {
# Should EGL support be compiled. Can be overriden to test during bring up
# of EGL support on other platforms
- use_egl = is_win || is_android || is_linux || is_fuchsia || is_mac
+ use_egl = is_win || is_android || is_linux || is_fuchsia || is_mac || is_haiku
}
declare_args() {
diff --git a/src/3rdparty/chromium/ui/gl/init/BUILD.gn b/src/3rdparty/chromium/ui/gl/init/BUILD.gn
index d708e6c46..0a67e6e0f 100644
--- a/src/3rdparty/chromium/ui/gl/init/BUILD.gn
+++ b/src/3rdparty/chromium/ui/gl/init/BUILD.gn
@@ -68,5 +68,14 @@ jumbo_component("init") {
]
deps += [ "//ui/ozone" ]
+ } else if (is_haiku) {
+ sources += [
+ "gl_factory_haiku.cc",
+ "gl_initializer_haiku.cc",
+ ]
+ deps += [
+ "//ui/gl:gl_features",
+ ]
+ libs = [ "GL" ]
}
}
diff --git a/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc b/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc
new file mode 100644
index 000000000..945e25497
--- /dev/null
+++ b/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc
@@ -0,0 +1,157 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/init/gl_factory.h"
+
+#include "base/trace_event/trace_event.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_context_egl.h"
+#include "ui/gl/gl_context_osmesa.h"
+#include "ui/gl/gl_context_stub.h"
+#include "ui/gl/gl_egl_api_implementation.h"
+#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_share_group.h"
+#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/gl_surface_osmesa.h"
+#include "ui/gl/gl_surface_stub.h"
+
+namespace gl {
+namespace init {
+
+std::vector<GLImplementation> GetAllowedGLImplementations() {
+ std::vector<GLImplementation> impls;
+ //impls.push_back(kGLImplementationDesktopGL);
+ impls.push_back(kGLImplementationEGLGLES2);
+ impls.push_back(kGLImplementationOSMesaGL);
+ impls.push_back(kGLImplementationSwiftShaderGL);
+ return impls;
+}
+
+bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) {
+ switch (GetGLImplementation()) {
+ case kGLImplementationDesktopGL:
+ case kGLImplementationEGLGLES2:
+ return GetGLWindowSystemBindingInfoEGL(info);
+ default:
+ return false;
+ }
+}
+
+scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group,
+ GLSurface* compatible_surface,
+ const GLContextAttribs& attribs) {
+ TRACE_EVENT0("gpu", "gl::init::CreateGLContext");
+ switch (GetGLImplementation()) {
+ case kGLImplementationOSMesaGL:
+ return InitializeGLContext(new GLContextOSMesa(share_group),
+ compatible_surface, attribs);
+ case kGLImplementationDesktopGL:
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationEGLGLES2:
+ return InitializeGLContext(new GLContextEGL(share_group),
+ compatible_surface, attribs);
+ case kGLImplementationMockGL:
+ return new GLContextStub(share_group);
+ case kGLImplementationStubGL: {
+ scoped_refptr<GLContextStub> stub_context =
+ new GLContextStub(share_group);
+ stub_context->SetUseStubApi(true);
+ return stub_context;
+ }
+ default:
+ NOTREACHED();
+ return nullptr;
+ }
+}
+
+#ifndef TOOLKIT_QT
+scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) {
+ TRACE_EVENT0("gpu", "gl::init::CreateViewGLSurface");
+ switch (GetGLImplementation()) {
+ case kGLImplementationOSMesaGL:
+ return InitializeGLSurface(new GLSurfaceOSMesaX11(window));
+ case kGLImplementationDesktopGL:
+ return InitializeGLSurface(new GLSurfaceGLXX11(window));
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationEGLGLES2:
+ DCHECK(window != gfx::kNullAcceleratedWidget);
+ return InitializeGLSurface(new NativeViewGLSurfaceEGLX11(window));
+ case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
+ return new GLSurfaceStub;
+ default:
+ NOTREACHED();
+ return nullptr;
+ }
+}
+
+scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
+ const gfx::Size& size, GLSurfaceFormat format) {
+ TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface");
+ switch (GetGLImplementation()) {
+ case kGLImplementationOSMesaGL:
+ format.SetDefaultPixelLayout(GLSurfaceFormat::PIXEL_LAYOUT_RGBA);
+ return InitializeGLSurfaceWithFormat(
+ new GLSurfaceOSMesa(format, size), format);
+ case kGLImplementationDesktopGL:
+ return InitializeGLSurfaceWithFormat(
+ new UnmappedNativeViewGLSurfaceGLX(size), format);
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationEGLGLES2:
+ if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
+ size.width() == 0 && size.height() == 0) {
+ return InitializeGLSurfaceWithFormat(new SurfacelessEGL(size), format);
+ } else {
+ return InitializeGLSurfaceWithFormat(new PbufferGLSurfaceEGL(size),
+ format);
+ }
+ case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
+ return new GLSurfaceStub;
+ default:
+ NOTREACHED();
+ return nullptr;
+ }
+}
+#endif
+
+void SetDisabledExtensionsPlatform(const std::string& disabled_extensions) {
+ GLImplementation implementation = GetGLImplementation();
+ DCHECK_NE(kGLImplementationNone, implementation);
+ switch (implementation) {
+ case kGLImplementationDesktopGL:
+ case kGLImplementationEGLGLES2:
+ SetDisabledExtensionsEGL(disabled_extensions);
+ break;
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationOSMesaGL:
+ case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
+ break;
+ default:
+ NOTREACHED();
+ }
+}
+
+bool InitializeExtensionSettingsOneOffPlatform() {
+ GLImplementation implementation = GetGLImplementation();
+ DCHECK_NE(kGLImplementationNone, implementation);
+ switch (implementation) {
+ case kGLImplementationDesktopGL:
+ case kGLImplementationEGLGLES2:
+ return InitializeExtensionSettingsOneOffEGL();
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationOSMesaGL:
+ case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
+ return true;
+ default:
+ NOTREACHED();
+ return false;
+ }
+}
+
+} // namespace init
+} // namespace gl
diff --git a/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc b/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc
new file mode 100644
index 000000000..e828e5088
--- /dev/null
+++ b/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc
@@ -0,0 +1,174 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/init/gl_initializer.h"
+
+#include "base/command_line.h"
+#include "base/logging.h"
+#include "base/path_service.h"
+#include "base/threading/thread_restrictions.h"
+#include "build/build_config.h"
+#include "ui/gfx/switches.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_egl_api_implementation.h"
+#include "ui/gl/gl_features.h"
+#include "ui/gl/gl_gl_api_implementation.h"
+#include "ui/gl/gl_implementation_osmesa.h"
+#include "ui/gl/gl_osmesa_api_implementation.h"
+#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/gl_switches.h"
+
+namespace gl {
+namespace init {
+
+namespace {
+
+#if defined(OS_OPENBSD) || defined(OS_HAIKU)
+const char kGLLibraryName[] = "libGL.so";
+#else
+const char kGLLibraryName[] = "libGL.so.1";
+#endif
+
+const char kGLESv2LibraryName[] = "libGLESv2.so.2";
+const char kEGLLibraryName[] = "libEGL.so.1";
+
+const char kGLESv2ANGLELibraryName[] = "libGLESv2.so";
+const char kEGLANGLELibraryName[] = "libEGL.so";
+
+#if BUILDFLAG(ENABLE_SWIFTSHADER)
+const char kGLESv2SwiftShaderLibraryName[] = "libGLESv2.so";
+const char kEGLSwiftShaderLibraryName[] = "libEGL.so";
+#endif
+
+bool InitializeStaticEGLInternal(GLImplementation implementation) {
+ base::FilePath glesv2_path(kGLESv2LibraryName);
+ base::FilePath egl_path(kEGLLibraryName);
+
+ const base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
+
+ if (implementation == kGLImplementationSwiftShaderGL) {
+#if BUILDFLAG(ENABLE_SWIFTSHADER)
+ base::FilePath module_path;
+ if (!base::PathService::Get(base::DIR_MODULE, &module_path))
+ return false;
+ module_path = module_path.Append("swiftshader/");
+
+ glesv2_path = module_path.Append(kGLESv2SwiftShaderLibraryName);
+ egl_path = module_path.Append(kEGLSwiftShaderLibraryName);
+#else
+ return false;
+#endif
+ } else if (cmd->GetSwitchValueASCII(switches::kUseGL) ==
+ kGLImplementationANGLEName) {
+ base::FilePath module_path;
+ if (!base::PathService::Get(base::DIR_MODULE, &module_path))
+ return false;
+
+ glesv2_path = module_path.Append(kGLESv2ANGLELibraryName);
+ egl_path = module_path.Append(kEGLANGLELibraryName);
+ }
+
+ base::NativeLibrary gles_library = LoadLibraryAndPrintError(glesv2_path);
+ if (!gles_library)
+ return false;
+ base::NativeLibrary egl_library = LoadLibraryAndPrintError(egl_path);
+ if (!egl_library) {
+ base::UnloadNativeLibrary(gles_library);
+ return false;
+ }
+
+ GLGetProcAddressProc get_proc_address =
+ reinterpret_cast<GLGetProcAddressProc>(
+ base::GetFunctionPointerFromNativeLibrary(egl_library,
+ "eglGetProcAddress"));
+ if (!get_proc_address) {
+ LOG(ERROR) << "eglGetProcAddress not found.";
+ base::UnloadNativeLibrary(egl_library);
+ base::UnloadNativeLibrary(gles_library);
+ return false;
+ }
+
+ SetGLGetProcAddressProc(get_proc_address);
+ AddGLNativeLibrary(egl_library);
+ AddGLNativeLibrary(gles_library);
+ SetGLImplementation(kGLImplementationEGLGLES2);
+
+ InitializeStaticGLBindingsGL();
+ InitializeStaticGLBindingsEGL();
+
+ return true;
+}
+
+} // namespace
+
+#if !defined(TOOLKIT_QT)
+bool InitializeGLOneOffPlatform() {
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kHeadless) &&
+ command_line->GetSwitchValueASCII(switches::kUseGL) ==
+ kGLImplementationOSMesaName)
+ return true;
+
+ switch (GetGLImplementation()) {
+ case kGLImplementationDesktopGL:
+ return true;
+ case kGLImplementationOSMesaGL:
+ return true;
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationEGLGLES2:
+ /*if (!GLSurfaceEGL::InitializeOneOff(gfx::GetXDisplay())) {
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
+ return false;
+ }*/
+ return true;
+ default:
+ return true;
+ }
+}
+
+#endif // !defined(TOOLKIT_QT)
+bool InitializeStaticGLBindings(GLImplementation implementation) {
+ // Prevent reinitialization with a different implementation. Once the gpu
+ // unit tests have initialized with kGLImplementationMock, we don't want to
+ // later switch to another GL implementation.
+ DCHECK_EQ(kGLImplementationNone, GetGLImplementation());
+
+ // Allow the main thread or another to initialize these bindings
+ // after instituting restrictions on I/O. Going forward they will
+ // likely be used in the browser process on most platforms. The
+ // one-time initialization cost is small, between 2 and 5 ms.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
+ switch (implementation) {
+ case kGLImplementationOSMesaGL:
+ case kGLImplementationDesktopGL:
+ case kGLImplementationSwiftShaderGL:
+ case kGLImplementationEGLGLES2:
+ return InitializeStaticEGLInternal(implementation);
+ case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
+ SetGLImplementation(implementation);
+ InitializeStaticGLBindingsGL();
+ return true;
+ default:
+ NOTREACHED();
+ }
+
+ return false;
+}