Index: branches/2020Q3/www/chromium/Makefile =================================================================== --- branches/2020Q3/www/chromium/Makefile (revision 545445) +++ branches/2020Q3/www/chromium/Makefile (revision 545446) @@ -1,358 +1,358 @@ # Created by: Florent Thoumie # $FreeBSD$ PORTNAME= chromium -PORTVERSION= 84.0.4147.125 +PORTVERSION= 84.0.4147.135 CATEGORIES?= www java MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ LOCAL/cpm/chromium/:fonts DISTFILES= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER?= chromium@FreeBSD.org COMMENT?= Google web browser based on WebKit LICENSE= BSD3CLAUSE LGPL21 MPL11 LICENSE_COMB= multi BUILD_DEPENDS= bash:shells/bash \ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} \ .if !defined(GN_ONLY) BUILD_DEPENDS+= gperf:devel/gperf \ ffmpeg>=3.2.2,1:multimedia/ffmpeg \ flock:sysutils/flock \ node:www/node \ xcb-proto>0:x11/xcb-proto \ ${LOCALBASE}/bin/ar:devel/binutils \ ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat \ ${LOCALBASE}/share/usbids/usb.ids:misc/usbids \ ${PYTHON_PKGNAMEPREFIX}html5lib>0:www/py-html5lib@${PY_FLAVOR} .endif .if !defined(GN_ONLY) LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \ libatspi.so:accessibility/at-spi2-core \ libspeechd.so:accessibility/speech-dispatcher \ libsnappy.so:archivers/snappy \ libFLAC.so:audio/flac \ libopus.so:audio/opus \ libspeex.so:audio/speex \ libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ libicuuc.so:devel/icu \ libjsoncpp.so:devel/jsoncpp \ libpci.so:devel/libpci \ libnspr4.so:devel/nspr \ libre2.so:devel/re2 \ libcairo.so:graphics/cairo \ libdrm.so:graphics/libdrm \ libexif.so:graphics/libexif \ libpng.so:graphics/png \ libwebp.so:graphics/webp \ libavcodec.so:multimedia/ffmpeg \ libopenh264.so:multimedia/openh264 \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libharfbuzz-icu.so:print/harfbuzz-icu \ libgcrypt.so:security/libgcrypt \ libsecret-1.so:security/libsecret \ libnss3.so:security/nss \ libexpat.so:textproc/expat2 \ libfontconfig.so:x11-fonts/fontconfig RUN_DEPENDS= xdg-open:devel/xdg-utils \ noto-basic>0:x11-fonts/noto-basic BROKEN_FreeBSD_11_aarch64= components/safe_browsing_db/v4_rice.cc:120:18: use of overloaded operator '&' is ambiguous ONLY_FOR_ARCHS= aarch64 amd64 i386 .endif .if defined(GN_ONLY) USES= compiler:c++14-lang dos2unix localbase:ldflags ninja pkgconfig \ python:2.7,build shebangfix tar:xz .else USES= bison cpe desktop-file-utils dos2unix gl gnome jpeg localbase:ldflags \ ninja perl5 pkgconfig python:2.7,build shebangfix tar:xz xorg .endif MAKE_ARGS= -C out/${BUILDTYPE} BINARY_ALIAS= python=${PYTHON_CMD} DOS2UNIX_FILES= third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h .if !defined(GN_ONLY) CPE_VENDOR= google CPE_PRODUCT= chrome -USE_GL= gl +USE_GL= gbm gl USE_LDCONFIG= ${DATADIR} USE_PERL5= build USE_XORG= x11 xcb xcomposite xcursor xext xdamage xfixes xi \ xorgproto xrandr xrender xscrnsaver xtst USE_GNOME= atk dconf glib20 gtk30 libxml2 libxslt SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper buildtools/linux64/clang-format ALL_TARGET= chrome INSTALLS_ICONS= yes .endif EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang # TODO bz@ : install libwidevinecdm.so (see third_party/widevine/cdm/BUILD.gn) # # Run "./out/${BUILDTYPE}/gn args out/${BUILDTYPE} --list" for all variables. # Some parts don't have use_system_* flag, and can be turned on/off by using # replace_gn_files.py script, some parts just turned on/off for target host # OS "target_os == is_bsd", like libusb, libpci. GN_ARGS+= clang_use_chrome_plugins=false \ enable_hangout_services_extension=true \ enable_nacl=false \ enable_one_click_signin=true \ enable_remoting=false \ fieldtrial_testing_like_official_build=true \ is_clang=true \ toolkit_views=true \ treat_warnings_as_errors=false \ use_allocator="none" \ use_allocator_shim=false \ use_aura=true \ use_custom_libcxx=false \ use_gnome_keyring=false \ use_lld=true \ use_sysroot=false \ use_system_freetype=true \ use_system_harfbuzz=true \ use_system_libjpeg=true \ extra_cxxflags="${CXXFLAGS}" \ extra_ldflags="${LDFLAGS}" # TODO: investigate building with these options: # use_system_minigbm GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles # FreeBSD Chromium Api Key # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . # Note: these are for FreeBSD use ONLY. For your own distribution, # please get your own set of keys. GN_ARGS+= google_api_key="AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8" \ google_default_client_id="996322985003.apps.googleusercontent.com" \ google_default_client_secret="IR1za9-1VK0zZ0f_O8MVFicn" .if !defined(GN_ONLY) SUB_FILES= chromium-browser.desktop chrome pkg-message SUB_LIST+= COMMENT="${COMMENT}" OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS TEST CODECS_DESC= Compile and enable patented codecs like H.264 DRIVER_DESC= Install chromedriver OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO OPTIONS_DEFAULT= ALSA CODECS CUPS DRIVER KERBEROS OPTIONS_SUB= yes ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \ alsa-lib>=1.1.1_1:audio/alsa-lib ALSA_VARS= GN_ARGS+=use_alsa=true ALSA_VARS_OFF= GN_ARGS+=use_alsa=false CODECS_VARS= GN_ARGS+=ffmpeg_branding="Chrome" \ GN_ARGS+=proprietary_codecs=true CODECS_VARS_OFF= GN_ARGS+=ffmpeg_branding="Chromium" \ GN_ARGS+=proprietary_codecs=false CUPS_LIB_DEPENDS= libcups.so:print/cups CUPS_VARS= GN_ARGS+=use_cups=true CUPS_VARS_OFF= GN_ARGS+=use_cups=false DEBUG_VARS= BUILDTYPE=Debug \ GN_ARGS+=is_debug=true \ GN_ARGS+=is_component_build=false \ GN_ARGS+=symbol_level=1 \ GN_BOOTSTRAP_FLAGS+=--debug \ WANTSPACE="lots of free disk space (~ 13GB)" DEBUG_VARS_OFF= BUILDTYPE=Release \ GN_ARGS+=blink_symbol_level=0 \ GN_ARGS+=is_debug=false \ GN_ARGS+=is_official_build=true \ GN_ARGS+=symbol_level=0 \ WANTSPACE="a fair amount of free disk space (~ 6.5GB)" DRIVER_MAKE_ARGS= chromedriver KERBEROS_VARS= GN_ARGS+=use_kerberos=true KERBEROS_VARS_OFF= GN_ARGS+=use_kerberos=false PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false # With SNDIO=on we exclude audio_manager_linux from the build (see # media/audio/BUILD.gn) and use audio_manager_openbsd which does not # support falling back to ALSA or PulseAudio. SNDIO_PREVENTS= ALSA PULSEAUDIO SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_VARS= GN_ARGS+=use_sndio=true SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false .endif .include "Makefile.tests" TEST_ALL_TARGET= ${TEST_TARGETS} TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX} \ test_fonts${EXTRACT_SUFX}:fonts .include # swiftshader/lib/{libEGL.so,libGLESv2.so} is x86 only .if ${ARCH} == aarch64 PLIST_SUB+= NOT_AARCH64="@comment " .else PLIST_SUB+= NOT_AARCH64="" .endif # Make better javascript with java .if !defined(GN_ONLY) JAVA_BUILD= yes JAVA_VERSION= 1.8 USE_JAVA= yes .endif # Allow relocations against read-only segments (override lld default) LDFLAGS_i386= -Wl,-znotext # TODO: -isystem, would be just as ugly as this approach, but more reliably # build would fail without C_INCLUDE_PATH/CPLUS_INCLUDE_PATH env var set. MAKE_ENV+= C_INCLUDE_PATH=${LOCALBASE}/include \ CPLUS_INCLUDE_PATH=${LOCALBASE}/include .if !defined(GN_ONLY) pre-everything:: @${ECHO_MSG} @${ECHO_MSG} "To build Chromium, you should have around 2GB of memory" @${ECHO_MSG} "and ${WANTSPACE}." @${ECHO_MSG} post-extract-TEST-on: @${MKDIR} ${WRKSRC}/third_party/test_fonts/test_fonts @${MV} ${WRKDIR}/test_fonts ${WRKSRC}/third_party/test_fonts/ post-patch: @${REINPLACE_CMD} -e 's|@@PACKAGE@@|chromium|' \ -e 's|@@MENUNAME@@|Chromium Web Browser|' \ ${WRKSRC}/chrome/app/resources/manpage.1.in post-patch-SNDIO-on: @${MKDIR} ${WRKSRC}/media/audio/sndio ${WRKSRC}/media/audio/openbsd @${CP} ${FILESDIR}/sndio_output.* ${WRKSRC}/media/audio/sndio @${CP} ${FILESDIR}/sndio_input.* ${WRKSRC}/media/audio/sndio @${CP} ${FILESDIR}/audio_manager_openbsd.* ${WRKSRC}/media/audio/openbsd pre-configure: # We used to remove bundled libraries to be sure that chromium uses # system libraries and not shipped ones. # cd ${WRKSRC} && ${PYTHON_CMD} \ #./build/linux/unbundle/remove_bundled_libraries.py [list of preserved] cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \ ./build/linux/unbundle/replace_gn_files.py --system-libraries \ ffmpeg flac fontconfig freetype harfbuzz-ng libdrm libpng libwebp libxml libxslt openh264 opus snappy || ${FALSE} # We need the site package from xcbgen, which installs as python3.x (really: default version), while the chromium # build still needs to use python2.7. It works, because xcbgen can run with both versions, but we want to avoid # having the pre-compiled pyc files from 2.7 in the 3.x site packages # Remove this as soon as chromium uses python3.x as well @${MKDIR} ${WRKDIR}/site-packages/xcbgen ${CP} ${PYTHONBASE}/lib/python${PYTHON_DEFAULT}/site-packages/xcbgen/*.py \ ${WRKDIR}/site-packages/xcbgen .endif do-configure: # GN generator bootstrapping and generating ninja files cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} CC=${CC} CXX=${CXX} LD=${CXX} \ READELF=${READELF} AR=${AR} NM=${NM} ${PYTHON_CMD} \ ./tools/gn/bootstrap/bootstrap.py ${GN_BOOTSTRAP_FLAGS} .if !defined(GN_ONLY) cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./out/${BUILDTYPE}/gn \ gen --args='${GN_ARGS}' out/${BUILDTYPE} # Setup nodejs dependency @${MKDIR} ${WRKSRC}/third_party/node/freebsd/node-freebsd-x64/bin ${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/freebsd/node-freebsd-x64/bin/node # Setup java dependency on amd64 and i386 .if ${ARCH} == amd64 || ${ARCH} == i386 @${MKDIR} ${WRKDIR}/bin ${LN} -sf ${LOCALBASE}/openjdk8/bin/java ${WRKDIR}/bin/java .endif # Setup buildtools/freebsd @${MKDIR} ${WRKSRC}/buildtools/freebsd ${LN} -sf ${WRKSRC}/buildtools/linux64/clang-format ${WRKSRC}/buildtools/freebsd ${LN} -sf ${WRKSRC}/out/${BUILDTYPE}/gn ${WRKSRC}/buildtools/freebsd .endif do-test-TEST-on: .for t in ${TEST_TARGETS} cd ${WRKSRC}/out/${BUILDTYPE} && ${SETENV} LC_ALL=en_US.UTF-8 \ ./${t} --gtest_filter=-${EXCLUDE_${t}:ts:} || ${TRUE} .endfor .if !defined(GN_ONLY) do-install: @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_MAN} ${WRKSRC}/chrome/app/resources/manpage.1.in \ ${STAGEDIR}${MANPREFIX}/man/man1/chrome.1 ${CP} ${WRKSRC}/chrome/app/theme/chromium/product_logo_22_mono.png ${WRKSRC}/chrome/app/theme/chromium/product_logo_22.png .for s in 22 24 48 64 128 256 @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps ${INSTALL_DATA} ${WRKSRC}/chrome/app/theme/chromium/product_logo_${s}.png \ ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps/chrome.png .endfor ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.png ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.pak ${STAGEDIR}${DATADIR} .for d in protoc mksnapshot ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/${d} ${STAGEDIR}${DATADIR} .endfor .for d in icudtl.dat snapshot_blob.bin v8_context_snapshot.bin ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${d} ${STAGEDIR}${DATADIR} .endfor ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chrome \ ${STAGEDIR}${DATADIR} cd ${WRKSRC}/out/${BUILDTYPE} && \ ${COPYTREE_SHARE} "locales resources" ${STAGEDIR}${DATADIR} @${MKDIR} ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/chromium-browser.desktop \ ${STAGEDIR}${DESKTOPDIR} ${INSTALL_SCRIPT} ${WRKDIR}/chrome ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${WRKSRC}/chrome/tools/build/linux/chrome-wrapper \ ${STAGEDIR}${DATADIR} # ANGLE, EGL, Vk .for f in libEGL.so libGLESv2.so libVkICD_mock_icd.so ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR} .endfor .if ${BUILDTYPE} == Debug ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libVkLayer_khronos_validation.so ${STAGEDIR}${DATADIR} .endif # SwiftShader .if ${ARCH} != aarch64 @${MKDIR} ${STAGEDIR}${DATADIR}/swiftshader ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libvk_swiftshader.so ${STAGEDIR}${DATADIR} .for g in libEGL.so libGLESv2.so ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/swiftshader/${g} \ ${STAGEDIR}${DATADIR}/swiftshader .endfor .endif post-install-DEBUG-on: ${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/*.so \ ${STAGEDIR}${DATADIR} ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/character_data_generator \ ${STAGEDIR}${DATADIR} post-install-DRIVER-on: ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chromedriver \ ${STAGEDIR}${PREFIX}/bin .endif .include Index: branches/2020Q3/www/chromium/distinfo =================================================================== --- branches/2020Q3/www/chromium/distinfo (revision 545445) +++ branches/2020Q3/www/chromium/distinfo (revision 545446) @@ -1,7 +1,7 @@ -TIMESTAMP = 1597145794 -SHA256 (chromium-84.0.4147.125.tar.xz) = 98439626cf2d8d3d8f9486d08a99cbc1e4981b3f3427a072d5eaaf6ded4daff5 -SIZE (chromium-84.0.4147.125.tar.xz) = 846433536 -SHA256 (chromium-84.0.4147.125-testdata.tar.xz) = 7058620db4c8b20034fa3d9416046366921971c77e71c5d65697453d0ce7b3a5 -SIZE (chromium-84.0.4147.125-testdata.tar.xz) = 257151900 +TIMESTAMP = 1597780235 +SHA256 (chromium-84.0.4147.135.tar.xz) = dd41001596d0e17051ddcece3db6c0cdbe92fe23375d56fbcfba624a5f4996d8 +SIZE (chromium-84.0.4147.135.tar.xz) = 815136236 +SHA256 (chromium-84.0.4147.135-testdata.tar.xz) = cef39a11f7df8ff9655b9e70b9d774dc65cf6a15a726c048389eb87613d80ef2 +SIZE (chromium-84.0.4147.135-testdata.tar.xz) = 257190224 SHA256 (test_fonts.tar.xz) = cf9cbe3b7f1c4c42d426bddc65ec178d333ad7e205a36fe0a606a3c0c545ece1 SIZE (test_fonts.tar.xz) = 200040 Index: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_llvm-config.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_llvm-config.h (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_llvm-config.h (nonexistent) @@ -1,20 +0,0 @@ ---- third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/llvm-config.h.orig 2019-09-09 21:57:03 UTC -+++ third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/llvm-config.h -@@ -38,7 +38,7 @@ - #elif defined(__arm__) - #define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf" - #elif defined(__aarch64__) --#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu" -+#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-portbld-freebsd" - #elif defined(__mips__) - #define LLVM_DEFAULT_TARGET_TRIPLE "mipsel-linux-gnu" - #elif defined(__mips64) -@@ -63,7 +63,7 @@ - #elif defined(__arm__) - #define LLVM_HOST_TRIPLE "armv7-linux-gnueabihf" - #elif defined(__aarch64__) --#define LLVM_HOST_TRIPLE "aarch64-linux-gnu" -+#define LLVM_HOST_TRIPLE "aarch64-portbld-freebsd" - #elif defined(__mips__) - #define LLVM_HOST_TRIPLE "mipsel-linux-gnu" - #elif defined(__mips64) Property changes on: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_llvm-config.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_config.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_config.h (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_config.h (nonexistent) @@ -1,152 +0,0 @@ ---- third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h.orig 2020-03-16 18:42:15 UTC -+++ third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h -@@ -8,15 +8,15 @@ - #define BUG_REPORT_URL "https://bugs.llvm.org/" - - /* Define to 1 to enable backtraces, and to 0 otherwise. */ --#define ENABLE_BACKTRACES 0 -+#define ENABLE_BACKTRACES 1 - - /* Define to 1 to enable crash overrides, and to 0 otherwise. */ --#define ENABLE_CRASH_OVERRIDES 0 -+#define ENABLE_CRASH_OVERRIDES 1 - - /* Define to 1 if you have the `backtrace' function. */ --/* #undef HAVE_BACKTRACE */ -+#define HAVE_BACKTRACE 1 - --/* #undef BACKTRACE_HEADER */ -+#define BACKTRACE_HEADER - - /* Define to 1 if you have the header file. */ - /* #undef HAVE_CRASHREPORTERCLIENT_H */ -@@ -26,7 +26,7 @@ - - /* Define to 1 if you have the declaration of `arc4random', and to 0 if you - don't. */ --#define HAVE_DECL_ARC4RANDOM 0 -+#define HAVE_DECL_ARC4RANDOM 1 - - /* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you - don't. */ -@@ -50,7 +50,7 @@ - #define HAVE_DLOPEN 1 - - /* Define if dladdr() is available on this platform. */ --/* #undef HAVE_DLADDR */ -+#define HAVE_DLADDR 1 - - /* Define to 1 if you have the header file. */ - #define HAVE_ERRNO_H 1 -@@ -89,7 +89,7 @@ - #define HAVE_ISATTY 1 - - /* Define to 1 if you have the `edit' library (-ledit). */ --/* #undef HAVE_LIBEDIT */ -+#define HAVE_LIBEDIT 1 - - /* Define to 1 if you have the `pfm' library (-lpfm). */ - /* #undef HAVE_LIBPFM */ -@@ -107,25 +107,25 @@ - /* #undef HAVE_PTHREAD_SETNAME_NP */ - - /* Define to 1 if you have the `z' library (-lz). */ --/* #undef HAVE_LIBZ */ -+#define HAVE_LIBZ 1 - - /* Define to 1 if you have the header file. */ - #define HAVE_LINK_H 1 - - /* Define to 1 if you have the `lseek64' function. */ --#define HAVE_LSEEK64 1 -+/* #undef HAVE_LSEEK64 */ - - /* Define to 1 if you have the header file. */ - /* #undef HAVE_MACH_MACH_H */ - - /* Define to 1 if you have the `mallctl' function. */ --/* #undef HAVE_MALLCTL */ -+#define HAVE_MALLCTL 1 - - /* Define to 1 if you have the `mallinfo' function. */ --#define HAVE_MALLINFO 1 -+/* #undef HAVE_MALLINFO */ - - /* Define to 1 if you have the header file. */ --#define HAVE_MALLOC_H 1 -+/* #undef HAVE_MALLOC_H */ - - /* Define to 1 if you have the header file. */ - /* #undef HAVE_MALLOC_MALLOC_H */ -@@ -137,7 +137,7 @@ - #define HAVE_POSIX_FALLOCATE 1 - - /* Define to 1 if you have the `posix_spawn' function. */ --/* #undef HAVE_POSIX_SPAWN */ -+#define HAVE_POSIX_SPAWN 1 - - /* Define to 1 if you have the `pread' function. */ - #define HAVE_PREAD 1 -@@ -158,16 +158,16 @@ - #define HAVE_REALPATH 1 - - /* Define to 1 if you have the `sbrk' function. */ --#define HAVE_SBRK 1 -+/* #undef HAVE_SBRK */ - - /* Define to 1 if you have the `setenv' function. */ - #define HAVE_SETENV 1 - - /* Define to 1 if you have the `sched_getaffinity' function. */ --#define HAVE_SCHED_GETAFFINITY 1 -+/* #undef HAVE_SCHED_GETAFFINITY */ - - /* Define to 1 if you have the `CPU_COUNT' macro. */ --#define HAVE_CPU_COUNT 1 -+/* #undef HAVE_CPU_COUNT */ - - /* Define to 1 if you have the `setrlimit' function. */ - #define HAVE_SETRLIMIT 1 -@@ -209,13 +209,13 @@ - #define HAVE_SYS_TYPES_H 1 - - /* Define if the setupterm() function is supported this platform. */ --/* #undef HAVE_TERMINFO */ -+#define HAVE_TERMINFO 1 - - /* Define if the xar_open() function is supported this platform. */ - /* #undef HAVE_LIBXAR */ - - /* Define to 1 if you have the header file. */ --/* #undef HAVE_TERMIOS_H */ -+#define HAVE_TERMIOS_H 1 - - /* Define to 1 if you have the header file. */ - #define HAVE_UNISTD_H 1 -@@ -224,7 +224,7 @@ - /* #undef HAVE_VALGRIND_VALGRIND_H */ - - /* Define to 1 if you have the header file. */ --/* #undef HAVE_ZLIB_H */ -+#define HAVE_ZLIB_H 1 - - /* Have host's _alloca */ - /* #undef HAVE__ALLOCA */ -@@ -298,7 +298,7 @@ - #elif defined(__arm__) - #define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf" - #elif defined(__aarch64__) --#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu" -+#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-portbld-freebsd" - #elif defined(__mips__) - #define LLVM_DEFAULT_TARGET_TRIPLE "mipsel-linux-gnu" - #elif defined(__mips64) -@@ -310,7 +310,7 @@ - #endif - - /* Define if zlib compression is available */ --#define LLVM_ENABLE_ZLIB 0 -+#define LLVM_ENABLE_ZLIB 1 - - /* Define if overriding target triple is enabled */ - /* #undef LLVM_TARGET_TRIPLE_ENV */ Property changes on: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_config.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_thread.cpp =================================================================== --- branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_thread.cpp (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_thread.cpp (nonexistent) @@ -1,23 +0,0 @@ ---- third_party/swiftshader/third_party/marl/src/thread.cpp.orig 2020-05-13 18:42:01 UTC -+++ third_party/swiftshader/third_party/marl/src/thread.cpp -@@ -31,6 +31,11 @@ - #include - #include - #include -+#elif defined(__FreeBSD__) -+#include -+#include -+#include -+#include - #else - #include - #include -@@ -211,6 +216,8 @@ void Thread::setName(const char* fmt, ...) { - - #if defined(__APPLE__) - pthread_setname_np(name); -+#elif defined(__FreeBSD__) -+ pthread_set_name_np(pthread_self(), name); - #elif !defined(__Fuchsia__) - pthread_setname_np(pthread_self(), name); - #endif Property changes on: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_thread.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_memory.cpp =================================================================== --- branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_memory.cpp (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_memory.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- third_party/swiftshader/third_party/marl/src/memory.cpp.orig 2019-12-22 15:09:53 UTC -+++ third_party/swiftshader/third_party/marl/src/memory.cpp -@@ -19,7 +19,7 @@ - - #include - --#if defined(__linux__) || defined(__APPLE__) -+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) - #include - #include - namespace { Property changes on: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_marl_src_memory.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: branches/2020Q3/www/chromium/files/patch-chrome_browser_about__flags.cc =================================================================== --- branches/2020Q3/www/chromium/files/patch-chrome_browser_about__flags.cc (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-chrome_browser_about__flags.cc (revision 545446) @@ -1,183 +1,183 @@ ---- chrome/browser/about_flags.cc.orig 2020-07-07 21:58:13 UTC +--- chrome/browser/about_flags.cc.orig 2020-08-18 18:40:04 UTC +++ chrome/browser/about_flags.cc @@ -179,7 +179,7 @@ #include "ui/gl/gl_switches.h" #include "ui/native_theme/native_theme_features.h" -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_BSD) #include "base/allocator/buildflags.h" #endif @@ -879,7 +879,7 @@ const FeatureEntry::Choice kMemlogSamplingRateChoices[ heap_profiling::kMemlogSamplingRate5MB}, }; -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD) const FeatureEntry::FeatureParam kOmniboxDocumentProviderServerScoring[] = { {"DocumentUseServerScore", "true"}, {"DocumentUseClientScore", "false"}, @@ -1044,7 +1044,7 @@ const FeatureEntry::FeatureVariation kOmniboxRichAutoc nullptr, }}; -#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) +#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD) const FeatureEntry::FeatureParam kOmniboxOnFocusSuggestionsParamSERP[] = { {"ZeroSuggestVariant:6:*", "RemoteSendUrl"}, @@ -2485,13 +2485,13 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kCloudPrintXpsDescription, kOsWin, SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)}, #endif // OS_WIN -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) {"enable-webgl2-compute-context", flag_descriptions::kWebGL2ComputeContextName, flag_descriptions::kWebGL2ComputeContextDescription, kOsWin | kOsLinux | kOsCrOS, SINGLE_VALUE_TYPE(switches::kEnableWebGL2ComputeContext)}, -#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) {"enable-webgl-draft-extensions", flag_descriptions::kWebglDraftExtensionsName, flag_descriptions::kWebglDraftExtensionsDescription, kOsAll, @@ -2614,13 +2614,13 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kTerminalSystemAppSplitsDescription, kOsCrOS, FEATURE_VALUE_TYPE(features::kTerminalSystemAppSplits)}, #endif // OS_CHROMEOS -#if defined(OS_CHROMEOS) || defined(OS_LINUX) +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) #if BUILDFLAG(USE_TCMALLOC) {"dynamic-tcmalloc-tuning", flag_descriptions::kDynamicTcmallocName, flag_descriptions::kDynamicTcmallocDescription, kOsCrOS | kOsLinux, FEATURE_VALUE_TYPE(performance_manager::features::kDynamicTcmallocTuning)}, #endif // BUILDFLAG(USE_TCMALLOC) -#endif // OS_CHROMEOS || OS_LINUX +#endif // OS_CHROMEOS || OS_LINUX || defined(OS_BSD) #if defined(OS_ANDROID) {"enable-credit-card-assist", flag_descriptions::kCreditCardAssistName, flag_descriptions::kCreditCardAssistDescription, kOsAndroid, @@ -2675,7 +2675,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kEnableOfflinePreviewsDescription, kOsAndroid, FEATURE_VALUE_TYPE(previews::features::kOfflinePreviews)}, #endif // OS_ANDROID -#if defined(OS_CHROMEOS) || defined(OS_LINUX) +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) {"enable-save-data", flag_descriptions::kEnableSaveDataName, flag_descriptions::kEnableSaveDataDescription, kOsCrOS | kOsLinux, SINGLE_VALUE_TYPE( @@ -2685,7 +2685,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kEnableNavigationPredictorDescription, kOsCrOS | kOsLinux, FEATURE_VALUE_TYPE(blink::features::kNavigationPredictor)}, -#endif // OS_CHROMEOS || OS_LINUX +#endif // OS_CHROMEOS || OS_LINUX || OS_BSD {"enable-preconnect-to-search", flag_descriptions::kEnablePreconnectToSearchName, flag_descriptions::kEnablePreconnectToSearchDescription, kOsAll, -@@ -3399,7 +3399,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3403,7 +3403,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE( omnibox::kHistoryQuickProviderAllowMidwordContinuations)}, -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD) {"omnibox-experimental-keyword-mode", flag_descriptions::kOmniboxExperimentalKeywordModeName, flag_descriptions::kOmniboxExperimentalKeywordModeDescription, kOsDesktop, -@@ -3454,7 +3454,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3458,7 +3458,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kRichAutocompletion, kOmniboxRichAutocompletionVariations, "OmniboxBundledExperimentV1")}, -#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) +#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD) {"enable-speculative-service-worker-start-on-query-input", flag_descriptions::kSpeculativeServiceWorkerStartOnQueryInputName, -@@ -3670,13 +3670,13 @@ const FeatureEntry kFeatureEntries[] = { +@@ -3674,13 +3674,13 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kClickToOpenPDFDescription, kOsAll, FEATURE_VALUE_TYPE(features::kClickToOpenPDFPlaceholder)}, -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) {"direct-manipulation-stylus", flag_descriptions::kDirectManipulationStylusName, flag_descriptions::kDirectManipulationStylusDescription, kOsWin | kOsMac | kOsLinux, FEATURE_VALUE_TYPE(features::kDirectManipulationStylus)}, -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) #if !defined(OS_ANDROID) {"ntp-confirm-suggestion-removals", -@@ -4361,7 +4361,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4365,7 +4365,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(kClickToCallUI)}, #endif // BUILDFLAG(ENABLE_CLICK_TO_CALL) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) {"remote-copy-receiver", flag_descriptions::kRemoteCopyReceiverName, flag_descriptions::kRemoteCopyReceiverDescription, kOsDesktop, -@@ -4378,7 +4378,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4382,7 +4382,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kRemoteCopyProgressNotificationName, flag_descriptions::kRemoteCopyProgressNotificationDescription, kOsDesktop, FEATURE_VALUE_TYPE(kRemoteCopyProgressNotification)}, -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || // defined(OS_CHROMEOS) {"shared-clipboard-ui", flag_descriptions::kSharedClipboardUIName, -@@ -4404,7 +4404,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4408,7 +4408,7 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE( send_tab_to_self::kSendTabToSelfOmniboxSendingAnimation)}, -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) {"sharing-peer-connection-receiver", flag_descriptions::kSharingPeerConnectionReceiverName, -@@ -4415,7 +4415,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4419,7 +4419,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kSharingPeerConnectionSenderName, flag_descriptions::kSharingPeerConnectionSenderDescription, kOsDesktop, FEATURE_VALUE_TYPE(kSharingPeerConnectionSender)}, -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) // defined(OS_CHROMEOS) {"sharing-prefer-vapid", flag_descriptions::kSharingPreferVapidName, -@@ -4490,13 +4490,13 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4494,13 +4494,13 @@ const FeatureEntry kFeatureEntries[] = { FEATURE_VALUE_TYPE(printing::features::kEnableCustomMacPaperSizes)}, #endif -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) {"enable-reopen-tab-in-product-help", flag_descriptions::kReopenTabInProductHelpName, flag_descriptions::kReopenTabInProductHelpDescription, kOsDesktop, FEATURE_VALUE_TYPE(feature_engagement::kIPHReopenTabFeature)}, -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || // defined(OS_CHROMEOS) {"enable-audio-focus-enforcement", -@@ -4937,7 +4937,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4941,7 +4941,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kEnableSyncUSSNigoriDescription, kOsAll, FEATURE_VALUE_TYPE(switches::kSyncUSSNigori)}, -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) {"global-media-controls", flag_descriptions::kGlobalMediaControlsName, flag_descriptions::kGlobalMediaControlsDescription, kOsWin | kOsMac | kOsLinux, -@@ -4954,7 +4954,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -4958,7 +4958,7 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kGlobalMediaControlsPictureInPictureDescription, kOsWin | kOsMac | kOsLinux | kOsCrOS, FEATURE_VALUE_TYPE(media::kGlobalMediaControlsPictureInPicture)}, -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) #if BUILDFLAG(ENABLE_SPELLCHECK) && defined(OS_WIN) {"win-use-native-spellchecker", Index: branches/2020Q3/www/chromium/files/patch-chrome_browser_flag__descriptions.cc =================================================================== --- branches/2020Q3/www/chromium/files/patch-chrome_browser_flag__descriptions.cc (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-chrome_browser_flag__descriptions.cc (revision 545446) @@ -1,65 +1,65 @@ ---- chrome/browser/flag_descriptions.cc.orig 2020-07-07 21:58:13 UTC +--- chrome/browser/flag_descriptions.cc.orig 2020-08-18 18:40:05 UTC +++ chrome/browser/flag_descriptions.cc -@@ -3923,7 +3923,7 @@ const char kZeroCopyVideoCaptureDescription[] = +@@ -3929,7 +3929,7 @@ const char kZeroCopyVideoCaptureDescription[] = #endif // defined(OS_CHROMEOS) -#if defined(OS_CHROMEOS) || defined(OS_LINUX) +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) #if BUILDFLAG(USE_TCMALLOC) const char kDynamicTcmallocName[] = "Dynamic Tcmalloc Tuning"; -@@ -3932,7 +3932,7 @@ const char kDynamicTcmallocDescription[] = +@@ -3938,7 +3938,7 @@ const char kDynamicTcmallocDescription[] = "utilization."; #endif // BUILDFLAG(USE_TCMALLOC) -#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX) +#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) // All views-based platforms -------------------------------------------------- -@@ -3962,13 +3962,13 @@ const char kReopenTabInProductHelpDescription[] = +@@ -3968,13 +3968,13 @@ const char kReopenTabInProductHelpDescription[] = // Random platform combinations ----------------------------------------------- -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) const char kWebGL2ComputeContextName[] = "WebGL 2.0 Compute"; const char kWebGL2ComputeContextDescription[] = "Enable the use of WebGL 2.0 Compute API."; -#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) #if BUILDFLAG(ENABLE_CLICK_TO_CALL) -@@ -3980,7 +3980,7 @@ const char kClickToCallUIDescription[] = +@@ -3986,7 +3986,7 @@ const char kClickToCallUIDescription[] = #endif // BUILDFLAG(ENABLE_CLICK_TO_CALL) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) const char kEnableMediaFeedsName[] = "Enables Media Feeds"; -@@ -4012,16 +4012,16 @@ const char kRemoteCopyProgressNotificationDescription[ +@@ -4018,16 +4018,16 @@ const char kRemoteCopyProgressNotificationDescription[ "Enables progress notifications to be shown for the remote copy feature " "when receiving a message."; -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || // defined(OS_CHROMEOS) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) const char kDirectManipulationStylusName[] = "Direct Manipulation Stylus"; const char kDirectManipulationStylusDescription[] = "If enabled, Chrome will scroll web pages on stylus drag."; -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) Index: branches/2020Q3/www/chromium/files/patch-chrome_browser_flag__descriptions.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-chrome_browser_flag__descriptions.h (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-chrome_browser_flag__descriptions.h (revision 545446) @@ -1,74 +1,74 @@ ---- chrome/browser/flag_descriptions.h.orig 2020-07-07 21:58:13 UTC +--- chrome/browser/flag_descriptions.h.orig 2020-08-18 18:40:05 UTC +++ chrome/browser/flag_descriptions.h @@ -19,9 +19,9 @@ #include "ppapi/buildflags/buildflags.h" #include "printing/buildflags/buildflags.h" -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_BSD) #include "base/allocator/buildflags.h" -#endif // defined(OS_LINUX) +#endif // defined(OS_LINUX) || defined(OS_BSD) // This file declares strings used in chrome://flags. These messages are not // translated, because instead of end-users they target Chromium developers and -@@ -2303,14 +2303,14 @@ extern const char kZeroStateFilesDescription[]; +@@ -2306,14 +2306,14 @@ extern const char kZeroStateFilesDescription[]; #endif // #if defined(OS_CHROMEOS) -#if defined(OS_CHROMEOS) || defined(OS_LINUX) +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) #if BUILDFLAG(USE_TCMALLOC) extern const char kDynamicTcmallocName[]; extern const char kDynamicTcmallocDescription[]; #endif // BUILDFLAG(USE_TCMALLOC) -#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX) +#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD) // All views-based platforms -------------------------------------------------- -@@ -2332,12 +2332,12 @@ extern const char kReopenTabInProductHelpDescription[] +@@ -2335,12 +2335,12 @@ extern const char kReopenTabInProductHelpDescription[] // Random platform combinations ----------------------------------------------- -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) extern const char kWebGL2ComputeContextName[]; extern const char kWebGL2ComputeContextDescription[]; -#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) +#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) #if BUILDFLAG(ENABLE_CLICK_TO_CALL) -@@ -2346,7 +2346,7 @@ extern const char kClickToCallUIDescription[]; +@@ -2349,7 +2349,7 @@ extern const char kClickToCallUIDescription[]; #endif // BUILDFLAG(ENABLE_CLICK_TO_CALL) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) extern const char kEnableMediaFeedsName[]; -@@ -2364,15 +2364,15 @@ extern const char kRemoteCopyPersistentNotificationDes +@@ -2367,15 +2367,15 @@ extern const char kRemoteCopyPersistentNotificationDes extern const char kRemoteCopyProgressNotificationName[]; extern const char kRemoteCopyProgressNotificationDescription[]; -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) // defined(OS_CHROMEOS) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) extern const char kDirectManipulationStylusName[]; extern const char kDirectManipulationStylusDescription[]; -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) Index: branches/2020Q3/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc =================================================================== --- branches/2020Q3/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-components_feature__engagement_public_feature__list.cc (revision 545446) @@ -1,20 +1,20 @@ ---- components/feature_engagement/public/feature_list.cc.orig 2020-07-07 21:58:15 UTC +--- components/feature_engagement/public/feature_list.cc.orig 2020-08-18 18:40:09 UTC +++ components/feature_engagement/public/feature_list.cc -@@ -60,7 +60,7 @@ const base::Feature* const kAllFeatures[] = { +@@ -63,7 +63,7 @@ const base::Feature* const kAllFeatures[] = { &kIPHBadgedReadingListFeature, &kIPHBadgedTranslateManualTriggerFeature, #endif // defined(OS_IOS) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) &kIPHFocusModeFeature, &kIPHGlobalMediaControlsFeature, -@@ -71,7 +71,7 @@ const base::Feature* const kAllFeatures[] = { +@@ -74,7 +74,7 @@ const base::Feature* const kAllFeatures[] = { &kIPHIncognitoWindowFeature, &kIPHNewTabFeature, #endif // BUILDFLAG(ENABLE_LEGACY_DESKTOP_IN_PRODUCT_HELP) -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || // defined(OS_CHROMEOS) }; } // namespace Index: branches/2020Q3/www/chromium/files/patch-components_feature__engagement_public_feature__list.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-components_feature__engagement_public_feature__list.h (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-components_feature__engagement_public_feature__list.h (revision 545446) @@ -1,38 +1,38 @@ ---- components/feature_engagement/public/feature_list.h.orig 2020-07-07 21:58:15 UTC +--- components/feature_engagement/public/feature_list.h.orig 2020-08-18 18:40:09 UTC +++ components/feature_engagement/public/feature_list.h -@@ -113,7 +113,7 @@ DEFINE_VARIATION_PARAM(kIPHBadgedTranslateManualTrigge +@@ -119,7 +119,7 @@ DEFINE_VARIATION_PARAM(kIPHBadgedTranslateManualTrigge "IPH_BadgedTranslateManualTrigger"); #endif // defined(OS_IOS) -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) DEFINE_VARIATION_PARAM(kIPHFocusModeFeature, "IPH_FocusMode"); DEFINE_VARIATION_PARAM(kIPHGlobalMediaControls, "IPH_GlobalMediaControls"); -@@ -124,7 +124,7 @@ DEFINE_VARIATION_PARAM(kIPHBookmarkFeature, "IPH_Bookm +@@ -130,7 +130,7 @@ DEFINE_VARIATION_PARAM(kIPHBookmarkFeature, "IPH_Bookm DEFINE_VARIATION_PARAM(kIPHIncognitoWindowFeature, "IPH_IncognitoWindow"); DEFINE_VARIATION_PARAM(kIPHNewTabFeature, "IPH_NewTab"); #endif // BUILDFLAG(ENABLE_LEGACY_DESKTOP_IN_PRODUCT_HELP) -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || // defined(OS_CHROMEOS) } // namespace -@@ -176,7 +176,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation +@@ -185,7 +185,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation VARIATION_ENTRY(kIPHNewIncognitoTabTipFeature), VARIATION_ENTRY(kIPHBadgedReadingListFeature), VARIATION_ENTRY(kIPHBadgedTranslateManualTriggerFeature), -#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ defined(OS_CHROMEOS) VARIATION_ENTRY(kIPHFocusModeFeature), VARIATION_ENTRY(kIPHGlobalMediaControls), -@@ -187,7 +187,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation +@@ -196,7 +196,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation VARIATION_ENTRY(kIPHIncognitoWindowFeature), VARIATION_ENTRY(kIPHNewTabFeature), #endif // BUILDFLAG(ENABLE_LEGACY_DESKTOP_IN_PRODUCT_HELP) -#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || // defined(OS_CHROMEOS) }; Index: branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__connection__freebsd.cc =================================================================== --- branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__connection__freebsd.cc (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__connection__freebsd.cc (revision 545446) @@ -1,243 +1,243 @@ ---- services/device/hid/hid_connection_freebsd.cc.orig 2020-07-18 19:40:14.410523000 -0700 -+++ services/device/hid/hid_connection_freebsd.cc 2020-07-21 19:49:59.569331000 -0700 +--- services/device/hid/hid_connection_freebsd.cc.orig 2020-08-18 20:44:53 UTC ++++ services/device/hid/hid_connection_freebsd.cc @@ -0,0 +1,240 @@ +// Copyright (c) 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 "services/device/hid/hid_connection_freebsd.h" + +#include +#include + +#include "base/bind.h" +#include "base/files/file_descriptor_watcher_posix.h" +#include "base/location.h" +#include "base/numerics/safe_math.h" +#include "base/posix/eintr_wrapper.h" +#include "base/single_thread_task_runner.h" +#include "base/strings/stringprintf.h" +#include "base/task/post_task.h" +#include "base/threading/scoped_blocking_call.h" +#include "base/threading/thread_restrictions.h" +#include "base/threading/thread_task_runner_handle.h" +#include "components/device_event_log/device_event_log.h" +#include "services/device/hid/hid_service.h" + +namespace device { + +class HidConnectionFreeBSD::BlockingTaskRunnerHelper { + public: + BlockingTaskRunnerHelper(base::ScopedFD fd, + scoped_refptr device_info, + base::WeakPtr connection) + : fd_(std::move(fd)), + connection_(connection), + origin_task_runner_(base::ThreadTaskRunnerHandle::Get()) { + DETACH_FROM_SEQUENCE(sequence_checker_); + // Report buffers must always have room for the report ID. + report_buffer_size_ = device_info->max_input_report_size() + 1; + has_report_id_ = device_info->has_report_id(); + } + + ~BlockingTaskRunnerHelper() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } + + // Starts the FileDescriptorWatcher that reads input events from the device. + // Must be called on a thread that has a base::MessageLoopForIO. + void Start() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + base::internal::AssertBlockingAllowed(); + + file_watcher_ = base::FileDescriptorWatcher::WatchReadable( + fd_.get(), base::Bind(&BlockingTaskRunnerHelper::OnFileCanReadWithoutBlocking, + base::Unretained(this))); + } + + void Write(scoped_refptr buffer, + WriteCallback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + + auto data = buffer->front(); + size_t size = buffer->size(); + // if report id is 0, it shouldn't be included + if (data[0] == 0) { + data++; + size--; + } + + ssize_t result = HANDLE_EINTR(write(fd_.get(), data, size)); + if (result < 0) { + HID_PLOG(EVENT) << "Write failed"; + origin_task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(callback), false)); + } else { + if (static_cast(result) != size) + HID_LOG(EVENT) << "Incomplete HID write: " << result << " != " << size; + origin_task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(callback), true)); + } + } + + void GetFeatureReport(uint8_t report_id, + scoped_refptr buffer, + ReadCallback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + struct usb_gen_descriptor ugd; + ugd.ugd_report_type = UHID_FEATURE_REPORT; + ugd.ugd_data = buffer->front(); + ugd.ugd_maxlen = buffer->size(); + int result = HANDLE_EINTR( + ioctl(fd_.get(), USB_GET_REPORT, &ugd)); + if (result < 0) { + HID_PLOG(EVENT) << "Failed to get feature report"; + origin_task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false, nullptr, 0)); + } else if (result == 0) { + HID_LOG(EVENT) << "Get feature result too short."; + origin_task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false, nullptr, 0)); + } else { + origin_task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), true, buffer, result)); + } + } + + void SendFeatureReport(scoped_refptr buffer, + WriteCallback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + struct usb_gen_descriptor ugd; + ugd.ugd_report_type = UHID_FEATURE_REPORT; + ugd.ugd_data = buffer->front(); + ugd.ugd_maxlen = buffer->size(); + // FreeBSD does not require report id if it's not used + if (buffer->front()[0] == 0) { + ugd.ugd_data = buffer->front() + 1; + ugd.ugd_maxlen = buffer->size() - 1; + } else { + ugd.ugd_data = buffer->front(); + ugd.ugd_maxlen = buffer->size(); + } + int result = HANDLE_EINTR( + ioctl(fd_.get(), USB_SET_REPORT, &ugd)); + if (result < 0) { + HID_PLOG(EVENT) << "Failed to send feature report"; + origin_task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false)); + } else { + origin_task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), true)); + } + } + + private: + void OnFileCanReadWithoutBlocking() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + scoped_refptr buffer(new base::RefCountedBytes(report_buffer_size_)); + unsigned char* data = buffer->front(); + size_t length = report_buffer_size_; + if (!has_report_id_) { + // FreeBSD will not prefix the buffer with a report ID if report IDs are not + // used by the device. Prefix the buffer with 0. + *data++ = 0; + length--; + } + + ssize_t bytes_read = HANDLE_EINTR(read(fd_.get(), data, length)); + if (bytes_read < 0) { + if (errno != EAGAIN) { + HID_PLOG(EVENT) << "Read failed"; + // This assumes that the error is unrecoverable and disables reading + // from the device until it has been re-opened. + // TODO(reillyg): Investigate starting and stopping the file descriptor + // watcher in response to pending read requests so that per-request + // errors can be returned to the client. + file_watcher_.reset(); + } + return; + } + if (!has_report_id_) { + // Behave as if the byte prefixed above as the the report ID was read. + bytes_read++; + } + + origin_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&HidConnectionFreeBSD::ProcessInputReport, + connection_, buffer, bytes_read)); + } + + SEQUENCE_CHECKER(sequence_checker_); + base::ScopedFD fd_; + size_t report_buffer_size_; + bool has_report_id_; + base::WeakPtr connection_; + const scoped_refptr origin_task_runner_; + std::unique_ptr file_watcher_; + + DISALLOW_COPY_AND_ASSIGN(BlockingTaskRunnerHelper); +}; + +HidConnectionFreeBSD::HidConnectionFreeBSD( + scoped_refptr device_info, + base::ScopedFD fd, + scoped_refptr blocking_task_runner) + : HidConnection(device_info), + helper_(nullptr, base::OnTaskRunnerDeleter(blocking_task_runner)), + blocking_task_runner_(std::move(blocking_task_runner)) { + helper_.reset(new BlockingTaskRunnerHelper(std::move(fd), device_info, + weak_factory_.GetWeakPtr())); + blocking_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&BlockingTaskRunnerHelper::Start, + base::Unretained(helper_.get()))); +} + +HidConnectionFreeBSD::~HidConnectionFreeBSD() {} + +void HidConnectionFreeBSD::PlatformClose() { + // By closing the device on the blocking task runner 1) the requirement that + // base::ScopedFD is destroyed on a thread where I/O is allowed is satisfied + // and 2) any tasks posted to this task runner that refer to this file will + // complete before it is closed. + blocking_task_runner_->DeleteSoon(FROM_HERE, helper_.release()); +} + +void HidConnectionFreeBSD::PlatformWrite(scoped_refptr buffer, + WriteCallback callback) { + + blocking_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&BlockingTaskRunnerHelper::Write, base::Unretained(helper_.get()), + buffer, std::move(callback))); +} + +void HidConnectionFreeBSD::PlatformGetFeatureReport(uint8_t report_id, + ReadCallback callback) { + // The first byte of the destination buffer is the report ID being requested + // and is overwritten by the feature report. + DCHECK_GT(device_info()->max_feature_report_size(), 0u); + scoped_refptr buffer( + new base::RefCountedBytes(device_info()->max_feature_report_size() + 1)); + if (report_id != 0) + buffer->data()[0] = report_id; + + blocking_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&BlockingTaskRunnerHelper::GetFeatureReport, + base::Unretained(helper_.get()), report_id, + buffer, std::move(callback))); +} + +void HidConnectionFreeBSD::PlatformSendFeatureReport( + scoped_refptr buffer, + WriteCallback callback) { + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + blocking_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&BlockingTaskRunnerHelper::SendFeatureReport, + base::Unretained(helper_.get()), buffer, std::move(callback))); +} + +} // namespace device Index: branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__connection__freebsd.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__connection__freebsd.h (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__connection__freebsd.h (revision 545446) @@ -1,68 +1,68 @@ ---- services/device/hid/hid_connection_freebsd.h.orig 2020-07-18 19:40:14.412550000 -0700 -+++ services/device/hid/hid_connection_freebsd.h 2020-07-21 19:15:28.613027000 -0700 +--- services/device/hid/hid_connection_freebsd.h.orig 2020-08-18 20:44:53 UTC ++++ services/device/hid/hid_connection_freebsd.h @@ -0,0 +1,65 @@ +// Copyright (c) 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 DEVICE_HID_HID_CONNECTION_FREEBSD_H_ +#define DEVICE_HID_HID_CONNECTION_FREEBSD_H_ + +#include +#include + +#include "base/files/scoped_file.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/memory/ref_counted_memory.h" +#include "base/sequenced_task_runner.h" +#include "services/device/hid/hid_connection.h" + +namespace base { +class SequencedTaskRunner; +} + +namespace net { +class IOBuffer; +} + +namespace device { + +class HidConnectionFreeBSD : public HidConnection { + public: + HidConnectionFreeBSD( + scoped_refptr device_info, + base::ScopedFD fd, + scoped_refptr blocking_task_runner); + + private: + friend class base::RefCountedThreadSafe; + class BlockingTaskRunnerHelper; + + ~HidConnectionFreeBSD() override; + + // HidConnection implementation. + void PlatformClose() override; + void PlatformWrite(scoped_refptr buffer, + WriteCallback callback) override; + void PlatformGetFeatureReport(uint8_t report_id, + ReadCallback callback) override; + void PlatformSendFeatureReport(scoped_refptr buffer, + WriteCallback callback) override; + + // |helper_| lives on the sequence to which |blocking_task_runner_| posts + // tasks so all calls must be posted there including this object's + // destruction. + std::unique_ptr helper_; + + const scoped_refptr blocking_task_runner_; + const scoped_refptr task_runner_; + + base::WeakPtrFactory weak_factory_{this}; + + DISALLOW_COPY_AND_ASSIGN(HidConnectionFreeBSD); +}; + +} // namespace device + +#endif // DEVICE_HID_HID_CONNECTION_FREEBSD_H_ Index: branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__service__freebsd.cc =================================================================== --- branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__service__freebsd.cc (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__service__freebsd.cc (revision 545446) @@ -1,385 +1,385 @@ ---- services/device/hid/hid_service_freebsd.cc.orig 2020-07-18 19:40:14.415772000 -0700 -+++ services/device/hid/hid_service_freebsd.cc 2020-07-21 20:00:55.322907000 -0700 +--- services/device/hid/hid_service_freebsd.cc.orig 2020-08-18 20:44:53 UTC ++++ services/device/hid/hid_service_freebsd.cc @@ -0,0 +1,382 @@ +// 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 "services/device/hid/hid_service_freebsd.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "base/bind.h" +#include "base/files/file_descriptor_watcher_posix.h" +#include "base/files/file_enumerator.h" +#include "base/files/file_util.h" +#include "base/files/file.h" +#include "base/location.h" +#include "base/logging.h" +#include "base/posix/eintr_wrapper.h" +#include "base/single_thread_task_runner.h" +#include "base/stl_util.h" +#include "base/strings/pattern.h" +#include "base/strings/stringprintf.h" +#include "base/strings/sys_string_conversions.h" +#include "base/strings/string_util.h" +#include "base/strings/string_split.h" +#include "base/task/post_task.h" +#include "base/threading/scoped_blocking_call.h" +#include "base/threading/thread_task_runner_handle.h" +#include "components/device_event_log/device_event_log.h" +#include "services/device/hid/hid_connection_freebsd.h" + +const int kMaxPermissionChecks = 5; + +namespace device { + +struct HidServiceFreeBSD::ConnectParams { + ConnectParams(scoped_refptr device_info, + ConnectCallback callback) + : device_info(std::move(device_info)), + callback(std::move(callback)), + task_runner(base::ThreadTaskRunnerHandle::Get()), + blocking_task_runner( + base::ThreadPool::CreateSequencedTaskRunner(kBlockingTaskTraits)) {} + ~ConnectParams() {} + + scoped_refptr device_info; + ConnectCallback callback; + scoped_refptr task_runner; + scoped_refptr blocking_task_runner; + base::ScopedFD fd; +}; + +class HidServiceFreeBSD::BlockingTaskRunnerHelper { + public: + BlockingTaskRunnerHelper(base::WeakPtr service) + : service_(std::move(service)), + task_runner_(base::ThreadTaskRunnerHandle::Get()) { + DETACH_FROM_SEQUENCE(sequence_checker_); + + timer_.reset(new base::RepeatingTimer()); + devd_buffer_ = new net::IOBufferWithSize(1024); + } + + ~BlockingTaskRunnerHelper() { + } + + void Start() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + const base::FilePath kDevRoot("/dev"); + const std::string kUHIDPattern("/dev/uhid*"); + + base::FileEnumerator enumerator(kDevRoot, false, base::FileEnumerator::FILES); + do { + const base::FilePath next_device_path(enumerator.Next()); + const std::string next_device = next_device_path.value(); + if (next_device.empty()) + break; + + if (base::MatchPattern(next_device, kUHIDPattern)) + OnDeviceAdded(next_device.substr(5)); + } while (true); + + SetupDevdMonitor(); + + task_runner_->PostTask( + FROM_HERE, + base::Bind(&HidServiceFreeBSD::FirstEnumerationComplete, service_)); + } + + bool HaveReadWritePermissions(std::string device_id) { + std::string device_node = "/dev/" + device_id; + base::internal::AssertBlockingAllowed(); + + base::FilePath device_path(device_node); + base::File device_file; + int flags = + base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE; + device_file.Initialize(device_path, flags); + if (!device_file.IsValid()) + return false; + + return true; + } + + void OnDeviceAdded(std::string device_id) { + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + std::string device_node = "/dev/" + device_id; + uint16_t vendor_id = 0xffff; + uint16_t product_id = 0xffff; + std::string product_name = ""; + std::string serial_number = ""; + + std::vector report_descriptor; + + base::internal::AssertBlockingAllowed(); + + base::FilePath device_path(device_node); + base::File device_file; + int flags = + base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE; + device_file.Initialize(device_path, flags); + if (!device_file.IsValid()) { + HID_LOG(ERROR) << "Failed to open '" << device_node + << "': " + << base::File::ErrorToString(device_file.error_details()); + return; + } + + base::ScopedFD fd; + fd.reset(device_file.TakePlatformFile()); + + struct usb_gen_descriptor ugd; + ugd.ugd_data = NULL; + ugd.ugd_maxlen = 0xffff; + int result = HANDLE_EINTR( + ioctl(fd.get(), USB_GET_REPORT_DESC, &ugd)); + + if (result < 0) { + HID_LOG(ERROR) << "Failed to get report descriptor size"; + return; + } + + report_descriptor.resize(ugd.ugd_actlen); + + ugd.ugd_data = report_descriptor.data(); + ugd.ugd_maxlen = ugd.ugd_actlen; + result = HANDLE_EINTR( + ioctl(fd.get(), USB_GET_REPORT_DESC, &ugd)); + + if (result < 0) { + HID_LOG(ERROR) << "Failed to get report descriptor"; + return; + } + + scoped_refptr device_info(new HidDeviceInfo( + device_id, + /*physical_device_id*/"", + vendor_id, + product_id, + product_name, + serial_number, + device::mojom::HidBusType::kHIDBusTypeUSB, + report_descriptor, + device_node)); + + task_runner_->PostTask(FROM_HERE, base::BindOnce(&HidServiceFreeBSD::AddDevice, + service_, device_info)); + } + + void OnDeviceRemoved(std::string device_id) { + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + task_runner_->PostTask( + FROM_HERE, base::Bind(&HidServiceFreeBSD::RemoveDevice, service_, + device_id)); + } + + private: + + void CheckPendingPermissionChange() { + base::internal::AssertBlockingAllowed(); + std::map::iterator it; + for (it = permissions_checks_attempts_.begin(); it != permissions_checks_attempts_.end();) { + std::string device_name = it->first; + bool keep = true; + if (HaveReadWritePermissions(device_name)) { + OnDeviceAdded(device_name); + keep = false; + } + else if (it->second-- <= 0) { + HID_LOG(ERROR) << "Still don't have write permissions to '" << device_name + << "' after " << kMaxPermissionChecks << " attempts"; + keep = false; + } + + if (keep) + ++it; + else + permissions_checks_attempts_.erase(it++); + } + + if (permissions_checks_attempts_.empty()) + timer_->Stop(); + } + + void SetupDevdMonitor() { + base::internal::AssertBlockingAllowed(); + + int devd_fd = socket(AF_UNIX, SOCK_SEQPACKET, 0); + if (devd_fd < 0) + return; + + struct sockaddr_un sa; + + sa.sun_family = AF_UNIX; + strlcpy(sa.sun_path, "/var/run/devd.seqpacket.pipe", sizeof(sa.sun_path)); + if (connect(devd_fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) { + close(devd_fd); + return; + } + + devd_fd_.reset(devd_fd); + file_watcher_ = base::FileDescriptorWatcher::WatchReadable( + devd_fd_.get(), base::Bind(&BlockingTaskRunnerHelper::OnDevdMessageCanBeRead, + base::Unretained(this))); + } + + void OnDevdMessageCanBeRead() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + ssize_t bytes_read = HANDLE_EINTR(recv(devd_fd_.get(), devd_buffer_->data(), + devd_buffer_->size() - 1, MSG_WAITALL)); + if (bytes_read < 0) { + if (errno != EAGAIN) { + HID_LOG(ERROR) << "Read failed"; + file_watcher_.reset(); + } + return; + } + + devd_buffer_->data()[bytes_read] = 0; + char *data = devd_buffer_->data(); + // It may take some time for devd to change permissions + // on /dev/uhidX node. So do not fail immediately if + // open fail. Retry each second for kMaxPermissionChecks + // times before giving up entirely + if (base::StartsWith(data, "+uhid", base::CompareCase::SENSITIVE)) { + std::vector parts = base::SplitString( + data, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + if (!parts.empty()) { + std::string device_name = parts[0].substr(1); // skip '+' + if (HaveReadWritePermissions(device_name)) + OnDeviceAdded(parts[0].substr(1)); + else { + // Do not re-add to checks + if (permissions_checks_attempts_.find(device_name) == permissions_checks_attempts_.end()) { + permissions_checks_attempts_.insert(std::pair(device_name, kMaxPermissionChecks)); + timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(1), + this, &BlockingTaskRunnerHelper::CheckPendingPermissionChange); + } + } + } + } + + if (base::StartsWith(data, "-uhid", base::CompareCase::SENSITIVE)) { + std::vector parts = base::SplitString( + data, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + if (!parts.empty()) { + std::string device_name = parts[0].substr(1); // skip '-' + auto it = permissions_checks_attempts_.find(device_name); + if (it != permissions_checks_attempts_.end()) { + permissions_checks_attempts_.erase(it); + if (permissions_checks_attempts_.empty()) + timer_->Stop(); + } + OnDeviceRemoved(parts[0].substr(1)); + } + } + } + + SEQUENCE_CHECKER(sequence_checker_); + + // This weak pointer is only valid when checked on this task runner. + base::WeakPtr service_; + scoped_refptr task_runner_; + std::unique_ptr file_watcher_; + std::unique_ptr timer_; + base::ScopedFD devd_fd_; + scoped_refptr devd_buffer_; + std::map permissions_checks_attempts_; + + DISALLOW_COPY_AND_ASSIGN(BlockingTaskRunnerHelper); +}; + +HidServiceFreeBSD::HidServiceFreeBSD() + : blocking_task_runner_( + base::ThreadPool::CreateSequencedTaskRunner(kBlockingTaskTraits)), + helper_(nullptr, base::OnTaskRunnerDeleter(blocking_task_runner_)) { + helper_.reset(new BlockingTaskRunnerHelper(weak_factory_.GetWeakPtr())); + blocking_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&BlockingTaskRunnerHelper::Start, base::Unretained(helper_.get()))); +} + +HidServiceFreeBSD::~HidServiceFreeBSD() { + blocking_task_runner_->DeleteSoon(FROM_HERE, helper_.release()); +} + +base::WeakPtr HidServiceFreeBSD::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +// static +void HidServiceFreeBSD::OpenOnBlockingThread( + std::unique_ptr params) { + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + scoped_refptr task_runner = params->task_runner; + + base::FilePath device_path(params->device_info->device_node()); + base::File device_file; + int flags = + base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE; + device_file.Initialize(device_path, flags); + if (!device_file.IsValid()) { + HID_LOG(EVENT) << "Failed to open '" << params->device_info->device_node() + << "': " + << base::File::ErrorToString(device_file.error_details()); + task_runner->PostTask(FROM_HERE, + base::BindOnce(std::move(params->callback), nullptr)); + return; + } + params->fd.reset(device_file.TakePlatformFile()); + task_runner->PostTask(FROM_HERE, base::BindOnce(&HidServiceFreeBSD::FinishOpen, + std::move(params))); +} + +void HidServiceFreeBSD::Connect(const std::string& device_guid, + ConnectCallback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + const auto& map_entry = devices().find(device_guid); + if (map_entry == devices().end()) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), nullptr)); + return; + } + + scoped_refptr device_info = map_entry->second; + + auto params = std::make_unique(device_info, std::move(callback)); + scoped_refptr blocking_task_runner = + params->blocking_task_runner; + + blocking_task_runner->PostTask( + FROM_HERE, base::BindOnce(&HidServiceFreeBSD::OpenOnBlockingThread, + std::move(params))); +} + +// static +void HidServiceFreeBSD::FinishOpen(std::unique_ptr params) { + DCHECK(params->fd.is_valid()); + + if (!base::SetNonBlocking(params->fd.get())) { + HID_PLOG(ERROR) << "Failed to set the non-blocking flag on the device fd"; + std::move(params->callback).Run(nullptr); + } + + std::move(params->callback).Run(base::MakeRefCounted( + std::move(params->device_info), + std::move(params->fd), + std::move(params->blocking_task_runner) + )); +} + +} // namespace device Index: branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__service__freebsd.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__service__freebsd.h (revision 545445) +++ branches/2020Q3/www/chromium/files/patch-services_device_hid_hid__service__freebsd.h (revision 545446) @@ -1,49 +1,49 @@ ---- services/device/hid/hid_service_freebsd.h.orig 2020-07-18 19:40:14.418200000 -0700 -+++ services/device/hid/hid_service_freebsd.h 2020-07-21 19:52:08.796704000 -0700 +--- services/device/hid/hid_service_freebsd.h.orig 2020-08-18 20:44:53 UTC ++++ services/device/hid/hid_service_freebsd.h @@ -0,0 +1,46 @@ +// 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 DEVICE_HID_HID_SERVICE_FREEBSD_H_ +#define DEVICE_HID_HID_SERVICE_FREEBSD_H_ + +#include + +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" +#include "base/timer/timer.h" +#include "services/device/hid/hid_service.h" +#include "net/base/io_buffer.h" + +namespace device { + +class HidServiceFreeBSD : public HidService { + public: + HidServiceFreeBSD(); + ~HidServiceFreeBSD() override; + + void Connect(const std::string& device_guid, + ConnectCallback connect) override; + base::WeakPtr GetWeakPtr() override; + + private: + struct ConnectParams; + class BlockingTaskRunnerHelper; + + static void OpenOnBlockingThread(std::unique_ptr params); + static void FinishOpen(std::unique_ptr params); + + const scoped_refptr blocking_task_runner_; + // |helper_| lives on the sequence |blocking_task_runner_| posts to and holds + // a weak reference back to the service that owns it. + std::unique_ptr helper_; + base::WeakPtrFactory weak_factory_{this}; + + DISALLOW_COPY_AND_ASSIGN(HidServiceFreeBSD); +}; + +} // namespace device + +#endif // DEVICE_HID_HID_SERVICE_FREEBSD_H_ Index: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h (nonexistent) +++ branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h (revision 545446) @@ -0,0 +1,151 @@ +--- third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h.orig 2020-08-18 18:42:46 UTC ++++ third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h +@@ -9,17 +9,21 @@ + + /* Define to 1 to enable backtraces, and to 0 otherwise. */ + /* #undef ENABLE_BACKTRACES */ ++#define ENABLE_BACKTRACES 1 + + /* Define to 1 to enable crash overrides, and to 0 otherwise. */ + /* #undef ENABLE_CRASH_OVERRIDES */ ++#define ENABLE_CRASH_OVERRIDES 1 + + /* Define to 1 to enable crash memory dumps, and to 0 otherwise. */ + #define LLVM_ENABLE_CRASH_DUMPS 0 + + /* Define to 1 if you have the `backtrace' function. */ + /* #undef HAVE_BACKTRACE */ ++#define HAVE_BACKTRACE 1 + + /* #undef BACKTRACE_HEADER */ ++#define BACKTRACE_HEADER + + /* Define to 1 if you have the header file. */ + /* #undef HAVE_CRASHREPORTERCLIENT_H */ +@@ -29,7 +33,7 @@ + + /* Define to 1 if you have the declaration of `arc4random', and to 0 if you + don't. */ +-#define HAVE_DECL_ARC4RANDOM 0 ++#define HAVE_DECL_ARC4RANDOM 1 + + /* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you + don't. */ +@@ -53,7 +57,7 @@ + #define HAVE_DLOPEN 1 + + /* Define if dladdr() is available on this platform. */ +-/* #undef HAVE_DLADDR */ ++#define HAVE_DLADDR 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_ERRNO_H 1 +@@ -92,7 +96,7 @@ + #define HAVE_ISATTY 1 + + /* Define to 1 if you have the `edit' library (-ledit). */ +-/* #undef HAVE_LIBEDIT */ ++#define HAVE_LIBEDIT 1 + + /* Define to 1 if you have the `pfm' library (-lpfm). */ + /* #undef HAVE_LIBPFM */ +@@ -111,21 +115,25 @@ + + /* Define to 1 if you have the `z' library (-lz). */ + /* #undef HAVE_LIBZ */ ++#define HAVE_LIBZ 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_LINK_H 1 + + /* Define to 1 if you have the `lseek64' function. */ +-#define HAVE_LSEEK64 1 ++/* #define HAVE_LSEEK64 1 */ ++/* #undef HAVE_LSEEK64 */ + + /* Define to 1 if you have the header file. */ + /* #undef HAVE_MACH_MACH_H */ + + /* Define to 1 if you have the `mallctl' function. */ + /* #undef HAVE_MALLCTL */ ++#define HAVE_MALLCTL 1 + + /* Define to 1 if you have the `mallinfo' function. */ +-#define HAVE_MALLINFO 1 ++/* #define HAVE_MALLINFO 1 */ ++/* #undef HAVE_MALLINFO */ + + /* Define to 1 if you have the header file. */ + /* #undef HAVE_MALLOC_MALLOC_H */ +@@ -137,7 +145,7 @@ + #define HAVE_POSIX_FALLOCATE 1 + + /* Define to 1 if you have the `posix_spawn' function. */ +-/* #undef HAVE_POSIX_SPAWN */ ++#define HAVE_POSIX_SPAWN 1 + + /* Define to 1 if you have the `pread' function. */ + #define HAVE_PREAD 1 +@@ -155,16 +163,16 @@ + #define HAVE_PTHREAD_RWLOCK_INIT 1 + + /* Define to 1 if you have the `sbrk' function. */ +-#define HAVE_SBRK 1 ++/* #undef HAVE_SBRK */ + + /* Define to 1 if you have the `setenv' function. */ + #define HAVE_SETENV 1 + + /* Define to 1 if you have the `sched_getaffinity' function. */ +-#define HAVE_SCHED_GETAFFINITY 1 ++/* #undef HAVE_SCHED_GETAFFINITY */ + + /* Define to 1 if you have the `CPU_COUNT' macro. */ +-#define HAVE_CPU_COUNT 1 ++/* #undef HAVE_CPU_COUNT */ + + /* Define to 1 if you have the `setrlimit' function. */ + #define HAVE_SETRLIMIT 1 +@@ -212,13 +220,13 @@ + #define HAVE_SYS_TYPES_H 1 + + /* Define if the setupterm() function is supported this platform. */ +-/* #undef HAVE_TERMINFO */ ++#define HAVE_TERMINFO 1 + + /* Define if the xar_open() function is supported this platform. */ + /* #undef HAVE_LIBXAR */ + + /* Define to 1 if you have the header file. */ +-/* #undef HAVE_TERMIOS_H */ ++#define HAVE_TERMIOS_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_UNISTD_H 1 +@@ -227,7 +235,7 @@ + /* #undef HAVE_VALGRIND_VALGRIND_H */ + + /* Define to 1 if you have the header file. */ +-/* #undef HAVE_ZLIB_H */ ++#define HAVE_ZLIB_H 1 + + /* Have host's _alloca */ + /* #undef HAVE__ALLOCA */ +@@ -301,7 +309,7 @@ + #elif defined(__arm__) + #define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf" + #elif defined(__aarch64__) +-#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu" ++#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-portbld-freebsd" + #elif defined(__mips__) + #define LLVM_DEFAULT_TARGET_TRIPLE "mipsel-linux-gnu" + #elif defined(__mips64) +@@ -313,7 +321,7 @@ + #endif + + /* Define if zlib compression is available */ +-#define LLVM_ENABLE_ZLIB 0 ++#define LLVM_ENABLE_ZLIB 1 + + /* Define if overriding target triple is enabled */ + /* #undef LLVM_TARGET_TRIPLE_ENV */ Property changes on: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_config.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_llvm-config.h =================================================================== --- branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_llvm-config.h (nonexistent) +++ branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_llvm-config.h (revision 545446) @@ -0,0 +1,20 @@ +--- third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/llvm-config.h.orig 2020-08-18 18:42:46 UTC ++++ third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/llvm-config.h +@@ -35,7 +35,7 @@ + #elif defined(__arm__) + #define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf" + #elif defined(__aarch64__) +-#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu" ++#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-portbld-freebsd" + #elif defined(__mips__) + #define LLVM_DEFAULT_TARGET_TRIPLE "mipsel-linux-gnu" + #elif defined(__mips64) +@@ -60,7 +60,7 @@ + #elif defined(__arm__) + #define LLVM_HOST_TRIPLE "armv7-linux-gnueabihf" + #elif defined(__aarch64__) +-#define LLVM_HOST_TRIPLE "aarch64-linux-gnu" ++#define LLVM_HOST_TRIPLE "aarch64-portbld-freebsd" + #elif defined(__mips__) + #define LLVM_HOST_TRIPLE "mipsel-linux-gnu" + #elif defined(__mips64) Property changes on: branches/2020Q3/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-10.0_configs_linux_include_llvm_Config_llvm-config.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: branches/2020Q3 =================================================================== --- branches/2020Q3 (revision 545445) +++ branches/2020Q3 (revision 545446) Property changes on: branches/2020Q3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r545266,545308