Skip to content

Instantly share code, notes, and snippets.

@KapiX
Last active September 28, 2022 09:24
Show Gist options
  • Save KapiX/8502596ef66813195cf8d2bec7393cd7 to your computer and use it in GitHub Desktop.
Save KapiX/8502596ef66813195cf8d2bec7393cd7 to your computer and use it in GitHub Desktop.
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 <[email protected]>
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 <[email protected]>
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 "[email protected]"
+
+/* 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;
+}
+
+void InitializeDebugGLBindings() {
+ InitializeDebugGLBindingsEGL();
+ InitializeDebugGLBindingsGL();
+}
+
+void ShutdownGLPlatform() {
+ GLSurfaceEGL::ShutdownOneOff();
+ ClearBindingsEGL();
+ ClearBindingsGL();
+}
+
+} // namespace init
+} // namespace gl
diff --git a/src/3rdparty/chromium/v8/include/v8config.h b/src/3rdparty/chromium/v8/include/v8config.h
index d8e1f36c1..2d91d8d29 100644
--- a/src/3rdparty/chromium/v8/include/v8config.h
+++ b/src/3rdparty/chromium/v8/include/v8config.h
@@ -116,6 +116,9 @@
# define V8_OS_QNX 1
#elif defined(_WIN32)
# define V8_OS_WIN 1
+#elif defined(__HAIKU__)
+# define V8_OS_HAIKU 1
+# define V8_OS_POSIX 1
#endif
diff --git a/src/3rdparty/chromium/v8/src/base/export-template.h b/src/3rdparty/chromium/v8/src/base/export-template.h
index 861cfe402..4bf428167 100644
--- a/src/3rdparty/chromium/v8/src/base/export-template.h
+++ b/src/3rdparty/chromium/v8/src/base/export-template.h
@@ -150,6 +150,7 @@
#export)
#define EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT(...) true
#define EXPORT_TEMPLATE_TEST_MSVC_HACK_MSVC_HACK(...) true
+#define EXPORT_TEMPLATE_TEST_MSVC_HACK_DEFAULT(...) true
EXPORT_TEMPLATE_TEST(DEFAULT, );
EXPORT_TEMPLATE_TEST(DEFAULT, __attribute__((visibility("default"))));
@@ -159,5 +160,6 @@ EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
#undef EXPORT_TEMPLATE_TEST
#undef EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT
#undef EXPORT_TEMPLATE_TEST_MSVC_HACK_MSVC_HACK
+#undef EXPORT_TEMPLATE_TEST_MSVC_HACK_DEFAULT
#endif // V8_BASE_EXPORT_TEMPLATE_H_
diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
index cf7f3ec9b..5efacbe81 100644
--- a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+++ b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
@@ -60,7 +60,7 @@
#include <sys/resource.h>
#endif
-#if !defined(_AIX) && !defined(V8_OS_FUCHSIA)
+#if !defined(_AIX) && !defined(V8_OS_FUCHSIA) && !defined(V8_OS_HAIKU)
#include <sys/syscall.h>
#endif
@@ -76,6 +76,11 @@ extern int madvise(caddr_t, size_t, int);
#endif
#endif
+#if defined(V8_OS_HAIKU)
+#define madvise posix_madvise
+#define MADV_DONTNEED POSIX_MADV_DONTNEED
+#endif
+
#ifndef MADV_FREE
#define MADV_FREE MADV_DONTNEED
#endif
@@ -127,7 +132,7 @@ int GetProtectionFromMemoryPermission(OS::MemoryPermission access) {
int GetFlagsForMemoryPermission(OS::MemoryPermission access) {
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
if (access == OS::MemoryPermission::kNoAccess) {
-#if !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX
+#if !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX && !V8_OS_HAIKU
flags |= MAP_NORESERVE;
#endif // !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX
#if V8_OS_QNX
diff --git a/src/3rdparty/chromium/v8/src/interface-descriptors.h b/src/3rdparty/chromium/v8/src/interface-descriptors.h
index cf841383b..7b9930d7c 100644
--- a/src/3rdparty/chromium/v8/src/interface-descriptors.h
+++ b/src/3rdparty/chromium/v8/src/interface-descriptors.h
@@ -327,8 +327,8 @@ constexpr int kMaxBuiltinRegisterParams = 5;
CallInterfaceDescriptorData::kNoFlags; \
static constexpr int kReturnCount = return_count; \
enum ParameterIndices { \
- __dummy = -1, /* to be able to pass zero arguments */ \
- ##__VA_ARGS__, \
+ __dummy = -1 __VA_OPT__(,) /* to be able to pass zero arguments */ \
+ __VA_ARGS__, \
\
kParameterCount, \
kContext = kParameterCount /* implicit parameter */ \
@@ -339,8 +339,8 @@ constexpr int kMaxBuiltinRegisterParams = 5;
CallInterfaceDescriptorData::kNoContext; \
static constexpr int kReturnCount = return_count; \
enum ParameterIndices { \
- __dummy = -1, /* to be able to pass zero arguments */ \
- ##__VA_ARGS__, \
+ __dummy = -1 __VA_OPT__(,) /* to be able to pass zero arguments */ \
+ __VA_ARGS__, \
\
kParameterCount \
};
@@ -373,8 +373,8 @@ constexpr int kMaxBuiltinRegisterParams = 5;
enum ParameterIndices { \
kTarget, \
kNewTarget, \
- kActualArgumentsCount, \
- ##__VA_ARGS__, \
+ kActualArgumentsCount __VA_OPT__(,) \
+ __VA_ARGS__, \
\
kParameterCount, \
kContext = kParameterCount /* implicit parameter */ \
diff --git a/src/3rdparty/chromium/v8/src/libsampler/sampler.cc b/src/3rdparty/chromium/v8/src/libsampler/sampler.cc
index 492606475..0364627d4 100644
--- a/src/3rdparty/chromium/v8/src/libsampler/sampler.cc
+++ b/src/3rdparty/chromium/v8/src/libsampler/sampler.cc
@@ -13,7 +13,7 @@
#include <signal.h>
#include <sys/time.h>
-#if !V8_OS_QNX && !V8_OS_AIX
+#if !V8_OS_QNX && !V8_OS_AIX && !V8_OS_HAIKU
#include <sys/syscall.h> // NOLINT
#endif
@@ -21,7 +21,7 @@
#include <mach/mach.h>
// OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h>
// and is a typedef for struct sigcontext. There is no uc_mcontext.
-#elif(!V8_OS_ANDROID || defined(__BIONIC_HAVE_UCONTEXT_T)) && !V8_OS_OPENBSD
+#elif(!V8_OS_ANDROID || defined(__BIONIC_HAVE_UCONTEXT_T)) && !V8_OS_OPENBSD && !V8_OS_HAIKU
#include <ucontext.h>
#endif
@@ -215,7 +215,7 @@ void* ThreadKey(pthread_t thread_id) {
// Returns hash value for hash map.
uint32_t ThreadHash(pthread_t thread_id) {
-#if V8_OS_BSD
+#if V8_OS_BSD || V8_OS_HAIKU
return static_cast<uint32_t>(reinterpret_cast<intptr_t>(thread_id));
#else
return static_cast<uint32_t>(thread_id);
@@ -592,7 +592,21 @@ void SignalHandler::FillRegisterState(void* context, RegisterState* state) {
state->pc = reinterpret_cast<void*>(mcontext.jmp_context.iar);
state->sp = reinterpret_cast<void*>(mcontext.jmp_context.gpr[1]);
state->fp = reinterpret_cast<void*>(mcontext.jmp_context.gpr[31]);
-#endif // V8_OS_AIX
+#elif V8_OS_HAIKU
+#if V8_HOST_ARCH_IA32
+ state->pc = reinterpret_cast<void*>(mcontext.eip);
+ state->sp = reinterpret_cast<void*>(mcontext.esp);
+ state->fp = reinterpret_cast<void*>(mcontext.ebp);
+#elif V8_HOST_ARCH_X64
+ state->pc = reinterpret_cast<void*>(mcontext.rip);
+ state->sp = reinterpret_cast<void*>(mcontext.rsp);
+ state->fp = reinterpret_cast<void*>(mcontext.rbp);
+#elif V8_HOST_ARCH_ARM
+ state->pc = reinterpret_cast<void*>(mcontext.r15);
+ state->sp = reinterpret_cast<void*>(mcontext.r13);
+ state->fp = reinterpret_cast<void*>(mcontext.r11);
+#endif // V8_HOST_ARCH_*
+#endif // V8_OS_HAIKU
}
#endif // USE_SIGNALS
--
2.21.0
From f437c8cb7e05f1a8cb594101ed0a7b811ff46557 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <[email protected]>
Date: Sat, 22 Jun 2019 20:22:12 +0200
Subject: [PATCH 3/5] Linking stage: fails
---
.../chromium/content/renderer/BUILD.gn | 7 +++
.../content/renderer/render_view_haiku.cc | 52 +++++++++++++++++++
.../renderer/renderer_blink_platform_impl.cc | 4 +-
.../renderer_main_platform_delegate_haiku.cc | 25 +++++++++
.../fake_video_capture_device_factory.cc | 2 +-
src/3rdparty/chromium/net/BUILD.gn | 4 ++
.../chromium/net/base/net_errors_posix.cc | 2 +
.../net/base/network_interfaces_getifaddrs.cc | 4 ++
src/3rdparty/chromium/net/dns/BUILD.gn | 4 ++
.../chromium/net/socket/udp_socket_posix.cc | 22 +++++---
.../socket/unix_domain_server_socket_posix.cc | 2 +-
.../socket/unix_domain_server_socket_posix.h | 2 +-
.../embedder/set_process_title.cc | 2 +-
.../renderer/platform/fonts/font_cache.h | 2 +
.../ui/strings/app_locale_settings.grd | 14 ++++-
src/3rdparty/chromium/v8/BUILD.gn | 5 ++
.../v8/src/base/platform/platform-haiku.cc | 49 +++++++++++++++++
src/core/api/qtbug-61521.cpp | 4 ++
18 files changed, 191 insertions(+), 15 deletions(-)
create mode 100644 src/3rdparty/chromium/content/renderer/render_view_haiku.cc
create mode 100644 src/3rdparty/chromium/content/renderer/renderer_main_platform_delegate_haiku.cc
create mode 100644 src/3rdparty/chromium/v8/src/base/platform/platform-haiku.cc
diff --git a/src/3rdparty/chromium/content/renderer/BUILD.gn b/src/3rdparty/chromium/content/renderer/BUILD.gn
index b5c624627..9f8519a45 100644
--- a/src/3rdparty/chromium/content/renderer/BUILD.gn
+++ b/src/3rdparty/chromium/content/renderer/BUILD.gn
@@ -589,6 +589,13 @@ target(link_target_type, "renderer") {
]
}
+ if (is_haiku) {
+ sources += [
+ "render_view_haiku.cc",
+ "renderer_main_platform_delegate_haiku.cc",
+ ]
+ }
+
if (enable_media_remoting) {
deps += [ "//media/remoting" ]
}
diff --git a/src/3rdparty/chromium/content/renderer/render_view_haiku.cc b/src/3rdparty/chromium/content/renderer/render_view_haiku.cc
new file mode 100644
index 000000000..eb11e5390
--- /dev/null
+++ b/src/3rdparty/chromium/content/renderer/render_view_haiku.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 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 "content/renderer/render_view_impl.h"
+
+#include "third_party/blink/public/platform/web_font_render_style.h"
+
+namespace content {
+
+namespace {
+
+SkPaint::Hinting RendererPreferencesToSkiaHinting(
+ const RendererPreferences& prefs) {
+ switch (prefs.hinting) {
+ case gfx::FontRenderParams::HINTING_NONE:
+ return SkPaint::kNo_Hinting;
+ case gfx::FontRenderParams::HINTING_SLIGHT:
+ return SkPaint::kSlight_Hinting;
+ case gfx::FontRenderParams::HINTING_MEDIUM:
+ return SkPaint::kNormal_Hinting;
+ case gfx::FontRenderParams::HINTING_FULL:
+ return SkPaint::kFull_Hinting;
+ default:
+ NOTREACHED();
+ return SkPaint::kNormal_Hinting;
+ }
+}
+
+} // namespace
+
+void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() {
+ const RendererPreferences& prefs = renderer_preferences_;
+ blink::WebFontRenderStyle::SetHinting(
+ RendererPreferencesToSkiaHinting(prefs));
+ blink::WebFontRenderStyle::SetAutoHint(prefs.use_autohinter);
+ blink::WebFontRenderStyle::SetUseBitmaps(prefs.use_bitmaps);
+ SkFontLCDConfig::SetSubpixelOrder(
+ gfx::FontRenderParams::SubpixelRenderingToSkiaLCDOrder(
+ prefs.subpixel_rendering));
+ SkFontLCDConfig::SetSubpixelOrientation(
+ gfx::FontRenderParams::SubpixelRenderingToSkiaLCDOrientation(
+ prefs.subpixel_rendering));
+ blink::WebFontRenderStyle::SetAntiAlias(prefs.should_antialias_text);
+ blink::WebFontRenderStyle::SetSubpixelRendering(
+ prefs.subpixel_rendering !=
+ gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
+ blink::WebFontRenderStyle::SetSubpixelPositioning(
+ prefs.use_subpixel_positioning);
+}
+
+} // namespace content
diff --git a/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc b/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
index b6dbc3579..b5b144124 100644
--- a/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
+++ b/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
@@ -280,7 +280,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
if (g_sandbox_enabled && sandboxEnabled()) {
#if defined(OS_MACOSX)
sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport());
-#else
+#elif defined(OS_LINUX)
sandbox_support_.reset(
new RendererBlinkPlatformImpl::SandboxSupport(font_loader_));
#endif
@@ -589,7 +589,7 @@ bool RendererBlinkPlatformImpl::SandboxSupport::LoadFont(CTFontRef src_font,
return content::LoadFont(src_font, out, font_id);
}
-#elif defined(OS_POSIX) && !defined(OS_ANDROID)
+#elif defined(OS_LINUX)
void RendererBlinkPlatformImpl::SandboxSupport::GetFallbackFontForCharacter(
blink::WebUChar32 character,
diff --git a/src/3rdparty/chromium/content/renderer/renderer_main_platform_delegate_haiku.cc b/src/3rdparty/chromium/content/renderer/renderer_main_platform_delegate_haiku.cc
new file mode 100644
index 000000000..7af621256
--- /dev/null
+++ b/src/3rdparty/chromium/content/renderer/renderer_main_platform_delegate_haiku.cc
@@ -0,0 +1,25 @@
+// 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 "content/renderer/renderer_main_platform_delegate.h"
+
+namespace content {
+
+RendererMainPlatformDelegate::RendererMainPlatformDelegate(
+ const MainFunctionParams& parameters) {}
+
+RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {}
+
+void RendererMainPlatformDelegate::PlatformInitialize() {}
+
+void RendererMainPlatformDelegate::PlatformUninitialize() {}
+
+bool RendererMainPlatformDelegate::EnableSandbox() {
+ // TODO(750938): Report NOTIMPLEMENTED() here until we re-enable sandboxing
+ // of sub-processes.
+ NOTIMPLEMENTED();
+ return true;
+}
+
+} // namespace content
diff --git a/src/3rdparty/chromium/media/capture/video/fake_video_capture_device_factory.cc b/src/3rdparty/chromium/media/capture/video/fake_video_capture_device_factory.cc
index ded86506b..c6ecfecdd 100644
--- a/src/3rdparty/chromium/media/capture/video/fake_video_capture_device_factory.cc
+++ b/src/3rdparty/chromium/media/capture/video/fake_video_capture_device_factory.cc
@@ -208,7 +208,7 @@ void FakeVideoCaptureDeviceFactory::GetDeviceDescriptors(
VideoCaptureApi::WIN_DIRECT_SHOW
#elif defined(OS_ANDROID)
VideoCaptureApi::ANDROID_API2_LEGACY
-#elif defined(OS_FUCHSIA)
+#else
VideoCaptureApi::UNKNOWN
#endif
);
diff --git a/src/3rdparty/chromium/net/BUILD.gn b/src/3rdparty/chromium/net/BUILD.gn
index 7f9901a88..c926bc202 100644
--- a/src/3rdparty/chromium/net/BUILD.gn
+++ b/src/3rdparty/chromium/net/BUILD.gn
@@ -1816,6 +1816,10 @@ component("net") {
"base/network_interfaces_getifaddrs.cc",
"base/network_interfaces_getifaddrs.h",
]
+
+ if (is_haiku) {
+ defines += [ "_BSD_SOURCE" ]
+ }
}
if (!use_nss_certs) {
diff --git a/src/3rdparty/chromium/net/base/net_errors_posix.cc b/src/3rdparty/chromium/net/base/net_errors_posix.cc
index 366c55eba..6a5037724 100644
--- a/src/3rdparty/chromium/net/base/net_errors_posix.cc
+++ b/src/3rdparty/chromium/net/base/net_errors_posix.cc
@@ -106,8 +106,10 @@ Error MapSystemError(logging::SystemErrorCode os_error) {
return ERR_ACCESS_DENIED;
case ETXTBSY: // Text file busy.
return ERR_ACCESS_DENIED;
+#if !defined(OS_HAIKU)
case EUSERS: // Too many users.
return ERR_INSUFFICIENT_RESOURCES;
+#endif
case EMFILE: // Too many open files.
return ERR_INSUFFICIENT_RESOURCES;
#if defined(OS_FUCHSIA)
diff --git a/src/3rdparty/chromium/net/base/network_interfaces_getifaddrs.cc b/src/3rdparty/chromium/net/base/network_interfaces_getifaddrs.cc
index d3b7fb399..62bbe5e28 100644
--- a/src/3rdparty/chromium/net/base/network_interfaces_getifaddrs.cc
+++ b/src/3rdparty/chromium/net/base/network_interfaces_getifaddrs.cc
@@ -30,6 +30,10 @@
#include <sys/ioctl.h>
#endif // !OS_IOS
+#if defined(OS_HAIKU)
+#define IFF_RUNNING IFF_LINK
+#endif
+
namespace net {
namespace internal {
diff --git a/src/3rdparty/chromium/net/dns/BUILD.gn b/src/3rdparty/chromium/net/dns/BUILD.gn
index 45d175574..5d3d40973 100644
--- a/src/3rdparty/chromium/net/dns/BUILD.gn
+++ b/src/3rdparty/chromium/net/dns/BUILD.gn
@@ -71,6 +71,10 @@ source_set("dns") {
"address_sorter_posix.h",
]
}
+
+ if (is_haiku) {
+ defines = [ "_BSD_SOURCE" ]
+ }
}
if (enable_built_in_dns) {
diff --git a/src/3rdparty/chromium/net/socket/udp_socket_posix.cc b/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
index 760538538..79ef73a37 100644
--- a/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
+++ b/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
@@ -56,6 +56,12 @@
#include <pthread.h>
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+#if defined(OS_HAIKU)
+#include <sys/sockio.h>
+#define IPV6_TCLASS 61
+#define IP_DEFAULT_MULTICAST_TTL 1
+#endif
+
namespace net {
namespace {
@@ -68,7 +74,7 @@ const int kActivityMonitorMinimumSamplesForThroughputEstimate = 2;
const base::TimeDelta kActivityMonitorMsThreshold =
base::TimeDelta::FromMilliseconds(100);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_HAIKU)
// When enabling multicast using setsockopt(IP_MULTICAST_IF) MacOS
// requires passing IPv4 address instead of interface index. This function
// resolves IPv4 address by interface index. The |address| is returned in
@@ -97,7 +103,7 @@ int GetIPv4AddressFromIndex(int socket, uint32_t index, uint32_t* address) {
return OK;
}
-#endif // OS_MACOSX
+#endif // OS_MACOSX || OS_HAIKU
#if defined(OS_MACOSX) && !defined(OS_IOS)
@@ -632,13 +638,13 @@ int UDPSocketPosix::SetDoNotFragment() {
}
void UDPSocketPosix::SetMsgConfirm(bool confirm) {
-#if !defined(OS_MACOSX) && !defined(OS_IOS)
+#if !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_HAIKU)
if (confirm) {
sendto_flags_ |= MSG_CONFIRM;
} else {
sendto_flags_ &= ~MSG_CONFIRM;
}
-#endif // !defined(OS_MACOSX) && !defined(OS_IOS)
+#endif // !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_HAIKU)
}
int UDPSocketPosix::AllowAddressReuse() {
@@ -901,17 +907,17 @@ int UDPSocketPosix::SetMulticastOptions() {
if (multicast_interface_ != 0) {
switch (addr_family_) {
case AF_INET: {
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_HAIKU)
ip_mreq mreq = {};
int error = GetIPv4AddressFromIndex(socket_, multicast_interface_,
&mreq.imr_interface.s_addr);
if (error != OK)
return error;
-#else // defined(OS_MACOSX)
+#else // defined(OS_MACOSX) || defined(OS_HAIKU)
ip_mreqn mreq = {};
mreq.imr_ifindex = multicast_interface_;
mreq.imr_address.s_addr = htonl(INADDR_ANY);
-#endif // !defined(OS_MACOSX)
+#endif // !defined(OS_MACOSX) && !defined(OS_HAIKU)
int rv = setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_IF,
reinterpret_cast<const char*>(&mreq), sizeof(mreq));
if (rv)
@@ -975,7 +981,7 @@ int UDPSocketPosix::JoinGroup(const IPAddress& group_address) const {
if (addr_family_ != AF_INET)
return ERR_ADDRESS_INVALID;
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_HAIKU)
ip_mreq mreq = {};
int error = GetIPv4AddressFromIndex(socket_, multicast_interface_,
&mreq.imr_interface.s_addr);
diff --git a/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.cc b/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.cc
index 2bea30eb3..6c2fd9a60 100644
--- a/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.cc
+++ b/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.cc
@@ -47,7 +47,7 @@ UnixDomainServerSocket::~UnixDomainServerSocket() = default;
// static
bool UnixDomainServerSocket::GetPeerCredentials(SocketDescriptor socket,
Credentials* credentials) {
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
struct ucred user_cred;
socklen_t len = sizeof(user_cred);
if (getsockopt(socket, SOL_SOCKET, SO_PEERCRED, &user_cred, &len) < 0)
diff --git a/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.h b/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.h
index e5a81d31a..9e06a44bd 100644
--- a/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.h
+++ b/src/3rdparty/chromium/net/socket/unix_domain_server_socket_posix.h
@@ -29,7 +29,7 @@ class NET_EXPORT UnixDomainServerSocket : public ServerSocket {
public:
// Credentials of a peer process connected to the socket.
struct NET_EXPORT Credentials {
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
// Linux and Fuchsia provide more information about the connected peer
// than Windows/OS X. It's useful for permission-based authorization on
// Android.
diff --git a/src/3rdparty/chromium/services/service_manager/embedder/set_process_title.cc b/src/3rdparty/chromium/services/service_manager/embedder/set_process_title.cc
index 1dc53b847..88375e459 100644
--- a/src/3rdparty/chromium/services/service_manager/embedder/set_process_title.cc
+++ b/src/3rdparty/chromium/services/service_manager/embedder/set_process_title.cc
@@ -34,7 +34,7 @@ namespace service_manager {
// TODO(jrg): Find out if setproctitle or equivalent is available on Android.
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS) && \
- !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA) && !defined(OS_HAIKU)
void SetProcessTitleFromCommandLine(const char** main_argv) {
// Build a single string which consists of all the arguments separated
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
index 810209210..cee7db183 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
@@ -163,6 +163,8 @@ class PLATFORM_EXPORT FontCache {
static void SetDeviceScaleFactor(float device_scale_factor) {
device_scale_factor_ = device_scale_factor;
}
+#else
+ static float DeviceScaleFactor() { return 1.0f; }
#endif
#if !defined(OS_MACOSX)
diff --git a/src/3rdparty/chromium/ui/strings/app_locale_settings.grd b/src/3rdparty/chromium/ui/strings/app_locale_settings.grd
index 3417591ad..105116879 100644
--- a/src/3rdparty/chromium/ui/strings/app_locale_settings.grd
+++ b/src/3rdparty/chromium/ui/strings/app_locale_settings.grd
@@ -135,7 +135,7 @@
the family specified. This should be default for locales
other than Indian locales.
TODO(jungshik): This and IDS_UI_FONT_SIZE_SCALER are only used
- on Windows now and are likely to be so in the future because Mac and
+ on Windows now and are likely to be so in the future because Mac and
Linux fonts do not have the issue Windows fonts for some locales
(Indian) have. In that case, this need to be enclosed
by platform-dependent if-clause. -->
@@ -199,6 +199,18 @@
75%
</message>
</if>
+ <if expr="is_haiku">
+ <!-- The font used in Web UI (e.g. History). Note that these are only
+ backups. We try to use the system font if possible. -->
+ <message name="IDS_WEB_FONT_FAMILY" use_name_for_id="true">
+ 'Noto Sans', sans-serif
+ </message>
+
+ <!-- The relative font size in % used in Web UI (e.g. History). -->
+ <message name="IDS_WEB_FONT_SIZE" use_name_for_id="true">
+ 75%
+ </message>
+ </if>
<!-- For Chrome OS -->
<if expr="chromeos">
<!-- The font name like: 'Font Name, 12px' -->
diff --git a/src/3rdparty/chromium/v8/BUILD.gn b/src/3rdparty/chromium/v8/BUILD.gn
index 41a50be93..3c9b8717a 100644
--- a/src/3rdparty/chromium/v8/BUILD.gn
+++ b/src/3rdparty/chromium/v8/BUILD.gn
@@ -2999,6 +2999,11 @@ v8_component("v8_libbase") {
"src/base/debug/stack_trace_fuchsia.cc",
"src/base/platform/platform-fuchsia.cc",
]
+ } else if (is_haiku) {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
+ "src/base/platform/platform-haiku.cc",
+ ]
} else if (is_mac) {
sources += [
"src/base/debug/stack_trace_posix.cc",
diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-haiku.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-haiku.cc
new file mode 100644
index 000000000..678d872f9
--- /dev/null
+++ b/src/3rdparty/chromium/v8/src/base/platform/platform-haiku.cc
@@ -0,0 +1,49 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Platform-specific code for FreeBSD goes here. For the POSIX-compatible
+// parts, the implementation is in platform-posix.cc.
+
+#include <pthread.h>
+#include <semaphore.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+#include <fcntl.h> // open
+#include <sys/mman.h> // mmap & munmap
+#include <sys/stat.h> // open
+#include <unistd.h> // getpagesize
+// If you don't have execinfo.h then you need devel/libexecinfo from ports.
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <strings.h> // index
+
+#include <cmath>
+
+#undef MAP_TYPE
+
+#include "src/base/macros.h"
+#include "src/base/platform/platform-posix-time.h"
+#include "src/base/platform/platform-posix.h"
+#include "src/base/platform/platform.h"
+
+namespace v8 {
+namespace base {
+
+TimezoneCache* OS::CreateTimezoneCache() {
+ return new PosixDefaultTimezoneCache();
+}
+
+std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
+ return std::vector<SharedLibraryAddress>();
+}
+
+void OS::SignalCodeMovingGC() {}
+
+} // namespace base
+} // namespace v8
diff --git a/src/core/api/qtbug-61521.cpp b/src/core/api/qtbug-61521.cpp
index 002a1af22..301c0fe2b 100644
--- a/src/core/api/qtbug-61521.cpp
+++ b/src/core/api/qtbug-61521.cpp
@@ -111,7 +111,11 @@ SHIM_HIDDEN void* ShimValloc(size_t size) {
}
SHIM_HIDDEN void* ShimPvalloc(size_t size) {
+#ifndef __HAIKU__
return pvalloc(size);
+#else
+ return valloc(size);
+#endif
}
SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
--
2.21.0
From d4aebbcde3ff0ad41ca57510ef761e6ada02099d Mon Sep 17 00:00:00 2001
From: Kacper Kasper <[email protected]>
Date: Sun, 23 Jun 2019 00:55:54 +0200
Subject: [PATCH 4/5] More linking fixes
---
src/3rdparty/chromium/base/BUILD.gn | 1 +
.../chromium/content/browser/BUILD.gn | 11 +-
.../child_process_launcher_helper_haiku.cc | 113 ++++++++++++++++++
.../browser/memory/memory_monitor_haiku.cc | 17 +++
.../memory/swap_metrics_driver_impl_haiku.cc | 66 ++++++++++
.../memory/swap_metrics_driver_impl_haiku.h | 32 +++++
src/3rdparty/chromium/content/child/BUILD.gn | 2 +-
.../content/child/blink_platform_impl.h | 4 +-
.../content/child/webthemeengine_impl_haiku.h | 17 +++
src/3rdparty/chromium/content/common/BUILD.gn | 7 ++
.../content/common/cursors/webcursor_haiku.cc | 37 ++++++
.../renderer/renderer_blink_platform_impl.cc | 6 +-
src/3rdparty/chromium/gpu/config/BUILD.gn | 6 +
.../gpu/config/gpu_info_collector_haiku.cc | 26 ++++
src/3rdparty/chromium/media/audio/BUILD.gn | 6 +
.../media/audio/haiku/audio_manager_haiku.cc | 23 ++++
src/3rdparty/chromium/net/BUILD.gn | 6 +
.../net/base/platform_mime_util_haiku.cc | 34 ++++++
.../device/geolocation/location_arbitrator.cc | 2 +-
.../device/time_zone_monitor/BUILD.gn | 4 +
.../time_zone_monitor_haiku.cc | 36 ++++++
.../wake_lock/power_save_blocker/BUILD.gn | 4 +
.../power_save_blocker_haiku.cc | 40 +++++++
.../resource_coordinator/public/cpp/BUILD.gn | 4 +
.../os_metrics_haiku.cc | 27 +++++
.../zygote/common/zygote_features.gni | 2 +-
src/3rdparty/chromium/skia/BUILD.gn | 16 +++
.../skia/ext/fontmgr_default_haiku.cc | 27 +++++
.../chromium/skia/ext/fontmgr_default_haiku.h | 15 +++
.../blink/renderer/core/layout/BUILD.gn | 4 +
.../core/layout/layout_theme_haiku.cc | 26 ++++
.../blink/renderer/platform/BUILD.gn | 9 +-
.../renderer/platform/fonts/font_cache.h | 4 +-
.../platform/fonts/haiku/font_cache_haiku.cc | 63 ++++++++++
.../platform/fonts/skia/font_cache_skia.cc | 4 +-
.../platform/text/haiku/hyphenation_haiku.cc | 15 +++
.../chromium/third_party/fontconfig/BUILD.gn | 2 +-
.../third_party/fontconfig/fontconfig.gni | 2 +-
.../chromium/third_party/skia/BUILD.gn | 8 +-
.../chromium/ui/compositor/host/BUILD.gn | 2 +-
src/3rdparty/chromium/ui/display/BUILD.gn | 4 +
.../chromium/ui/display/screen_haiku.cc | 16 +++
src/3rdparty/chromium/ui/gfx/BUILD.gn | 10 +-
.../chromium/ui/gfx/font_fallback_haiku.cc | 18 +++
.../ui/gfx/font_render_params_haiku.cc | 38 ++++++
.../chromium/ui/gfx/platform_font_haiku.cc | 26 ++++
src/3rdparty/chromium/ui/snapshot/BUILD.gn | 7 ++
.../chromium/ui/snapshot/snapshot_haiku.cc | 34 ++++++
48 files changed, 864 insertions(+), 19 deletions(-)
create mode 100644 src/3rdparty/chromium/content/browser/child_process_launcher_helper_haiku.cc
create mode 100644 src/3rdparty/chromium/content/browser/memory/memory_monitor_haiku.cc
create mode 100644 src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.cc
create mode 100644 src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.h
create mode 100644 src/3rdparty/chromium/content/child/webthemeengine_impl_haiku.h
create mode 100644 src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc
create mode 100644 src/3rdparty/chromium/gpu/config/gpu_info_collector_haiku.cc
create mode 100644 src/3rdparty/chromium/media/audio/haiku/audio_manager_haiku.cc
create mode 100644 src/3rdparty/chromium/net/base/platform_mime_util_haiku.cc
create mode 100644 src/3rdparty/chromium/services/device/time_zone_monitor/time_zone_monitor_haiku.cc
create mode 100644 src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/power_save_blocker_haiku.cc
create mode 100644 src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_haiku.cc
create mode 100644 src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.cc
create mode 100644 src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.h
create mode 100644 src/3rdparty/chromium/third_party/blink/renderer/core/layout/layout_theme_haiku.cc
create mode 100644 src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/haiku/font_cache_haiku.cc
create mode 100644 src/3rdparty/chromium/third_party/blink/renderer/platform/text/haiku/hyphenation_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/display/screen_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/gfx/font_fallback_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/gfx/font_render_params_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/gfx/platform_font_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc
diff --git a/src/3rdparty/chromium/base/BUILD.gn b/src/3rdparty/chromium/base/BUILD.gn
index bbfa23ed7..7650b99d0 100644
--- a/src/3rdparty/chromium/base/BUILD.gn
+++ b/src/3rdparty/chromium/base/BUILD.gn
@@ -1460,6 +1460,7 @@ jumbo_component("base") {
sources += [
"base_paths_haiku.cc",
"base_paths_haiku.h",
+ "files/file_path_watcher_stub.cc",
"process/memory_stubs.cc",
"process/process_handle_haiku.cc",
"process/process_iterator_haiku.cc",
diff --git a/src/3rdparty/chromium/content/browser/BUILD.gn b/src/3rdparty/chromium/content/browser/BUILD.gn
index c58c13efb..b1d3637a6 100644
--- a/src/3rdparty/chromium/content/browser/BUILD.gn
+++ b/src/3rdparty/chromium/content/browser/BUILD.gn
@@ -1835,6 +1835,15 @@ jumbo_source_set("browser") {
]
}
+ if (is_haiku) {
+ sources += [
+ "child_process_launcher_helper_haiku.cc",
+ "memory/memory_monitor_haiku.cc",
+ "memory/swap_metrics_driver_impl_haiku.cc",
+ "memory/swap_metrics_driver_impl_haiku.h",
+ ]
+ }
+
if (enable_basic_printing) {
deps += [ "//printing" ]
}
@@ -2341,7 +2350,7 @@ jumbo_source_set("browser") {
]
}
- if (use_aura || is_mac) {
+ if (use_aura || is_mac || is_haiku) {
sources += [
"compositor/browser_compositor_output_surface.cc",
"compositor/browser_compositor_output_surface.h",
diff --git a/src/3rdparty/chromium/content/browser/child_process_launcher_helper_haiku.cc b/src/3rdparty/chromium/content/browser/child_process_launcher_helper_haiku.cc
new file mode 100644
index 000000000..f436fbcc3
--- /dev/null
+++ b/src/3rdparty/chromium/content/browser/child_process_launcher_helper_haiku.cc
@@ -0,0 +1,113 @@
+// 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 "content/browser/child_process_launcher_helper.h"
+
+#include "base/command_line.h"
+#include "base/process/launch.h"
+#include "content/browser/child_process_launcher.h"
+#include "content/public/browser/child_process_launcher_utils.h"
+#include "content/public/common/sandboxed_process_launcher_delegate.h"
+#include "services/service_manager/embedder/result_codes.h"
+
+namespace content {
+namespace internal {
+
+void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread(
+ base::Process process,
+ const ChildProcessLauncherPriority& priority) {
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+ // TODO(fuchsia): Implement this. (crbug.com/707031)
+ NOTIMPLEMENTED();
+}
+
+ChildProcessTerminationInfo ChildProcessLauncherHelper::GetTerminationInfo(
+ const ChildProcessLauncherHelper::Process& process,
+ bool known_dead) {
+ ChildProcessTerminationInfo info;
+ info.status =
+ base::GetTerminationStatus(process.process.Handle(), &info.exit_code);
+ return info;
+}
+
+// static
+bool ChildProcessLauncherHelper::TerminateProcess(const base::Process& process,
+ int exit_code) {
+ return process.Terminate(exit_code, false);
+}
+
+// static
+void ChildProcessLauncherHelper::SetRegisteredFilesForService(
+ const std::string& service_name,
+ catalog::RequiredFileMap required_files) {
+ // TODO(fuchsia): Implement this. (crbug.com/707031)
+ NOTIMPLEMENTED();
+}
+
+// static
+void ChildProcessLauncherHelper::ResetRegisteredFilesForTesting() {
+ // TODO(fuchsia): Implement this. (crbug.com/707031)
+ NOTIMPLEMENTED();
+}
+
+void ChildProcessLauncherHelper::BeforeLaunchOnClientThread() {
+ DCHECK_CURRENTLY_ON(client_thread_id_);
+
+// sandbox_policy_.Initialize(delegate_->GetSandboxType());
+}
+
+base::Optional<mojo::NamedPlatformChannel>
+ChildProcessLauncherHelper::CreateNamedPlatformChannelOnClientThread() {
+ DCHECK_CURRENTLY_ON(client_thread_id_);
+ return base::nullopt;
+}
+
+std::unique_ptr<FileMappedForLaunch>
+ChildProcessLauncherHelper::GetFilesToMap() {
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+ return std::unique_ptr<FileMappedForLaunch>();
+}
+
+bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
+ const PosixFileDescriptorInfo& files_to_register,
+ base::LaunchOptions* options) {
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+
+ /*mojo_channel_->PrepareToPassRemoteEndpoint(&options->handles_to_transfer,
+ command_line());
+ sandbox_policy_.UpdateLaunchOptionsForSandbox(options);*/
+
+ return true;
+}
+
+ChildProcessLauncherHelper::Process
+ChildProcessLauncherHelper::LaunchProcessOnLauncherThread(
+ const base::LaunchOptions& options,
+ std::unique_ptr<FileMappedForLaunch> files_to_register,
+ bool* is_synchronous_launch,
+ int* launch_result) {
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+ DCHECK(mojo_channel_);
+ DCHECK(mojo_channel_->remote_endpoint().is_valid());
+
+ // TODO(750938): Implement sandboxed/isolated subprocess launching.
+ Process child_process;
+ child_process.process = base::LaunchProcess(*command_line(), options);
+ return child_process;
+}
+
+void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread(
+ const ChildProcessLauncherHelper::Process& process,
+ const base::LaunchOptions& options) {
+}
+
+// static
+void ChildProcessLauncherHelper::ForceNormalProcessTerminationSync(
+ ChildProcessLauncherHelper::Process process) {
+ DCHECK(CurrentlyOnProcessLauncherTaskRunner());
+ process.process.Terminate(service_manager::RESULT_CODE_NORMAL_EXIT, true);
+}
+
+} // namespace internal
+} // namespace content
diff --git a/src/3rdparty/chromium/content/browser/memory/memory_monitor_haiku.cc b/src/3rdparty/chromium/content/browser/memory/memory_monitor_haiku.cc
new file mode 100644
index 000000000..9bcbf8d33
--- /dev/null
+++ b/src/3rdparty/chromium/content/browser/memory/memory_monitor_haiku.cc
@@ -0,0 +1,17 @@
+// 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 "content/browser/memory/memory_monitor.h"
+
+#include "base/logging.h"
+
+namespace content {
+
+// TODO(crbug.com/707031): Implement this.
+std::unique_ptr<MemoryMonitor> CreateMemoryMonitor() {
+ NOTIMPLEMENTED();
+ return nullptr;
+}
+
+} // namespace content
diff --git a/src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.cc b/src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.cc
new file mode 100644
index 000000000..6468770fb
--- /dev/null
+++ b/src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.cc
@@ -0,0 +1,66 @@
+// 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 "content/browser/memory/swap_metrics_driver_impl_haiku.h"
+
+#include <memory>
+
+#include "base/memory/ptr_util.h"
+#include "base/process/process_metrics.h"
+#include "base/time/time.h"
+#include "content/public/browser/swap_metrics_driver.h"
+
+namespace content {
+
+namespace {
+
+bool HasSwap() {
+ base::SystemMemoryInfoKB memory_info;
+ if (!base::GetSystemMemoryInfo(&memory_info))
+ return false;
+ return memory_info.swap_total > 0;
+}
+
+} // namespace
+
+// static
+std::unique_ptr<SwapMetricsDriver> SwapMetricsDriver::Create(
+ std::unique_ptr<Delegate> delegate,
+ const base::TimeDelta update_interval) {
+ return /*HasSwap() ? base::WrapUnique<SwapMetricsDriver>(
+ new SwapMetricsDriverImplHaiku(std::move(delegate),
+ update_interval))
+ : */std::unique_ptr<SwapMetricsDriver>();
+}
+
+SwapMetricsDriverImplHaiku::SwapMetricsDriverImplHaiku(
+ std::unique_ptr<Delegate> delegate,
+ const base::TimeDelta update_interval)
+ : SwapMetricsDriverImpl(std::move(delegate), update_interval) {}
+
+SwapMetricsDriverImplHaiku::~SwapMetricsDriverImplHaiku() = default;
+
+SwapMetricsDriver::SwapMetricsUpdateResult
+SwapMetricsDriverImplHaiku::UpdateMetricsInternal(base::TimeDelta interval) {
+ /*base::VmStatInfo vmstat;
+ if (!base::GetVmStatInfo(&vmstat)) {
+ return SwapMetricsDriver::SwapMetricsUpdateResult::kSwapMetricsUpdateFailed;
+ }
+
+ uint64_t in_counts = vmstat.pswpin - last_pswpin_;
+ uint64_t out_counts = vmstat.pswpout - last_pswpout_;
+ last_pswpin_ = vmstat.pswpin;
+ last_pswpout_ = vmstat.pswpout;
+
+ if (interval.is_zero())
+ return SwapMetricsDriver::SwapMetricsUpdateResult::
+ kSwapMetricsUpdateSuccess;
+
+ delegate_->OnSwapInCount(in_counts, interval);
+ delegate_->OnSwapOutCount(out_counts, interval);
+*/
+ return SwapMetricsDriver::SwapMetricsUpdateResult::kSwapMetricsUpdateSuccess;
+}
+
+} // namespace content
diff --git a/src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.h b/src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.h
new file mode 100644
index 000000000..3325375a4
--- /dev/null
+++ b/src/3rdparty/chromium/content/browser/memory/swap_metrics_driver_impl_haiku.h
@@ -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.
+
+#ifndef CONTENT_BROWSER_MEMORY_SWAP_METRICS_DRIVER_IMPL_HAIKU_H_
+#define CONTENT_BROWSER_MEMORY_SWAP_METRICS_DRIVER_IMPL_HAIKU_H_
+
+#include "base/time/time.h"
+#include "content/browser/memory/swap_metrics_driver_impl.h"
+
+#include <memory>
+
+namespace content {
+
+class SwapMetricsDriverImplHaiku : public SwapMetricsDriverImpl {
+ public:
+ SwapMetricsDriverImplHaiku(std::unique_ptr<Delegate> delegate,
+ const base::TimeDelta update_interval);
+ ~SwapMetricsDriverImplHaiku() override;
+
+ protected:
+ SwapMetricsDriver::SwapMetricsUpdateResult UpdateMetricsInternal(
+ base::TimeDelta interval) override;
+
+ private:
+ uint64_t last_pswpin_ = 0;
+ uint64_t last_pswpout_ = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEMORY_SWAP_METRICS_DRIVER_IMPL_HAIKU_H_
diff --git a/src/3rdparty/chromium/content/child/BUILD.gn b/src/3rdparty/chromium/content/child/BUILD.gn
index 40eb1966e..1f8971c0e 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 && !is_haiku) {
+ if (!use_default_render_theme) {
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 994df1288..5e550bce0 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) || defined(OS_HAIKU)
+#if BUILDFLAG(USE_DEFAULT_RENDER_THEME)
#include "content/child/webthemeengine_impl_default.h"
#elif defined(OS_WIN)
#include "content/child/webthemeengine_impl_win.h"
@@ -31,6 +31,8 @@
#include "content/child/webthemeengine_impl_mac.h"
#elif defined(OS_ANDROID)
#include "content/child/webthemeengine_impl_android.h"
+#elif defined(OS_HAIKU)
+#include "content/child/webthemeengine_impl_haiku.h"
#endif
namespace base {
diff --git a/src/3rdparty/chromium/content/child/webthemeengine_impl_haiku.h b/src/3rdparty/chromium/content/child/webthemeengine_impl_haiku.h
new file mode 100644
index 000000000..03870ecc3
--- /dev/null
+++ b/src/3rdparty/chromium/content/child/webthemeengine_impl_haiku.h
@@ -0,0 +1,17 @@
+// Copyright 2014 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 CONTENT_CHILD_WEBTHEMEENGINE_IMPL_HAIKU_H_
+#define CONTENT_CHILD_WEBTHEMEENGINE_IMPL_HAIKU_H_
+
+#include "third_party/blink/public/platform/web_theme_engine.h"
+
+namespace content {
+
+class WebThemeEngineImpl : public blink::WebThemeEngine {
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_WEBTHEMEENGINE_IMPL_MAC_H_
diff --git a/src/3rdparty/chromium/content/common/BUILD.gn b/src/3rdparty/chromium/content/common/BUILD.gn
index 489c994bc..e63fe1de8 100644
--- a/src/3rdparty/chromium/content/common/BUILD.gn
+++ b/src/3rdparty/chromium/content/common/BUILD.gn
@@ -452,6 +452,13 @@ source_set("common") {
sources -= [ "font_list_fontconfig.cc" ]
}
+ if (is_haiku) {
+ sources += [
+ "cursors/webcursor_haiku.cc",
+ "font_list_fuchsia.cc",
+ ]
+ }
+
if (enable_plugins) {
deps += [
"//ppapi/proxy:ipc",
diff --git a/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc b/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc
new file mode 100644
index 000000000..5d2db8c97
--- /dev/null
+++ b/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 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 "content/common/cursors/webcursor.h"
+
+#include "base/logging.h"
+#include "third_party/blink/public/platform/web_cursor_info.h"
+
+namespace content {
+
+gfx::NativeCursor WebCursor::GetNativeCursor() {
+ return gfx::kNullCursor;
+}
+
+#if defined(USE_AURA)
+// In the future when we want to support cursors of various kinds in Aura on
+// Android, we should switch to using webcursor_aura rather than add an
+// implementation here.
+void WebCursor::SetDisplayInfo(const display::Display& display) {
+}
+#endif
+
+void WebCursor::InitPlatformData() {
+}
+
+bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const {
+ return true;
+}
+
+void WebCursor::CleanupPlatformData() {
+}
+
+void WebCursor::CopyPlatformData(const WebCursor& other) {
+}
+
+} // namespace content
diff --git a/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc b/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
index b5b144124..1df5fba3b 100644
--- a/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
+++ b/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
@@ -217,7 +217,7 @@ class RendererBlinkPlatformImpl::SandboxSupport
bool LoadFont(CTFontRef src_font,
CGFontRef* container,
uint32_t* font_id) override;
-#elif defined(OS_LINUX)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID)
void GetFallbackFontForCharacter(
blink::WebUChar32 character,
const char* preferred_locale,
@@ -396,7 +396,7 @@ blink::BlameContext* RendererBlinkPlatformImpl::GetTopLevelBlameContext() {
}
blink::WebSandboxSupport* RendererBlinkPlatformImpl::GetSandboxSupport() {
-#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_FUCHSIA)
+#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
// These platforms do not require sandbox support.
return NULL;
#else
@@ -589,7 +589,7 @@ bool RendererBlinkPlatformImpl::SandboxSupport::LoadFont(CTFontRef src_font,
return content::LoadFont(src_font, out, font_id);
}
-#elif defined(OS_LINUX)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID)
void RendererBlinkPlatformImpl::SandboxSupport::GetFallbackFontForCharacter(
blink::WebUChar32 character,
diff --git a/src/3rdparty/chromium/gpu/config/BUILD.gn b/src/3rdparty/chromium/gpu/config/BUILD.gn
index a595002cd..6ed9ad3f7 100644
--- a/src/3rdparty/chromium/gpu/config/BUILD.gn
+++ b/src/3rdparty/chromium/gpu/config/BUILD.gn
@@ -57,6 +57,8 @@ action("process_json") {
args += [ "chromeos" ]
} else if (is_fuchsia) {
args += [ "fuchsia" ]
+ } else if (is_haiku) {
+ args += [ "haiku" ]
} else {
args += [ "linux" ]
}
@@ -140,6 +142,10 @@ source_set("config_sources") {
sources += [ "gpu_info_collector_fuchsia.cc" ]
}
+ if (is_haiku) {
+ sources += [ "gpu_info_collector_haiku.cc" ]
+ }
+
sources += process_json_outputs
configs += [ "//gpu:gpu_implementation" ]
diff --git a/src/3rdparty/chromium/gpu/config/gpu_info_collector_haiku.cc b/src/3rdparty/chromium/gpu/config/gpu_info_collector_haiku.cc
new file mode 100644
index 000000000..6d93e68c2
--- /dev/null
+++ b/src/3rdparty/chromium/gpu/config/gpu_info_collector_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 "gpu/config/gpu_info_collector.h"
+
+#include "base/trace_event/trace_event.h"
+
+namespace gpu {
+
+bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
+ const GpuPreferences& gpu_preferences) {
+ DCHECK(gpu_info);
+
+ TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo");
+
+ return CollectGraphicsInfoGL(gpu_info, gpu_preferences);
+}
+
+bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
+ // TODO(crbug.com/707031): Implement this.
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace gpu
diff --git a/src/3rdparty/chromium/media/audio/BUILD.gn b/src/3rdparty/chromium/media/audio/BUILD.gn
index 3a9d4e5cd..ee1712116 100644
--- a/src/3rdparty/chromium/media/audio/BUILD.gn
+++ b/src/3rdparty/chromium/media/audio/BUILD.gn
@@ -318,6 +318,12 @@ source_set("audio") {
deps += [ "//third_party/fuchsia-sdk:media" ]
}
+ if (is_haiku) {
+ sources += [
+ "haiku/audio_manager_haiku.cc",
+ ]
+ }
+
if (enable_webrtc) {
sources += [
"audio_input_stream_data_interceptor.cc",
diff --git a/src/3rdparty/chromium/media/audio/haiku/audio_manager_haiku.cc b/src/3rdparty/chromium/media/audio/haiku/audio_manager_haiku.cc
new file mode 100644
index 000000000..ca2bc4311
--- /dev/null
+++ b/src/3rdparty/chromium/media/audio/haiku/audio_manager_haiku.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 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 <memory>
+
+#include "base/command_line.h"
+#include "base/metrics/histogram_macros.h"
+#include "media/base/media_switches.h"
+
+#include "media/audio/fake_audio_manager.h"
+
+
+namespace media {
+
+std::unique_ptr<media::AudioManager> CreateAudioManager(
+ std::unique_ptr<AudioThread> audio_thread,
+ AudioLogFactory* audio_log_factory) {
+ return std::make_unique<FakeAudioManager>(std::move(audio_thread),
+ audio_log_factory);
+}
+
+} // namespace media
diff --git a/src/3rdparty/chromium/net/BUILD.gn b/src/3rdparty/chromium/net/BUILD.gn
index c926bc202..ef69e8b54 100644
--- a/src/3rdparty/chromium/net/BUILD.gn
+++ b/src/3rdparty/chromium/net/BUILD.gn
@@ -1938,6 +1938,12 @@ component("net") {
"cert/test_root_certs_fuchsia.cc",
]
}
+
+ if (is_haiku) {
+ sources += [
+ "base/platform_mime_util_haiku.cc",
+ ]
+ }
}
if (enable_unix_sockets) {
diff --git a/src/3rdparty/chromium/net/base/platform_mime_util_haiku.cc b/src/3rdparty/chromium/net/base/platform_mime_util_haiku.cc
new file mode 100644
index 000000000..99ababc1b
--- /dev/null
+++ b/src/3rdparty/chromium/net/base/platform_mime_util_haiku.cc
@@ -0,0 +1,34 @@
+// 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 "net/base/platform_mime_util.h"
+
+#include <string>
+
+#include "base/logging.h"
+#include "build/build_config.h"
+
+namespace net {
+
+bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
+ const base::FilePath::StringType& extension,
+ std::string* result) const {
+ // TODO(fuchsia): Integrate with MIME DB when Fuchsia provides an API.
+ return false;
+}
+
+bool PlatformMimeUtil::GetPlatformPreferredExtensionForMimeType(
+ const std::string& mime_type,
+ base::FilePath::StringType* extension) const {
+ // TODO(fuchsia): Integrate with MIME DB when Fuchsia provides an API.
+ return false;
+}
+
+void PlatformMimeUtil::GetPlatformExtensionsForMimeType(
+ const std::string& mime_type,
+ std::unordered_set<base::FilePath::StringType>* extensions) const {
+ // TODO(fuchsia): Integrate with MIME DB when Fuchsia provides an API.
+}
+
+} // namespace net
diff --git a/src/3rdparty/chromium/services/device/geolocation/location_arbitrator.cc b/src/3rdparty/chromium/services/device/geolocation/location_arbitrator.cc
index 548e3701b..df96d3065 100644
--- a/src/3rdparty/chromium/services/device/geolocation/location_arbitrator.cc
+++ b/src/3rdparty/chromium/services/device/geolocation/location_arbitrator.cc
@@ -167,7 +167,7 @@ LocationArbitrator::NewNetworkLocationProvider(
std::unique_ptr<LocationProvider>
LocationArbitrator::NewSystemLocationProvider() {
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
- defined(OS_FUCHSIA)
+ defined(OS_FUCHSIA) || defined(OS_HAIKU)
return nullptr;
#else
return device::NewSystemLocationProvider();
diff --git a/src/3rdparty/chromium/services/device/time_zone_monitor/BUILD.gn b/src/3rdparty/chromium/services/device/time_zone_monitor/BUILD.gn
index 565c91996..a8afb210e 100644
--- a/src/3rdparty/chromium/services/device/time_zone_monitor/BUILD.gn
+++ b/src/3rdparty/chromium/services/device/time_zone_monitor/BUILD.gn
@@ -51,6 +51,10 @@ source_set("time_zone_monitor") {
if (is_fuchsia) {
sources += [ "time_zone_monitor_fuchsia.cc" ]
}
+
+ if (is_haiku) {
+ sources += [ "time_zone_monitor_haiku.cc" ]
+ }
}
if (is_android) {
diff --git a/src/3rdparty/chromium/services/device/time_zone_monitor/time_zone_monitor_haiku.cc b/src/3rdparty/chromium/services/device/time_zone_monitor/time_zone_monitor_haiku.cc
new file mode 100644
index 000000000..56723f677
--- /dev/null
+++ b/src/3rdparty/chromium/services/device/time_zone_monitor/time_zone_monitor_haiku.cc
@@ -0,0 +1,36 @@
+// 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 "services/device/time_zone_monitor/time_zone_monitor.h"
+
+#include <memory>
+
+#include "base/logging.h"
+#include "base/memory/ptr_util.h"
+
+namespace device {
+namespace {
+
+// TODO(fuchsia): Implement this. crbug.com/750934
+class TimeZoneMonitorHaiku : public TimeZoneMonitor {
+ public:
+ TimeZoneMonitorHaiku() = default;
+ ~TimeZoneMonitorHaiku() override = default;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorHaiku);
+};
+
+} // namespace
+
+// static
+std::unique_ptr<TimeZoneMonitor> TimeZoneMonitor::Create(
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
+ // TODO(fuchsia): Implement this. crbug.com/750934
+ NOTIMPLEMENTED();
+
+ return std::make_unique<TimeZoneMonitorHaiku>();
+}
+
+} // namespace device
diff --git a/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/BUILD.gn b/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/BUILD.gn
index 0c696ca5a..c21cb9a64 100644
--- a/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/BUILD.gn
+++ b/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/BUILD.gn
@@ -70,6 +70,10 @@ source_set("power_save_blocker") {
sources -= [ "power_save_blocker_x11.cc" ]
}
+ if (is_haiku) {
+ sources += [ "power_save_blocker_haiku.cc" ]
+ }
+
if (is_android) {
deps += [ ":jni_headers" ]
public_deps += [ "//ui/android" ]
diff --git a/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/power_save_blocker_haiku.cc b/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/power_save_blocker_haiku.cc
new file mode 100644
index 000000000..9e728a3b5
--- /dev/null
+++ b/src/3rdparty/chromium/services/device/wake_lock/power_save_blocker/power_save_blocker_haiku.cc
@@ -0,0 +1,40 @@
+// 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.
+
+#include "services/device/wake_lock/power_save_blocker/power_save_blocker.h"
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+
+namespace device {
+
+// TODO(derat): Consider renaming this file; '_ozone' is a misnomer as power
+// save is OS-specific, not display-system-specific. This implementation
+// ends up being used for non-ChromeOS Ozone platforms such as Chromecast.
+// See crbug.com/495661 for more detail.
+class PowerSaveBlocker::Delegate
+ : public base::RefCountedThreadSafe<PowerSaveBlocker::Delegate> {
+ public:
+ Delegate() {}
+
+ private:
+ friend class base::RefCountedThreadSafe<Delegate>;
+ virtual ~Delegate() {}
+
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+};
+
+PowerSaveBlocker::PowerSaveBlocker(
+ mojom::WakeLockType type,
+ mojom::WakeLockReason reason,
+ const std::string& description,
+ scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner)
+ : delegate_(new Delegate()),
+ ui_task_runner_(ui_task_runner),
+ blocking_task_runner_(blocking_task_runner) {}
+
+PowerSaveBlocker::~PowerSaveBlocker() {}
+
+} // namespace device
diff --git a/src/3rdparty/chromium/services/resource_coordinator/public/cpp/BUILD.gn b/src/3rdparty/chromium/services/resource_coordinator/public/cpp/BUILD.gn
index 5535fec2e..94646ed80 100644
--- a/src/3rdparty/chromium/services/resource_coordinator/public/cpp/BUILD.gn
+++ b/src/3rdparty/chromium/services/resource_coordinator/public/cpp/BUILD.gn
@@ -56,6 +56,10 @@ component("resource_coordinator_cpp") {
sources += [ "memory_instrumentation/os_metrics_fuchsia.cc" ]
}
+ if (is_haiku) {
+ sources += [ "memory_instrumentation/os_metrics_haiku.cc" ]
+ }
+
defines = [ "SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_IMPLEMENTATION" ]
deps = []
diff --git a/src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_haiku.cc b/src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_haiku.cc
new file mode 100644
index 000000000..4a946b942
--- /dev/null
+++ b/src/3rdparty/chromium/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_haiku.cc
@@ -0,0 +1,27 @@
+// 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 "services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h"
+
+#include <vector>
+
+namespace memory_instrumentation {
+
+// static
+bool OSMetrics::FillOSMemoryDump(base::ProcessId pid,
+ mojom::RawOSMemDump* dump) {
+ // TODO(fuchsia): Implement this. See crbug.com/750948
+ NOTIMPLEMENTED();
+ return false;
+}
+
+// static
+std::vector<mojom::VmRegionPtr> OSMetrics::GetProcessMemoryMaps(
+ base::ProcessId) {
+ // TODO(fuchsia): Implement this. See crbug.com/750948
+ NOTIMPLEMENTED();
+ return std::vector<mojom::VmRegionPtr>();
+}
+
+} // namespace memory_instrumentation
diff --git a/src/3rdparty/chromium/services/service_manager/zygote/common/zygote_features.gni b/src/3rdparty/chromium/services/service_manager/zygote/common/zygote_features.gni
index c7580b35f..ae0c13102 100644
--- a/src/3rdparty/chromium/services/service_manager/zygote/common/zygote_features.gni
+++ b/src/3rdparty/chromium/services/service_manager/zygote/common/zygote_features.gni
@@ -2,4 +2,4 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-use_zygote_handle = is_posix && !is_android && !is_mac
+use_zygote_handle = is_posix && !is_android && !is_mac && !is_haiku
diff --git a/src/3rdparty/chromium/skia/BUILD.gn b/src/3rdparty/chromium/skia/BUILD.gn
index 453133c24..0c98c2644 100644
--- a/src/3rdparty/chromium/skia/BUILD.gn
+++ b/src/3rdparty/chromium/skia/BUILD.gn
@@ -497,6 +497,22 @@ component("skia") {
]
}
+ if (is_haiku) {
+ sources += [
+ "//third_party/skia/src/ports/SkFontConfigInterface.cpp",
+ "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
+ "//third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp",
+ "//third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp",
+ "ext/fontmgr_default_haiku.cc",
+ "ext/fontmgr_default_haiku.h",
+ ]
+ deps += [
+ "//third_party/expat",
+ "//third_party/fontconfig",
+ "//third_party/icu:icuuc",
+ ]
+ }
+
if (is_win) {
sources += [
# Select the right BitmapPlatformDevice.
diff --git a/src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.cc b/src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.cc
new file mode 100644
index 000000000..edc0cd4e8
--- /dev/null
+++ b/src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.cc
@@ -0,0 +1,27 @@
+// 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 "skia/ext/fontmgr_default_haiku.h"
+
+#include "third_party/skia/include/core/SkFontMgr.h"
+#include "third_party/skia/include/ports/SkFontConfigInterface.h"
+#include "third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h"
+
+namespace {
+// An owning leaky bare pointer.
+SkFontMgr* g_default_fontmgr;
+} // namespace
+
+SK_API void SetDefaultSkiaFactory(sk_sp<SkFontMgr> fontmgr) {
+ SkASSERT(g_default_fontmgr == nullptr);
+ g_default_fontmgr = fontmgr.release();
+}
+
+SK_API sk_sp<SkFontMgr> SkFontMgr::Factory() {
+ if (g_default_fontmgr) {
+ return sk_ref_sp(g_default_fontmgr);
+ }
+ sk_sp<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal());
+ return fci ? SkFontMgr_New_FCI(std::move(fci)) : nullptr;
+}
diff --git a/src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.h b/src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.h
new file mode 100644
index 000000000..a50aac52d
--- /dev/null
+++ b/src/3rdparty/chromium/skia/ext/fontmgr_default_haiku.h
@@ -0,0 +1,15 @@
+// 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.
+
+#ifndef SKIA_EXT_FONTMGR_DEFAULT_HAIKU_H_
+#define SKIA_EXT_FONTMGR_DEFAULT_HAIKU_H_
+
+#include "third_party/skia/include/core/SkTypes.h"
+
+class SkFontMgr;
+template <typename T> class sk_sp;
+
+SK_API void SetDefaultSkiaFactory(sk_sp<SkFontMgr> fontmgr);
+
+#endif // SKIA_EXT_FONTMGR_DEFAULT_HAIKU_H_
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/layout/BUILD.gn b/src/3rdparty/chromium/third_party/blink/renderer/core/layout/BUILD.gn
index 1cbe8b012..0f3449fe5 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/core/layout/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/blink/renderer/core/layout/BUILD.gn
@@ -539,4 +539,8 @@ blink_core_sources("layout") {
if (is_fuchsia) {
sources += [ "layout_theme_fuchsia.cc" ]
}
+
+ if (is_haiku) {
+ sources += [ "layout_theme_haiku.cc" ]
+ }
}
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/layout/layout_theme_haiku.cc b/src/3rdparty/chromium/third_party/blink/renderer/core/layout/layout_theme_haiku.cc
new file mode 100644
index 000000000..5fad6caab
--- /dev/null
+++ b/src/3rdparty/chromium/third_party/blink/renderer/core/layout/layout_theme_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 "third_party/blink/renderer/core/layout/layout_theme_default.h"
+
+namespace blink {
+namespace {
+
+// Fuchsia is headless-only for now, so no native themes are applied.
+// TODO(fuchsia): Implement this when we enable the UI. (crbug.com/750946)
+class LayoutThemeHaiku : public LayoutThemeDefault {
+ public:
+ static scoped_refptr<LayoutTheme> Create() {
+ return base::AdoptRef(new LayoutThemeHaiku());
+ }
+};
+
+} // namespace
+
+LayoutTheme& LayoutTheme::NativeTheme() {
+ DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeHaiku::Create()));
+ return *layout_theme;
+}
+
+} // namespace blink
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn b/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn
index e6990e04b..58d718643 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn
@@ -1563,6 +1563,13 @@ jumbo_component("platform") {
]
}
+ if (is_haiku) {
+ sources += [
+ "fonts/haiku/font_cache_haiku.cc",
+ "text/haiku/hyphenation_haiku.cc",
+ ]
+ }
+
if (use_minikin_hyphenation) {
sources += [
"text/hyphenation/hyphenation_minikin.cc",
@@ -1572,7 +1579,7 @@ jumbo_component("platform") {
]
}
- if (!use_default_render_theme) {
+ if (!use_default_render_theme && !is_haiku) {
sources -= [
"scroll/scrollbar_theme_aura.cc",
"scroll/scrollbar_theme_aura.h",
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
index cee7db183..a31b71c10 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/font_cache.h
@@ -293,12 +293,12 @@ class PLATFORM_EXPORT FontCache {
const FontFaceCreationParams&,
CString& name);
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA)
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
static AtomicString GetFamilyNameForCharacter(SkFontMgr*,
UChar32,
const FontDescription&,
FontFallbackPriority);
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA)
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
scoped_refptr<SimpleFontData> FallbackOnStandardFontStyle(const FontDescription&,
UChar32);
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/haiku/font_cache_haiku.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/haiku/font_cache_haiku.cc
new file mode 100644
index 000000000..3bd6b1cd0
--- /dev/null
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/haiku/font_cache_haiku.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2017 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "third_party/blink/renderer/platform/fonts/font_cache.h"
+
+#include "third_party/blink/renderer/platform/fonts/font_platform_data.h"
+
+namespace blink {
+
+static AtomicString& MutableSystemFontFamily() {
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(AtomicString, system_font_family, ());
+ return system_font_family;
+}
+
+// static
+const AtomicString& FontCache::SystemFontFamily() {
+ return MutableSystemFontFamily();
+}
+
+// static
+void FontCache::SetSystemFontFamily(const AtomicString& family_name) {
+ DCHECK(!family_name.IsEmpty());
+ MutableSystemFontFamily() = family_name;
+}
+
+scoped_refptr<SimpleFontData> FontCache::PlatformFallbackFontForCharacter(
+ const FontDescription& font_description,
+ UChar32 c,
+ const SimpleFontData* font_data_to_substitute,
+ FontFallbackPriority fallback_priority) {
+ sk_sp<SkFontMgr> font_mgr(SkFontMgr::RefDefault());
+ AtomicString family_name = GetFamilyNameForCharacter(
+ font_mgr.get(), c, font_description, fallback_priority);
+ if (family_name.IsEmpty())
+ return GetLastResortFallbackFont(font_description, kDoNotRetain);
+ return FontDataFromFontPlatformData(
+ GetFontPlatformData(font_description,
+ FontFaceCreationParams(family_name)),
+ kDoNotRetain);
+}
+
+} // namespace blink
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
index 5781cafc4..9a1ae6e47 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
@@ -59,7 +59,7 @@ AtomicString ToAtomicString(const SkString& str) {
return AtomicString::FromUTF8(str.c_str(), str.size());
}
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA)
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
// Android special locale for retrieving the color emoji font
// based on the proposed changes in UTR #51 for introducing
// an Emoji script code:
@@ -103,7 +103,7 @@ AtomicString FontCache::GetFamilyNameForCharacter(
typeface->getFamilyName(&skia_family_name);
return ToAtomicString(skia_family_name);
}
-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA)
+#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_FUCHSIA) || defined(OS_HAIKU)
void FontCache::PlatformInit() {}
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/haiku/hyphenation_haiku.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/haiku/hyphenation_haiku.cc
new file mode 100644
index 000000000..54463f94c
--- /dev/null
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/haiku/hyphenation_haiku.cc
@@ -0,0 +1,15 @@
+// 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 "third_party/blink/renderer/platform/text/hyphenation.h"
+
+namespace blink {
+
+scoped_refptr<Hyphenation> Hyphenation::PlatformGetHyphenation(
+ const AtomicString&) {
+ // TODO(fuchsia): Implement this when UI support is ready. crbug.com/750946
+ return nullptr;
+}
+
+} // namespace blink
diff --git a/src/3rdparty/chromium/third_party/fontconfig/BUILD.gn b/src/3rdparty/chromium/third_party/fontconfig/BUILD.gn
index 317575891..b7414afb2 100644
--- a/src/3rdparty/chromium/third_party/fontconfig/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/fontconfig/BUILD.gn
@@ -4,7 +4,7 @@
import("//third_party/fontconfig/fontconfig.gni")
-assert(is_linux)
+assert(is_linux || is_haiku)
if (use_bundled_fontconfig) {
config("fontconfig_config") {
diff --git a/src/3rdparty/chromium/third_party/fontconfig/fontconfig.gni b/src/3rdparty/chromium/third_party/fontconfig/fontconfig.gni
index 0965f9fe2..cb1f1f451 100644
--- a/src/3rdparty/chromium/third_party/fontconfig/fontconfig.gni
+++ b/src/3rdparty/chromium/third_party/fontconfig/fontconfig.gni
@@ -4,7 +4,7 @@
import("//build/config/features.gni")
-assert(is_linux)
+assert(is_linux || is_haiku)
declare_args() {
use_bundled_fontconfig = is_linux
diff --git a/src/3rdparty/chromium/third_party/skia/BUILD.gn b/src/3rdparty/chromium/third_party/skia/BUILD.gn
index f396cb93f..396b66449 100644
--- a/src/3rdparty/chromium/third_party/skia/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/skia/BUILD.gn
@@ -19,8 +19,8 @@ declare_args() {
skia_use_angle = false
skia_use_egl = false
skia_use_expat = true
- skia_use_fontconfig = is_linux
- skia_use_freetype = is_android || is_fuchsia || is_linux
+ skia_use_fontconfig = is_linux || is_haiku
+ skia_use_freetype = is_android || is_fuchsia || is_linux || is_haiku
skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
skia_use_libjpeg_turbo = true
skia_use_libpng = true
@@ -981,6 +981,10 @@ component("skia") {
if (is_fuchsia) {
sources += [ "src/ports/SkDebug_stdio.cpp" ]
}
+
+ if (is_haiku) {
+ sources += [ "src/ports/SkDebug_stdio.cpp" ]
+ }
}
# Targets guarded by skia_enable_tools may use //third_party freely.
diff --git a/src/3rdparty/chromium/ui/compositor/host/BUILD.gn b/src/3rdparty/chromium/ui/compositor/host/BUILD.gn
index e84b2c4ca..01a59755f 100644
--- a/src/3rdparty/chromium/ui/compositor/host/BUILD.gn
+++ b/src/3rdparty/chromium/ui/compositor/host/BUILD.gn
@@ -21,7 +21,7 @@ source_set("host") {
"//services/viz/privileged/interfaces/compositing",
]
- if (use_aura || is_mac) {
+ if (use_aura || is_mac || is_haiku) {
public += [ "host_context_factory_private.h" ]
sources += [ "host_context_factory_private.cc" ]
diff --git a/src/3rdparty/chromium/ui/display/BUILD.gn b/src/3rdparty/chromium/ui/display/BUILD.gn
index 8d014f067..92759a85a 100644
--- a/src/3rdparty/chromium/ui/display/BUILD.gn
+++ b/src/3rdparty/chromium/ui/display/BUILD.gn
@@ -74,6 +74,10 @@ component("display") {
"CoreGraphics.framework",
]
}
+
+ if (is_haiku) {
+ sources += [ "screen_haiku.cc" ]
+ }
}
component("display_manager_test_api") {
diff --git a/src/3rdparty/chromium/ui/display/screen_haiku.cc b/src/3rdparty/chromium/ui/display/screen_haiku.cc
new file mode 100644
index 000000000..3fed8c2c1
--- /dev/null
+++ b/src/3rdparty/chromium/ui/display/screen_haiku.cc
@@ -0,0 +1,16 @@
+// 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 "ui/display/screen.h"
+
+#include "base/logging.h"
+
+namespace display {
+
+// static
+gfx::NativeWindow Screen::GetWindowForView(gfx::NativeView view) {
+ return view;
+}
+
+} // namespace display
diff --git a/src/3rdparty/chromium/ui/gfx/BUILD.gn b/src/3rdparty/chromium/ui/gfx/BUILD.gn
index 04856ba46..a3e115e4c 100644
--- a/src/3rdparty/chromium/ui/gfx/BUILD.gn
+++ b/src/3rdparty/chromium/ui/gfx/BUILD.gn
@@ -261,7 +261,7 @@ jumbo_component("gfx") {
]
# Text rendering conditions (complicated so separated out).
- if (use_aura || is_mac || (is_android && enable_vr) || is_fuchsia) {
+ if (use_aura || is_mac || (is_android && enable_vr) || is_fuchsia || is_haiku) {
# Mac doesn't use RenderTextHarfBuzz by default yet.
sources += [
"harfbuzz_font_skia.cc",
@@ -394,6 +394,14 @@ jumbo_component("gfx") {
"platform_font_fuchsia.cc",
]
}
+
+ if (is_haiku) {
+ sources += [
+ "font_fallback_haiku.cc",
+ "font_render_params_haiku.cc",
+ "platform_font_haiku.cc",
+ ]
+ }
}
jumbo_component("color_space") {
diff --git a/src/3rdparty/chromium/ui/gfx/font_fallback_haiku.cc b/src/3rdparty/chromium/ui/gfx/font_fallback_haiku.cc
new file mode 100644
index 000000000..bfdc7aa2c
--- /dev/null
+++ b/src/3rdparty/chromium/ui/gfx/font_fallback_haiku.cc
@@ -0,0 +1,18 @@
+// 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 "ui/gfx/font_fallback.h"
+
+#include <string>
+#include <vector>
+
+namespace gfx {
+
+std::vector<Font> GetFallbackFonts(const Font& font) {
+ // TODO(fuchsia): Stubbed while bringing up headless build, see
+ // https://crbug.com/743296.
+ return std::vector<Font>();
+}
+
+} // namespace gfx
diff --git a/src/3rdparty/chromium/ui/gfx/font_render_params_haiku.cc b/src/3rdparty/chromium/ui/gfx/font_render_params_haiku.cc
new file mode 100644
index 000000000..f693f926c
--- /dev/null
+++ b/src/3rdparty/chromium/ui/gfx/font_render_params_haiku.cc
@@ -0,0 +1,38 @@
+// 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 "ui/gfx/font_render_params.h"
+
+#include "base/logging.h"
+#include "base/macros.h"
+
+namespace gfx {
+
+namespace {
+
+// Returns the system's default settings.
+FontRenderParams LoadDefaults() {
+ FontRenderParams params;
+ params.antialiasing = true;
+ params.autohinter = true;
+ params.use_bitmaps = true;
+ params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
+ params.subpixel_positioning = true;
+ params.hinting = FontRenderParams::HINTING_SLIGHT;
+
+ return params;
+}
+
+} // namespace
+
+FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
+ std::string* family_out) {
+ if (family_out)
+ NOTIMPLEMENTED();
+ // Customized font rendering settings are not supported, only defaults.
+ CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, (LoadDefaults()));
+ return params;
+}
+
+} // namespace gfx
diff --git a/src/3rdparty/chromium/ui/gfx/platform_font_haiku.cc b/src/3rdparty/chromium/ui/gfx/platform_font_haiku.cc
new file mode 100644
index 000000000..d15006683
--- /dev/null
+++ b/src/3rdparty/chromium/ui/gfx/platform_font_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 "ui/gfx/platform_font.h"
+
+#include "base/logging.h"
+
+namespace gfx {
+
+// static
+PlatformFont* PlatformFont::CreateDefault() {
+ // TODO(fuchsia): Stubbed during headless bringup, https://crbug.com/743296.
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
+ int font_size) {
+ // TODO(fuchsia): Stubbed during headless bringup, https://crbug.com/743296.
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+} // namespace gfx
diff --git a/src/3rdparty/chromium/ui/snapshot/BUILD.gn b/src/3rdparty/chromium/ui/snapshot/BUILD.gn
index 5ceaabcb0..9494e5d82 100644
--- a/src/3rdparty/chromium/ui/snapshot/BUILD.gn
+++ b/src/3rdparty/chromium/ui/snapshot/BUILD.gn
@@ -70,6 +70,13 @@ jumbo_component("snapshot") {
"CoreGraphics.framework",
]
}
+
+ if (is_haiku) {
+ sources += [
+ "snapshot_haiku.cc",
+ "snapshot_haiku.h",
+ ]
+ }
}
jumbo_source_set("snapshot_win") {
diff --git a/src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc b/src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc
new file mode 100644
index 000000000..2c33ff8e0
--- /dev/null
+++ b/src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 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/snapshot/snapshot.h"
+
+namespace ui {
+
+bool GrabWindowSnapshot(gfx::NativeWindow window,
+ const gfx::Rect& snapshot_bounds,
+ gfx::Image* image) {
+ // Not supported in Aura. Callers should fall back to the async version.
+ return false;
+}
+
+void GrabWindowSnapshotAsync(gfx::NativeWindow window,
+ const gfx::Rect& source_rect,
+ const GrabWindowSnapshotAsyncCallback& callback) {
+ //GrabWindowSnapshotAsyncAura(window, source_rect, callback);
+}
+
+bool GrabViewSnapshot(gfx::NativeView view,
+ const gfx::Rect& snapshot_bounds,
+ gfx::Image* image) {
+ return false;
+}
+
+void GrabViewSnapshotAsync(gfx::NativeView view,
+ const gfx::Rect& source_rect,
+ const GrabWindowSnapshotAsyncCallback& callback) {
+ //GrabWindowSnapshotAsyncAura(view, source_rect, callback);
+}
+
+} // namespace ui
--
2.21.0
From 2d35bed2def72be52af1225703cceb3d391847a7 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <[email protected]>
Date: Sun, 7 Jul 2019 00:02:39 +0200
Subject: [PATCH 5/5] Built all the way
---
src/3rdparty/chromium/build/config/ui.gni | 2 +-
.../chromium/content/browser/BUILD.gn | 18 +-
src/3rdparty/chromium/content/common/BUILD.gn | 1 -
.../content/common/cursors/webcursor_haiku.cc | 12 +-
.../renderer/renderer_blink_platform_impl.cc | 2 +-
...link_platform_with_sandbox_support_impl.cc | 10 +-
...blink_platform_with_sandbox_support_impl.h | 4 +-
.../chromium/gpu/ipc/common/surface_handle.h | 6 +-
.../chromium/gpu/ipc/service/BUILD.gn | 3 +
.../service/image_transport_surface_haiku.cc | 27 +++
src/3rdparty/chromium/ui/base/BUILD.gn | 8 +
.../chromium/ui/base/cursor/cursor_haiku.cc | 17 ++
.../ui/base/cursor/cursor_loader_haiku.cc | 159 ++++++++++++++++++
.../ui/base/cursor/cursor_loader_haiku.h | 36 ++++
src/3rdparty/chromium/ui/events/BUILD.gn | 4 +
.../ui/events/haiku/keyboard_hook_haiku.cc | 29 ++++
src/3rdparty/chromium/ui/gl/gl_fence.cc | 2 +-
.../chromium/ui/gl/init/gl_factory_haiku.cc | 11 +-
.../ui/gl/init/gl_initializer_haiku.cc | 2 -
src/3rdparty/chromium/ui/snapshot/BUILD.gn | 7 -
.../chromium/ui/snapshot/snapshot_haiku.cc | 34 ----
src/core/config/haiku.pri | 3 +-
src/core/ozone/gl_surface_egl_qt.cpp | 4 +-
23 files changed, 316 insertions(+), 85 deletions(-)
create mode 100644 src/3rdparty/chromium/gpu/ipc/service/image_transport_surface_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/base/cursor/cursor_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.cc
create mode 100644 src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.h
create mode 100644 src/3rdparty/chromium/ui/events/haiku/keyboard_hook_haiku.cc
delete mode 100644 src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc
diff --git a/src/3rdparty/chromium/build/config/ui.gni b/src/3rdparty/chromium/build/config/ui.gni
index 886cca123..e1a7d85b0 100644
--- a/src/3rdparty/chromium/build/config/ui.gni
+++ b/src/3rdparty/chromium/build/config/ui.gni
@@ -28,7 +28,7 @@ declare_args() {
# Indicates if Aura is enabled. Aura is a low-level windowing library, sort
# of a replacement for GDI or GTK.
- use_aura = is_win || is_linux || is_fuchsia
+ use_aura = is_win || is_linux || is_fuchsia || is_haiku
}
declare_args() {
diff --git a/src/3rdparty/chromium/content/browser/BUILD.gn b/src/3rdparty/chromium/content/browser/BUILD.gn
index b1d3637a6..ca48041c2 100644
--- a/src/3rdparty/chromium/content/browser/BUILD.gn
+++ b/src/3rdparty/chromium/content/browser/BUILD.gn
@@ -1826,6 +1826,13 @@ jumbo_source_set("browser") {
"child_process_launcher_helper_fuchsia.cc",
"memory/memory_monitor_fuchsia.cc",
]
+ } else if (is_haiku) {
+ sources += [
+ "child_process_launcher_helper_haiku.cc",
+ "memory/memory_monitor_haiku.cc",
+ "memory/swap_metrics_driver_impl_haiku.cc",
+ "memory/swap_metrics_driver_impl_haiku.h",
+ ]
} else if (is_posix) {
sources += [
"child_process_launcher_helper_posix.cc",
@@ -1835,15 +1842,6 @@ jumbo_source_set("browser") {
]
}
- if (is_haiku) {
- sources += [
- "child_process_launcher_helper_haiku.cc",
- "memory/memory_monitor_haiku.cc",
- "memory/swap_metrics_driver_impl_haiku.cc",
- "memory/swap_metrics_driver_impl_haiku.h",
- ]
- }
-
if (enable_basic_printing) {
deps += [ "//printing" ]
}
@@ -2350,7 +2348,7 @@ jumbo_source_set("browser") {
]
}
- if (use_aura || is_mac || is_haiku) {
+ if (use_aura || is_mac) {
sources += [
"compositor/browser_compositor_output_surface.cc",
"compositor/browser_compositor_output_surface.h",
diff --git a/src/3rdparty/chromium/content/common/BUILD.gn b/src/3rdparty/chromium/content/common/BUILD.gn
index e63fe1de8..4b48dac08 100644
--- a/src/3rdparty/chromium/content/common/BUILD.gn
+++ b/src/3rdparty/chromium/content/common/BUILD.gn
@@ -455,7 +455,6 @@ source_set("common") {
if (is_haiku) {
sources += [
"cursors/webcursor_haiku.cc",
- "font_list_fuchsia.cc",
]
}
diff --git a/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc b/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc
index 5d2db8c97..bfa1770cf 100644
--- a/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc
+++ b/src/3rdparty/chromium/content/common/cursors/webcursor_haiku.cc
@@ -9,16 +9,14 @@
namespace content {
+#if defined(USE_AURA)
+ui::PlatformCursor WebCursor::GetPlatformCursor() {
+ return nullptr;
+}
+#else
gfx::NativeCursor WebCursor::GetNativeCursor() {
return gfx::kNullCursor;
}
-
-#if defined(USE_AURA)
-// In the future when we want to support cursors of various kinds in Aura on
-// Android, we should switch to using webcursor_aura rather than add an
-// implementation here.
-void WebCursor::SetDisplayInfo(const display::Display& display) {
-}
#endif
void WebCursor::InitPlatformData() {
diff --git a/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc b/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
index 1df5fba3b..0c87e623e 100644
--- a/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
+++ b/src/3rdparty/chromium/content/renderer/renderer_blink_platform_impl.cc
@@ -589,7 +589,7 @@ bool RendererBlinkPlatformImpl::SandboxSupport::LoadFont(CTFontRef src_font,
return content::LoadFont(src_font, out, font_id);
}
-#elif defined(OS_POSIX) && !defined(OS_ANDROID)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
void RendererBlinkPlatformImpl::SandboxSupport::GetFallbackFontForCharacter(
blink::WebUChar32 character,
diff --git a/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc b/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc
index 51eab0917..506914ef7 100644
--- a/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc
+++ b/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc
@@ -10,7 +10,7 @@
#include "base/mac/foundation_util.h"
#include "content/child/child_process_sandbox_support_impl_mac.h"
#include "third_party/blink/public/platform/mac/web_sandbox_support.h"
-#elif defined(OS_POSIX) && !defined(OS_ANDROID)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
#include "base/synchronization/lock.h"
#include "content/child/child_process_sandbox_support_impl_linux.h"
#include "content/child/child_thread_impl.h"
@@ -27,7 +27,7 @@ struct WebFontRenderStyle;
namespace content {
-#if defined(OS_POSIX) && !defined(OS_ANDROID)
+#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
class UtilityBlinkPlatformWithSandboxSupportImpl::SandboxSupport
: public blink::WebSandboxSupport {
@@ -63,7 +63,7 @@ class UtilityBlinkPlatformWithSandboxSupportImpl::SandboxSupport
#endif // defined(OS_MACOSX)
};
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID)
+#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
UtilityBlinkPlatformWithSandboxSupportImpl::
UtilityBlinkPlatformWithSandboxSupportImpl(
@@ -82,7 +82,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl::
blink::WebSandboxSupport*
UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() {
-#if defined(OS_POSIX) && !defined(OS_ANDROID)
+#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
return sandbox_support_.get();
#else
return nullptr;
@@ -98,7 +98,7 @@ bool UtilityBlinkPlatformWithSandboxSupportImpl::SandboxSupport::LoadFont(
return content::LoadFont(src_font, out, font_id);
}
-#elif defined(OS_POSIX) && !defined(OS_ANDROID)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
void UtilityBlinkPlatformWithSandboxSupportImpl::SandboxSupport::
GetFallbackFontForCharacter(blink::WebUChar32 character,
diff --git a/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h b/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h
index 3461acddb..c4336fe13 100644
--- a/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h
+++ b/src/3rdparty/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h
@@ -11,7 +11,7 @@
#include "build/build_config.h"
#include "content/utility/utility_blink_platform_impl.h"
-#if defined(OS_POSIX) && !defined(OS_ANDROID)
+#if defined(OS_POSIX) && !defined(OS_ANDROID) & !defined(OS_HAIKU)
#include "components/services/font/public/cpp/font_loader.h" // nogncheck
#include "third_party/skia/include/core/SkRefCnt.h" // nogncheck
#endif
@@ -40,7 +40,7 @@ class UtilityBlinkPlatformWithSandboxSupportImpl
blink::WebSandboxSupport* GetSandboxSupport() override;
private:
-#if defined(OS_POSIX) && !defined(OS_ANDROID)
+#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_HAIKU)
class SandboxSupport;
std::unique_ptr<SandboxSupport> sandbox_support_;
#endif
diff --git a/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h b/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h
index 49d20756f..54c90cdf1 100644
--- a/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h
+++ b/src/3rdparty/chromium/gpu/ipc/common/surface_handle.h
@@ -10,8 +10,8 @@
#include "build/build_config.h"
#if (defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_X11) || \
- defined(USE_OZONE)) && \
- !defined(OS_NACL) && !defined(OS_HAIKU)
+ defined(OS_HAIKU) || defined(USE_OZONE)) && \
+ !defined(OS_NACL)
#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_HAIKU)
+ defined(OS_FUCHSIA)
using SurfaceHandle = int32_t;
constexpr SurfaceHandle kNullSurfaceHandle = 0;
#else
diff --git a/src/3rdparty/chromium/gpu/ipc/service/BUILD.gn b/src/3rdparty/chromium/gpu/ipc/service/BUILD.gn
index fffd33d7f..3a4d324aa 100644
--- a/src/3rdparty/chromium/gpu/ipc/service/BUILD.gn
+++ b/src/3rdparty/chromium/gpu/ipc/service/BUILD.gn
@@ -137,6 +137,9 @@ component("service") {
if (is_fuchsia) {
sources += [ "image_transport_surface_fuchsia.cc" ]
}
+ if (is_haiku) {
+ sources += [ "image_transport_surface_haiku.cc" ]
+ }
if (enable_vulkan) {
deps += [ "//gpu/vulkan/init" ]
}
diff --git a/src/3rdparty/chromium/gpu/ipc/service/image_transport_surface_haiku.cc b/src/3rdparty/chromium/gpu/ipc/service/image_transport_surface_haiku.cc
new file mode 100644
index 000000000..f2feaed4c
--- /dev/null
+++ b/src/3rdparty/chromium/gpu/ipc/service/image_transport_surface_haiku.cc
@@ -0,0 +1,27 @@
+// 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 "gpu/ipc/service/image_transport_surface.h"
+
+#include "base/logging.h"
+#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_surface_stub.h"
+#include "ui/gl/init/gl_factory.h"
+
+namespace gpu {
+
+// static
+scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(
+ base::WeakPtr<ImageTransportSurfaceDelegate> delegate,
+ SurfaceHandle surface_handle,
+ gl::GLSurfaceFormat format) {
+ if (gl::GetGLImplementation() == gl::kGLImplementationMockGL ||
+ gl::GetGLImplementation() == gl::kGLImplementationStubGL) {
+ return new gl::GLSurfaceStub;
+ }
+
+ return gl::init::CreateViewGLSurface(surface_handle);
+}
+
+} // namespace gpu
diff --git a/src/3rdparty/chromium/ui/base/BUILD.gn b/src/3rdparty/chromium/ui/base/BUILD.gn
index 100dbcfd2..129f4ec0a 100644
--- a/src/3rdparty/chromium/ui/base/BUILD.gn
+++ b/src/3rdparty/chromium/ui/base/BUILD.gn
@@ -549,6 +549,14 @@ component("base") {
]
}
+ if (is_haiku) {
+ sources += [
+ "cursor/cursor_haiku.cc",
+ "cursor/cursor_loader_haiku.cc",
+ "cursor/cursor_loader_haiku.h",
+ ]
+ }
+
libs = []
if (is_win) {
sources += [
diff --git a/src/3rdparty/chromium/ui/base/cursor/cursor_haiku.cc b/src/3rdparty/chromium/ui/base/cursor/cursor_haiku.cc
new file mode 100644
index 000000000..2d4aafea8
--- /dev/null
+++ b/src/3rdparty/chromium/ui/base/cursor/cursor_haiku.cc
@@ -0,0 +1,17 @@
+// Copyright (c) 2012 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/base/cursor/cursor.h"
+
+namespace ui {
+
+void Cursor::RefCustomCursor() {
+ // TODO(winguru):
+}
+
+void Cursor::UnrefCustomCursor() {
+ // TODO(winguru):
+}
+
+} // namespace ui
diff --git a/src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.cc b/src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.cc
new file mode 100644
index 000000000..49c7b4d52
--- /dev/null
+++ b/src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.cc
@@ -0,0 +1,159 @@
+// Copyright (c) 2012 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/base/cursor/cursor_loader_haiku.h"
+
+#include "base/lazy_instance.h"
+#include "ui/base/cursor/cursor.h"
+#include "ui/resources/grit/ui_unscaled_resources.h"
+
+namespace ui {
+
+namespace {
+
+/*const wchar_t* GetCursorId(gfx::NativeCursor native_cursor) {
+ switch (native_cursor.native_type()) {
+ case CursorType::kNull:
+ return IDC_ARROW;
+ case CursorType::kPointer:
+ return IDC_ARROW;
+ case CursorType::kCross:
+ return IDC_CROSS;
+ case CursorType::kHand:
+ return IDC_HAND;
+ case CursorType::kIBeam:
+ return IDC_IBEAM;
+ case CursorType::kWait:
+ return IDC_WAIT;
+ case CursorType::kHelp:
+ return IDC_HELP;
+ case CursorType::kEastResize:
+ return IDC_SIZEWE;
+ case CursorType::kNorthResize:
+ return IDC_SIZENS;
+ case CursorType::kNorthEastResize:
+ return IDC_SIZENESW;
+ case CursorType::kNorthWestResize:
+ return IDC_SIZENWSE;
+ case CursorType::kSouthResize:
+ return IDC_SIZENS;
+ case CursorType::kSouthEastResize:
+ return IDC_SIZENWSE;
+ case CursorType::kSouthWestResize:
+ return IDC_SIZENESW;
+ case CursorType::kWestResize:
+ return IDC_SIZEWE;
+ case CursorType::kNorthSouthResize:
+ return IDC_SIZENS;
+ case CursorType::kEastWestResize:
+ return IDC_SIZEWE;
+ case CursorType::kNorthEastSouthWestResize:
+ return IDC_SIZENESW;
+ case CursorType::kNorthWestSouthEastResize:
+ return IDC_SIZENWSE;
+ case CursorType::kMove:
+ return IDC_SIZEALL;
+ case CursorType::kProgress:
+ return IDC_APPSTARTING;
+ case CursorType::kNoDrop:
+ return IDC_NO;
+ case CursorType::kNotAllowed:
+ return IDC_NO;
+ case CursorType::kColumnResize:
+ return MAKEINTRESOURCE(IDC_COLRESIZE);
+ case CursorType::kRowResize:
+ return MAKEINTRESOURCE(IDC_ROWRESIZE);
+ case CursorType::kMiddlePanning:
+ return MAKEINTRESOURCE(IDC_PAN_MIDDLE);
+ case CursorType::kEastPanning:
+ return MAKEINTRESOURCE(IDC_PAN_EAST);
+ case CursorType::kNorthPanning:
+ return MAKEINTRESOURCE(IDC_PAN_NORTH);
+ case CursorType::kNorthEastPanning:
+ return MAKEINTRESOURCE(IDC_PAN_NORTH_EAST);
+ case CursorType::kNorthWestPanning:
+ return MAKEINTRESOURCE(IDC_PAN_NORTH_WEST);
+ case CursorType::kSouthPanning:
+ return MAKEINTRESOURCE(IDC_PAN_SOUTH);
+ case CursorType::kSouthEastPanning:
+ return MAKEINTRESOURCE(IDC_PAN_SOUTH_EAST);
+ case CursorType::kSouthWestPanning:
+ return MAKEINTRESOURCE(IDC_PAN_SOUTH_WEST);
+ case CursorType::kWestPanning:
+ return MAKEINTRESOURCE(IDC_PAN_WEST);
+ case CursorType::kVerticalText:
+ return MAKEINTRESOURCE(IDC_VERTICALTEXT);
+ case CursorType::kCell:
+ return MAKEINTRESOURCE(IDC_CELL);
+ case CursorType::kZoomIn:
+ return MAKEINTRESOURCE(IDC_ZOOMIN);
+ case CursorType::kZoomOut:
+ return MAKEINTRESOURCE(IDC_ZOOMOUT);
+ case CursorType::kGrab:
+ return MAKEINTRESOURCE(IDC_HAND_GRAB);
+ case CursorType::kGrabbing:
+ return MAKEINTRESOURCE(IDC_HAND_GRABBING);
+ case CursorType::kCopy:
+ return MAKEINTRESOURCE(IDC_COPYCUR);
+ case CursorType::kAlias:
+ return MAKEINTRESOURCE(IDC_ALIAS);
+ case CursorType::kNone:
+ return MAKEINTRESOURCE(IDC_CURSOR_NONE);
+ case CursorType::kContextMenu:
+ case CursorType::kCustom:
+ NOTIMPLEMENTED();
+ return IDC_ARROW;
+ default:
+ NOTREACHED();
+ return IDC_ARROW;
+ }
+}*/
+
+} // namespace
+
+CursorLoader* CursorLoader::Create() {
+ return new CursorLoaderHaiku;
+}
+
+CursorLoaderHaiku::CursorLoaderHaiku() {
+}
+
+CursorLoaderHaiku::~CursorLoaderHaiku() {
+}
+
+void CursorLoaderHaiku::LoadImageCursor(CursorType id,
+ int resource_id,
+ const gfx::Point& hot) {
+ // NOTIMPLEMENTED();
+}
+
+void CursorLoaderHaiku::LoadAnimatedCursor(CursorType id,
+ int resource_id,
+ const gfx::Point& hot,
+ int frame_delay_ms) {
+ // NOTIMPLEMENTED();
+}
+
+void CursorLoaderHaiku::UnloadAll() {
+ // NOTIMPLEMENTED();
+}
+
+void CursorLoaderHaiku::SetPlatformCursor(gfx::NativeCursor* cursor) {
+ if (cursor->native_type() != CursorType::kCustom) {
+ if (cursor->platform()) {
+ cursor->SetPlatformCursor(cursor->platform());
+ } else {
+ /*const wchar_t* cursor_id = GetCursorId(*cursor);
+ PlatformCursor platform_cursor = LoadCursor(NULL, cursor_id);
+ if (!platform_cursor && !g_cursor_resource_module_name.Get().empty()) {
+ platform_cursor = LoadCursor(
+ GetModuleHandle(g_cursor_resource_module_name.Get().c_str()),
+ cursor_id);
+ }
+ cursor->SetPlatformCursor(platform_cursor);*/
+ }
+ }
+}
+
+} // namespace ui
diff --git a/src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.h b/src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.h
new file mode 100644
index 000000000..172c5f9ed
--- /dev/null
+++ b/src/3rdparty/chromium/ui/base/cursor/cursor_loader_haiku.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 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 UI_BASE_CURSOR_CURSOR_LOADER_HAIKU_H_
+#define UI_BASE_CURSOR_CURSOR_LOADER_HAIKU_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "ui/base/cursor/cursor_loader.h"
+
+namespace ui {
+
+class UI_BASE_EXPORT CursorLoaderHaiku : public CursorLoader {
+ public:
+ CursorLoaderHaiku();
+ ~CursorLoaderHaiku() override;
+
+ // Overridden from CursorLoader:
+ void LoadImageCursor(CursorType id,
+ int resource_id,
+ const gfx::Point& hot) override;
+ void LoadAnimatedCursor(CursorType id,
+ int resource_id,
+ const gfx::Point& hot,
+ int frame_delay_ms) override;
+ void UnloadAll() override;
+ void SetPlatformCursor(gfx::NativeCursor* cursor) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CursorLoaderHaiku);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_CURSOR_CURSOR_LOADER_HAIKU_H_
diff --git a/src/3rdparty/chromium/ui/events/BUILD.gn b/src/3rdparty/chromium/ui/events/BUILD.gn
index 33603b8d7..6061a551b 100644
--- a/src/3rdparty/chromium/ui/events/BUILD.gn
+++ b/src/3rdparty/chromium/ui/events/BUILD.gn
@@ -238,6 +238,10 @@ component("events") {
configs += [ "//build/config/linux:glib" ]
}
+ if (is_haiku) {
+ sources += [ "haiku/keyboard_hook_haiku.cc" ]
+ }
+
if (use_ozone) {
sources += [ "events_default.cc" ]
}
diff --git a/src/3rdparty/chromium/ui/events/haiku/keyboard_hook_haiku.cc b/src/3rdparty/chromium/ui/events/haiku/keyboard_hook_haiku.cc
new file mode 100644
index 000000000..1c6f57d68
--- /dev/null
+++ b/src/3rdparty/chromium/ui/events/haiku/keyboard_hook_haiku.cc
@@ -0,0 +1,29 @@
+// 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 "ui/events/keyboard_hook_base.h"
+
+#include <utility>
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "base/optional.h"
+#include "base/threading/thread_checker.h"
+#include "ui/events/event.h"
+#include "ui/events/event_utils.h"
+#include "ui/events/keycodes/dom/dom_code.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace ui {
+
+// static
+std::unique_ptr<KeyboardHook> KeyboardHook::Create(
+ base::Optional<base::flat_set<DomCode>> dom_codes,
+ gfx::AcceleratedWidget accelerated_widget,
+ KeyEventCallback callback) {
+ return nullptr;
+}
+
+} // namespace ui
diff --git a/src/3rdparty/chromium/ui/gl/gl_fence.cc b/src/3rdparty/chromium/ui/gl/gl_fence.cc
index 674cdd25c..6287224c4 100644
--- a/src/3rdparty/chromium/ui/gl/gl_fence.cc
+++ b/src/3rdparty/chromium/ui/gl/gl_fence.cc
@@ -18,7 +18,7 @@
#include "ui/gl/gl_fence_apple.h"
#endif
-#if defined(USE_EGL) && defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(USE_EGL) && defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_HAIKU)
#define USE_GL_FENCE_ANDROID_NATIVE_FENCE_SYNC
#include "ui/gl/gl_fence_android_native_fence_sync.h"
#include "ui/gl/gl_surface_egl.h"
diff --git a/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc b/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc
index 945e25497..74640b891 100644
--- a/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc
+++ b/src/3rdparty/chromium/ui/gl/init/gl_factory_haiku.cc
@@ -66,18 +66,18 @@ scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group,
}
}
-#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));
+ return InitializeGLSurface(new GLSurfaceOSMesa(
+ GLSurfaceFormat(GLSurfaceFormat::PIXEL_LAYOUT_BGRA),
+ gfx::Size(1, 1)));
case kGLImplementationDesktopGL:
- return InitializeGLSurface(new GLSurfaceGLXX11(window));
case kGLImplementationSwiftShaderGL:
case kGLImplementationEGLGLES2:
DCHECK(window != gfx::kNullAcceleratedWidget);
- return InitializeGLSurface(new NativeViewGLSurfaceEGLX11(window));
+ return InitializeGLSurface(new NativeViewGLSurfaceEGL(0, nullptr));
case kGLImplementationMockGL:
case kGLImplementationStubGL:
return new GLSurfaceStub;
@@ -96,8 +96,6 @@ scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
return InitializeGLSurfaceWithFormat(
new GLSurfaceOSMesa(format, size), format);
case kGLImplementationDesktopGL:
- return InitializeGLSurfaceWithFormat(
- new UnmappedNativeViewGLSurfaceGLX(size), format);
case kGLImplementationSwiftShaderGL:
case kGLImplementationEGLGLES2:
if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
@@ -115,7 +113,6 @@ scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
return nullptr;
}
}
-#endif
void SetDisabledExtensionsPlatform(const std::string& disabled_extensions) {
GLImplementation implementation = GetGLImplementation();
diff --git a/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc b/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc
index e828e5088..1d80ecf3d 100644
--- a/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc
+++ b/src/3rdparty/chromium/ui/gl/init/gl_initializer_haiku.cc
@@ -102,7 +102,6 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) {
} // namespace
-#if !defined(TOOLKIT_QT)
bool InitializeGLOneOffPlatform() {
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
@@ -128,7 +127,6 @@ bool InitializeGLOneOffPlatform() {
}
}
-#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
diff --git a/src/3rdparty/chromium/ui/snapshot/BUILD.gn b/src/3rdparty/chromium/ui/snapshot/BUILD.gn
index 9494e5d82..5ceaabcb0 100644
--- a/src/3rdparty/chromium/ui/snapshot/BUILD.gn
+++ b/src/3rdparty/chromium/ui/snapshot/BUILD.gn
@@ -70,13 +70,6 @@ jumbo_component("snapshot") {
"CoreGraphics.framework",
]
}
-
- if (is_haiku) {
- sources += [
- "snapshot_haiku.cc",
- "snapshot_haiku.h",
- ]
- }
}
jumbo_source_set("snapshot_win") {
diff --git a/src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc b/src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc
deleted file mode 100644
index 2c33ff8e0..000000000
--- a/src/3rdparty/chromium/ui/snapshot/snapshot_haiku.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 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/snapshot/snapshot.h"
-
-namespace ui {
-
-bool GrabWindowSnapshot(gfx::NativeWindow window,
- const gfx::Rect& snapshot_bounds,
- gfx::Image* image) {
- // Not supported in Aura. Callers should fall back to the async version.
- return false;
-}
-
-void GrabWindowSnapshotAsync(gfx::NativeWindow window,
- const gfx::Rect& source_rect,
- const GrabWindowSnapshotAsyncCallback& callback) {
- //GrabWindowSnapshotAsyncAura(window, source_rect, callback);
-}
-
-bool GrabViewSnapshot(gfx::NativeView view,
- const gfx::Rect& snapshot_bounds,
- gfx::Image* image) {
- return false;
-}
-
-void GrabViewSnapshotAsync(gfx::NativeView view,
- const gfx::Rect& source_rect,
- const GrabWindowSnapshotAsyncCallback& callback) {
- //GrabWindowSnapshotAsyncAura(view, source_rect, callback);
-}
-
-} // namespace ui
diff --git a/src/core/config/haiku.pri b/src/core/config/haiku.pri
index 35ce06555..8d92bd730 100644
--- a/src/core/config/haiku.pri
+++ b/src/core/config/haiku.pri
@@ -33,10 +33,9 @@ gn_args += \
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_headless=false \
# ozone_platform_external=true \
# ozone_platform=\"qt\"
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 9fe5985ce..19b998771 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -45,7 +45,7 @@
#include "ozone/gl_surface_egl_qt.h"
#include "ui/gl/gl_surface_egl.h"
-#if !defined(OS_MACOSX)
+#if !defined(OS_MACOSX) && !defined(OS_HAIKU)
#include "ui/gl/egl_util.h"
#include "ui/gl/init/gl_factory.h"
@@ -303,7 +303,7 @@ void* GLSurfacelessQtEGL::GetShareHandle()
}
} // namespace gl
-#endif // !defined(OS_MACOSX)
+#endif // !defined(OS_MACOSX) && !defined(OS_HAIKU)
namespace gl {
std::string DriverEGL::GetPlatformExtensions()
--
2.21.0
From 8ca59b45361bd01613e818ed1965a14ba166bc84 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <[email protected]>
Date: Sun, 7 Jul 2019 03:28:02 +0200
Subject: [PATCH 1/2] Fix some CHECKs
---
src/3rdparty/chromium/base/base_paths_haiku.cc | 14 ++++++++++++++
src/3rdparty/chromium/base/sys_info_haiku.cc | 8 ++++----
.../base/threading/platform_thread_posix.cc | 2 +-
.../blink/renderer/platform/wtf/stack_util.cc | 6 +++++-
4 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/3rdparty/chromium/base/base_paths_haiku.cc b/src/3rdparty/chromium/base/base_paths_haiku.cc
index ca8aa43bb..71c47e1bf 100644
--- a/src/3rdparty/chromium/base/base_paths_haiku.cc
+++ b/src/3rdparty/chromium/base/base_paths_haiku.cc
@@ -6,6 +6,8 @@
#include <stdlib.h>
+#include <private/app/AppMisc.h>
+
#include "base/base_paths_haiku.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
@@ -15,6 +17,18 @@
namespace base {
bool PathProviderHaiku(int key, FilePath* result) {
+ switch(key) {
+ case FILE_MODULE: // TODO: is this ok?
+ case FILE_EXE: {
+ char path[B_PATH_NAME_LENGTH];
+ if(BPrivate::get_app_path(path) != B_OK) {
+ NOTREACHED() << "Unable to find current process path.";
+ return false;
+ }
+ *result = FilePath(path);
+ return true;
+ }
+ }
return false;
}
diff --git a/src/3rdparty/chromium/base/sys_info_haiku.cc b/src/3rdparty/chromium/base/sys_info_haiku.cc
index e38fda171..2212a445c 100644
--- a/src/3rdparty/chromium/base/sys_info_haiku.cc
+++ b/src/3rdparty/chromium/base/sys_info_haiku.cc
@@ -14,14 +14,14 @@ namespace base {
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);
+ return static_cast<int64_t>(systemInfo.max_pages * B_PAGE_SIZE + 0.5f);
}
// static
int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
- // TODO(fuchsia): https://crbug.com/706592 This is not exposed.
- NOTREACHED();
- return 0;
+ system_info systemInfo;
+ get_system_info(&systemInfo);
+ return static_cast<int64_t>(systemInfo.used_pages * B_PAGE_SIZE + 0.5f);
}
// static
diff --git a/src/3rdparty/chromium/base/threading/platform_thread_posix.cc b/src/3rdparty/chromium/base/threading/platform_thread_posix.cc
index 802c40439..3fec7bfb1 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) || defined(OS_HAIKU)
+#if defined(OS_NACL)
NOTIMPLEMENTED();
#else
if (internal::SetCurrentThreadPriorityForPlatform(priority))
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 6f7451449..c325e46b8 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
@@ -206,7 +206,11 @@ size_t ThreadStackSize() {
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);
+ // From BeBook (thread_info):
+ // The two stack pointers are currently inverted such that
+ // stack_base is less than stack_end.
+ // (In a stack-grows-down world, the base should be greater than the end.)
+ CHECK_GT(stack_end, stack_start);
size_t thread_stack_size = static_cast<size_t>(stack_start - stack_end);
return thread_stack_size;
}
--
2.21.0
From 0e37c9767cf9474f3dfa6698fafb4639edd3e6cd Mon Sep 17 00:00:00 2001
From: Kacper Kasper <[email protected]>
Date: Sun, 7 Jul 2019 03:28:18 +0200
Subject: [PATCH 2/2] What is this for?
---
src/3rdparty/chromium/base/threading/thread_restrictions.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/3rdparty/chromium/base/threading/thread_restrictions.cc b/src/3rdparty/chromium/base/threading/thread_restrictions.cc
index 36c64b51b..0eb25f9d5 100644
--- a/src/3rdparty/chromium/base/threading/thread_restrictions.cc
+++ b/src/3rdparty/chromium/base/threading/thread_restrictions.cc
@@ -102,12 +102,12 @@ ScopedAllowBaseSyncPrimitivesForTesting::
namespace internal {
void AssertBaseSyncPrimitivesAllowed() {
- DCHECK(!g_base_sync_primitives_disallowed.Get().Get())
+ /*DCHECK(!g_base_sync_primitives_disallowed.Get().Get())
<< "Waiting on a //base sync primitive is not allowed on this thread to "
"prevent jank and deadlock. If waiting on a //base sync primitive is "
"unavoidable, do it within the scope of a "
"ScopedAllowBaseSyncPrimitives. If in a test, "
- "use ScopedAllowBaseSyncPrimitivesForTesting.";
+ "use ScopedAllowBaseSyncPrimitivesForTesting.";*/
}
void ResetThreadRestrictionsForTesting() {
--
2.21.0
From 6b3c539ff056845afca0dbc0a7d7e18987c2e73a Mon Sep 17 00:00:00 2001
From: Kacper Kasper <[email protected]>
Date: Sun, 7 Jul 2019 05:04:15 +0200
Subject: [PATCH] Add SoftwareOutputDevice for Haiku
---
.../chromium/components/viz/service/BUILD.gn | 7 +++
.../display_embedder/gpu_display_provider.cc | 6 +++
.../software_output_device_haiku.cc | 49 +++++++++++++++++++
.../software_output_device_haiku.h | 33 +++++++++++++
4 files changed, 95 insertions(+)
create mode 100644 src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.cc
create mode 100644 src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.h
diff --git a/src/3rdparty/chromium/components/viz/service/BUILD.gn b/src/3rdparty/chromium/components/viz/service/BUILD.gn
index 33fc82ac5..45f1d5843 100644
--- a/src/3rdparty/chromium/components/viz/service/BUILD.gn
+++ b/src/3rdparty/chromium/components/viz/service/BUILD.gn
@@ -289,6 +289,13 @@ viz_component("service") {
]
}
+ if (is_haiku) {
+ sources += [
+ "display_embedder/software_output_device_haiku.cc",
+ "display_embedder/software_output_device_haiku.h",
+ ]
+ }
+
if (enable_vulkan) {
deps += [ "//gpu/vulkan" ]
}
diff --git a/src/3rdparty/chromium/components/viz/service/display_embedder/gpu_display_provider.cc b/src/3rdparty/chromium/components/viz/service/display_embedder/gpu_display_provider.cc
index 2487d3486..cbc69306b 100644
--- a/src/3rdparty/chromium/components/viz/service/display_embedder/gpu_display_provider.cc
+++ b/src/3rdparty/chromium/components/viz/service/display_embedder/gpu_display_provider.cc
@@ -38,6 +38,10 @@
#include "components/viz/service/display_embedder/gl_output_surface_android.h"
#endif
+#if defined(OS_HAIKU)
+#include "components/viz/service/display_embedder/software_output_device_haiku.h"
+#endif
+
#if defined(OS_MACOSX)
#include "components/viz/service/display_embedder/gl_output_surface_mac.h"
#include "components/viz/service/display_embedder/software_output_device_mac.h"
@@ -240,6 +244,8 @@ GpuDisplayProvider::CreateSoftwareOutputDeviceForPlatform(
// Android does not do software compositing, so we can't get here.
NOTREACHED();
return nullptr;
+#elif defined(OS_HAIKU)
+ return std::make_unique<SoftwareOutputDeviceHaiku>(surface_handle);
#elif defined(USE_OZONE)
ui::SurfaceFactoryOzone* factory =
ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone();
diff --git a/src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.cc b/src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.cc
new file mode 100644
index 000000000..bc2106993
--- /dev/null
+++ b/src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.cc
@@ -0,0 +1,49 @@
+// Copyright 2014 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 "components/viz/service/display_embedder/software_output_device_haiku.h"
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "third_party/skia/include/core/SkImageInfo.h"
+#include "third_party/skia/include/core/SkImageEncoder.h"
+#include "third_party/skia/include/core/SkEncodedImageFormat.h"
+#include "third_party/skia/include/core/SkStream.h"
+
+namespace viz {
+
+SoftwareOutputDeviceHaiku::SoftwareOutputDeviceHaiku(gfx::AcceleratedWidget widget)
+ : widget_(widget) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+}
+
+SoftwareOutputDeviceHaiku::~SoftwareOutputDeviceHaiku() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+}
+
+void SoftwareOutputDeviceHaiku::EndPaint() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+
+ SoftwareOutputDevice::EndPaint();
+
+ if (!surface_)
+ return;
+
+ /*gfx::Rect rect = damage_rect_;
+ rect.Intersect(gfx::Rect(viewport_pixel_size_));
+ if (rect.IsEmpty())
+ return;*/
+
+ SkPixmap pixmap;
+ surface_->peekPixels(&pixmap);
+ // TODO: how to put these pixels on the screen?
+ // TODO: I suppose widget_ is QtWidget?
+ SkFILEWStream stream("/tmp/webenginescreen");
+ SkEncodeImage(&stream, pixmap, SkEncodedImageFormat::kPNG, 100);
+ // ^^^ it doesn't work anyway
+}
+
+} // namespace viz
diff --git a/src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.h b/src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.h
new file mode 100644
index 000000000..a56d6ffa1
--- /dev/null
+++ b/src/3rdparty/chromium/components/viz/service/display_embedder/software_output_device_haiku.h
@@ -0,0 +1,33 @@
+// Copyright 2014 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 COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_HAIKU_H_
+#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_HAIKU_H_
+
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "components/viz/service/display/software_output_device.h"
+#include "components/viz/service/viz_service_export.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace viz {
+
+class VIZ_SERVICE_EXPORT SoftwareOutputDeviceHaiku : public SoftwareOutputDevice {
+ public:
+ explicit SoftwareOutputDeviceHaiku(gfx::AcceleratedWidget widget);
+
+ ~SoftwareOutputDeviceHaiku() override;
+
+ void EndPaint() override;
+
+ private:
+ gfx::AcceleratedWidget widget_;
+ THREAD_CHECKER(thread_checker_);
+
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceHaiku);
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_HAIKU_H_
--
2.21.0
@threedeyes
Copy link

Sorry, but no. I adapt patch to QtWebEngine 5.15, but the render crashes a second after starting.

@konrad1977
Copy link

Looked like the video showed some promising progress, I still hope it would work one day. Anyhow good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment