Index: head/www/chromium/Makefile =================================================================== --- head/www/chromium/Makefile +++ head/www/chromium/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= chromium -PORTVERSION= 52.0.2743.116 -PORTREVISION= 4 +PORTVERSION= 54.0.2840.100 CATEGORIES= www MASTER_SITES= http://commondatastorage.googleapis.com/chromium-browser-official/ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} # default, but needed to get distinfo correct if TEST is on @@ -14,9 +13,7 @@ LICENSE= BSD3CLAUSE LGPL21 MPL LICENSE_COMB= multi -BROKEN_FreeBSD_9=does not patch - -CFLAGS+= -isystem${LOCALBASE}/include -I${PREFIX}/include/atk-1.0 +BROKEN_FreeBSD_9=does not configure BUILD_DEPENDS= ${LOCALBASE}/bin/gperf:devel/gperf \ bash:shells/bash \ @@ -28,8 +25,7 @@ ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply \ ${PYTHON_PKGNAMEPREFIX}html5lib>0:www/py-html5lib -LIB_DEPENDS= libasound.so:audio/alsa-lib \ - libcairo.so:graphics/cairo \ +LIB_DEPENDS= libcairo.so:graphics/cairo \ libcups.so:print/cups \ libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ @@ -39,7 +35,6 @@ libfreetype.so:print/freetype2 \ libgnome-keyring.so:security/libgnome-keyring \ libharfbuzz.so:print/harfbuzz \ - libevent.so:devel/libevent2 \ libexif.so:graphics/libexif \ libfontconfig.so:x11-fonts/fontconfig \ libgcrypt.so:security/libgcrypt \ @@ -56,101 +51,60 @@ libwebp.so:graphics/webp \ libxml2.so:textproc/libxml2 -RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins \ - alsa-lib>=1.1.1_1:audio/alsa-lib \ - droid-fonts-ttf>0:x11-fonts/droid-fonts-ttf \ +RUN_DEPENDS= droid-fonts-ttf>0:x11-fonts/droid-fonts-ttf \ xdg-open:devel/xdg-utils ONLY_FOR_ARCHS= i386 amd64 -USES= bison cpe desktop-file-utils execinfo jpeg \ +USES= compiler bison cpe desktop-file-utils execinfo jpeg \ ninja perl5 pkgconfig python:2,build shebangfix tar:xz -# chromium requires a recent compiler (C++11 capable, but clang 3.4 is -# not able to build chromium. OTOH clang36 on FreeBSD 9.3 cannot build -# chromium as the libc++ includes are not up to the task. USES flags -# have to be set before bsd.ports.pre.mk and thereby cannot depend on -# bsd.ports.pre.mk's variables, so I'm using a hack here. -.if exists(/usr/lib/libc++.a) -USES+= compiler:c++14-lang -.else -USES+= compiler:c++11-lib -.endif CPE_VENDOR= google CPE_PRODUCT= chrome USE_PERL5= build USE_XORG= scrnsaverproto x11 xcomposite xcursor xext xdamage xfixes xi \ xproto xrandr xrender xscrnsaver xtst -USE_GNOME= atk glib20 gtk20 dconf libxslt +USE_GNOME= atk glib20 gtk20 dconf libxslt libxml2 MAKE_ARGS= -C out/${BUILDTYPE} SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper ALL_TARGET= chrome INSTALLS_ICONS= yes -#TODO bz@ : install libwidevinecdm.so (see -# third_party/widevine/cdm/widevine_cdm.gyp) -# See build/common.gypi for all the available variables. -GYP_DEFINES+= \ - clang_use_chrome_plugins=0 \ - linux_breakpad=0 \ - linux_use_heapchecker=0 \ - linux_strip_binary=1 \ - use_aura=1 \ - test_isolation_mode=noop \ - disable_nacl=1 \ - enable_extensions=1 \ - enable_one_click_signin=1 \ - enable_openmax=1 \ - enable_webrtc=1 \ - werror= \ - no_gc_sections=1 \ - OS=freebsd \ - os_ver=${OSVERSION} \ - prefix_dir=${LOCALBASE} \ - python_ver=${PYTHON_VER} \ - use_allocator=none \ - use_cups=1 \ - linux_link_gsettings=1 \ - linux_link_libpci=1 \ - linux_link_libspeechd=1 \ - libspeechd_h_prefix=speech-dispatcher/ \ - usb_ids_path=${LOCALBASE}/share/usbids/usb.ids \ - want_separate_host_toolset=0 \ - use_system_bzip2=1 \ - use_system_flac=1 \ - use_system_harfbuzz=1 \ - use_system_icu=1 \ - use_system_jsoncpp=1 \ - use_system_libevent=1 \ - use_system_libexif=1 \ - use_system_libjpeg=1 \ - use_system_libpng=1 \ - use_system_libusb=1 \ - use_system_libwebp=1 \ - use_system_libxml=1 \ - use_system_libxslt=1 \ - use_system_nspr=1 \ - use_system_protobuf=0 \ - use_system_re2=1 \ - use_system_snappy=1 \ - use_system_speex=1 \ - use_system_xdg_utils=1 \ - use_system_yasm=1 \ - v8_use_external_startup_data=0 -# allow removal of third_party/adobe -GYP_DEFINES+= flapper_version_h_file='${WRKSRC}/flapper_version.h' +# TODO bz@ : install libwidevinecdm.so (see third_party/widevine/cdm/BUILD.gn) +# +# Run "./out/${BUILDTYPE}/gn args out/${BUILDTYPE} --list" for all the 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_hevc_demuxing=true \ + enable_media_router=true \ + enable_nacl=false \ + enable_remoting=false \ + toolkit_views=true \ + use_allocator="none" \ + use_aura=true \ + use_experimental_allocator_shim=true \ + treat_warnings_as_errors=false \ + use_sysroot=false \ + use_system_libjpeg=true \ + use_system_sqlite=false # chrome has additional patches +# TODO: investigate building with these options: +# use_system_icu use_system_harfbuzz use_system_minigbm +GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild # 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. -GYP_DEFINES+= google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 \ - google_default_client_id=996322985003.apps.googleusercontent.com \ - google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn +GN_ARGS+= google_api_key="AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8" \ + google_default_client_id="996322985003.apps.googleusercontent.com" \ + google_default_client_secret="IR1za9-1VK0zZ0f_O8MVFicn" SUB_FILES= chromium-browser.desktop chrome SUB_LIST+= COMMENT="${COMMENT}" -OPTIONS_DEFINE= CODECS GCONF PULSEAUDIO TEST KERBEROS DEBUG DRIVER +OPTIONS_DEFINE= ALSA CODECS GCONF PULSEAUDIO TEST KERBEROS DEBUG DRIVER CODECS_DESC= Compile and enable patented codecs like H.264 DRIVER_DESC= Install chromedriver @@ -158,44 +112,39 @@ OPTIONS_SUB= yes GCONF_USE= GNOME=gconf2 +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 PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio DRIVER_MAKE_ARGS=chromedriver TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX} .include +.if ${PORT_OPTIONS:MALSA} +GN_ARGS+= use_alsa=true +.else +GN_ARGS+= use_alsa=false +.endif + .if ${PORT_OPTIONS:MCODECS} -GYP_DEFINES+= ffmpeg_branding=Chrome -GYP_DEFINES+= proprietary_codecs=1 +GN_ARGS+= ffmpeg_branding="Chrome" +GN_ARGS+= proprietary_codecs=true .else -GYP_DEFINES+= ffmpeg_branding=Chromium -GYP_DEFINES+= proprietary_codecs=0 +GN_ARGS+= ffmpeg_branding="Chromium" +GN_ARGS+= proprietary_codecs=false .endif .if ${PORT_OPTIONS:MGCONF} -GYP_DEFINES+= use_gconf=1 +GN_ARGS+= use_gconf=true .else -GYP_DEFINES+= use_gconf=0 +GN_ARGS+= use_gconf=false .endif .if ${PORT_OPTIONS:MPULSEAUDIO} -GYP_DEFINES+= use_pulseaudio=1 +GN_ARGS+= use_pulseaudio=true .else -GYP_DEFINES+= use_pulseaudio=0 -.endif - -.if empty(MACHINE_CPU:Msse2) -GYP_DEFINES+= disable_sse2=1 -.endif - -.if !exists(/usr/libdata/pkgconfig/libusb-1.0.pc) -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libusb-pc -.endif - -# pointed out by "Tomek" on freebsd-chromium@ -.if !exists(/usr/lib/libexecinfo.so) -CFLAGS+= -fno-omit-frame-pointer -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-fixup-ffmpeg +GN_ARGS+= use_pulseaudio=false .endif .if ${PORT_OPTIONS:MTEST} @@ -206,180 +155,80 @@ DEBUG_MAKE_ENV= V=1 .if ${PORT_OPTIONS:MDEBUG} BUILDTYPE= Debug +GN_ARGS+= is_debug=true +GN_BOOTSTRAP_FLAGS+= --debug +#GN_ARGS+= is_component_build = true .else BUILDTYPE= Release +.if ${ARCH} == amd64 +GN_ARGS+= use_lld=true # harder, better, faster, stronger +.endif +GN_ARGS+= is_debug=false +GN_ARGS+= symbol_level=0 +GN_ARGS+= remove_webcore_debug_symbols=true .endif -CONFIGURE_ENV+= CC="${CC}" \ - CXX="${CXX}" \ - GYP_GENERATORS=ninja \ - GYP_DEFINES="${GYP_DEFINES}" MAKE_ENV+= BUILDTYPE=${BUILDTYPE} \ GPERF="${LOCALBASE}/bin/gperf" .include .if ${CHOSEN_COMPILER_TYPE} == gcc -GYP_DEFINES+= gcc_version=${CXX:S/g++//} +GN_ARGS+= gcc_version=${CXX:S/g++//} EXTRA_PATCHES+= ${FILESDIR}/extra-patch-gcc -CFLAGS+= -fno-stack-protector # gcc 4.8 cannot find __stack_chk_fail_local .else -GYP_DEFINES+= clang=1 -CFLAGS+= -Wno-unknown-warning-option \ - -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 # work around base r261801 +BUILD_DEPENDS+= clang39:devel/llvm39 +CC= clang39 +CXX= clang++39 +# /usr/local/include unlike gcc isn't clang's default +MAKE_ENV+= C_INCLUDE_PATH=${LOCALBASE}/include \ + CPLUS_INCLUDE_PATH=${LOCALBASE}/include +GN_ARGS+= is_clang=true EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang -CONFIGURE_ENV+= AR=/usr/bin/ar .endif -.if ! ${PORT_OPTIONS:MKERBEROS} -GYP_DEFINES+= use_kerberos=0 +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1002000 +BUILD_DEPENDS+= ${LOCALBASE}/lib/c++/libstdc++.so:devel/libc++ +CXXFLAGS+= -stdlib=libc++ -isystem ${LOCALBASE}/include/c++/v1 .endif -# according to portlint the below is passed via bsd.port.mk, -# but 'make -V CONFIGURE_ENV' does not show it: -CONFIGURE_ENV+= CFLAGS="${CFLAGS}" \ - CPPFLAGS="${CPPFLAGS}" \ - CXXFLAGS="${CXXFLAGS}" \ - LDFLAGS="${LDFLAGS}" +.if ${OSVERSION} < 1100000 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-10 +.endif + +.if ! ${PORT_OPTIONS:MKERBEROS} +GN_ARGS+= use_kerberos=true +.endif pre-everything:: @${ECHO_MSG} - @${ECHO_MSG} "To build Chromium, you should have around 2 GB of memory" + @${ECHO_MSG} "To build Chromium, you should have around 2GB of memory," .if ${PORT_OPTIONS:MDEBUG} - @${ECHO_MSG} "and lots of free diskspace (~ 8.5GB)." + @${ECHO_MSG} "lots of free diskspace (~ 40GB)" + @${ECHO_MSG} "and no less then 16GB of memory for linking." .else @${ECHO_MSG} "and a fair amount of free diskspace (~ 3.7GB)." .endif @${ECHO_MSG} @${ECHO_MSG} "Make sure you have Python build with the SEM option ON" @${ECHO_MSG} "(default in python27-2.7.8 since r361735)" - -post-patch: - @${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|" \ - ${WRKSRC}/crypto/crypto.gyp \ - ${WRKSRC}/v8/src/v8.gyp \ - ${WRKSRC}/v8/gypfiles/toolchain.gypi - @${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|" \ - ${WRKSRC}/chrome/common/chrome_paths.cc \ - ${WRKSRC}/base/base.gyp + @${ECHO_MSG} pre-configure: - # phajdan-jr: list of things *not* to remove, so maybe the script - # should be called "keep_bundled_libraries.py" + # We used to remove bundled libraries to be sure that chromium uses + # system libraries and not shippen ones. + # cd ${WRKSRC} && ${PYTHON_CMD} \ + #./build/linux/unbundle/remove_bundled_libraries.py [list of preserved] cd ${WRKSRC} && ${PYTHON_CMD} \ - ./build/linux/unbundle/remove_bundled_libraries.py \ - 'base/third_party/dmg_fp' \ - 'base/third_party/dynamic_annotations' \ - 'base/third_party/icu' \ - 'base/third_party/nspr' \ - 'base/third_party/superfasthash' \ - 'base/third_party/symbolize' \ - 'base/third_party/valgrind' \ - 'base/third_party/xdg_mime' \ - 'base/third_party/xdg_user_dirs' \ - 'breakpad/src/third_party/curl' \ - 'chrome/third_party/mock4js' \ - 'chrome/third_party/mozilla_security_manager' \ - 'courgette/third_party' \ - 'net/third_party/mozilla_security_manager' \ - 'net/third_party/nss' \ - 'third_party/WebKit' \ - 'third_party/analytics' \ - 'third_party/angle' \ - 'third_party/angle/src/third_party' \ - 'third_party/blanketjs' \ - 'third_party/brotli' \ - 'third_party/boringssl' \ - 'third_party/cacheinvalidation' \ - 'third_party/catapult' \ - 'third_party/catapult/third_party/beautifulsoup4' \ - 'third_party/catapult/third_party/py_vulcanize' \ - 'third_party/catapult/third_party/py_vulcanize/py_vulcanize' \ - 'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin' \ - 'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin' \ - 'third_party/catapult/tracing' \ - 'third_party/catapult/tracing/third_party' \ - 'third_party/cld' \ - 'third_party/cros_system_api' \ - 'third_party/dom_distiller_js' \ - 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \ - 'third_party/ffmpeg' \ - 'third_party/gardiner_mod' \ - 'third_party/fips181' \ - 'third_party/flot' \ - 'third_party/google_input_tools' \ - 'third_party/google_input_tools/third_party/closure_library' \ - 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \ - 'third_party/hunspell' \ - 'third_party/iccjpeg' \ - 'third_party/icu/icu.isolate' \ - 'third_party/jinja2' \ - 'third_party/jstemplate' \ - 'third_party/khronos' \ - 'third_party/leveldatabase' \ - 'third_party/libaddressinput' \ - 'third_party/libjingle' \ - 'third_party/libphonenumber' \ - 'third_party/libsrtp' \ - 'third_party/libvpx' \ - 'third_party/libvpx/source/libvpx/third_party/x86inc' \ - 'third_party/libwebm' \ - 'third_party/libxml/chromium' \ - 'third_party/libXNVCtrl' \ - 'third_party/libyuv' \ - 'third_party/lss' \ - 'third_party/lzma_sdk' \ - 'third_party/markupsafe' \ - 'third_party/mesa' \ - 'third_party/modp_b64' \ - 'third_party/mt19937ar' \ - 'third_party/openh264' \ - 'third_party/openmax_dl' \ - 'third_party/opus' \ - 'third_party/ots' \ - 'third_party/pdfium' \ - 'third_party/pdfium/third_party' \ - 'third_party/ply' \ - 'third_party/polymer' \ - 'third_party/protobuf' \ - 'third_party/protobuf/third_party' \ - 'third_party/protobuf/third_party/six' \ - 'third_party/pywebsocket' \ - 'third_party/qcms' \ - 'third_party/qunit' \ - 'third_party/sfntly' \ - 'third_party/sinonjs' \ - 'third_party/skia' \ - 'third_party/smhasher' \ - 'third_party/sqlite' \ - 'third_party/tcmalloc' \ - 'third_party/tlslite' \ - 'third_party/usrsctp' \ - 'third_party/web-animations-js' \ - 'third_party/webdriver' \ - 'third_party/webrtc' \ - 'third_party/widevine' \ - 'third_party/woff2' \ - 'third_party/x86inc' \ - 'third_party/yasm' \ - 'third_party/zlib' \ - 'url/third_party/mozilla' \ - 'v8/src/third_party/valgrind' \ - 'v8/src/third_party/fdlibm' \ - --do-remove || ${FALSE} - cd ${WRKSRC} && ${PYTHON_CMD} \ - ./build/linux/unbundle/replace_gyp_files.py \ - ${GYP_DEFINES:C/^/-D/} || ${FALSE} - # allow removal of third_party/adobe - ${ECHO_CMD} > ${WRKSRC}/flapper_version.h - # missing file: file is in -testdata only, but configure stage - # will fail if it's not there. do not break TESTS build while - # allowing regular build without pulling in -testdata. - ${TOUCH} ${WRKSRC}/chrome/test/data/webui/i18n_process_css_test.html + ./build/linux/unbundle/replace_gn_files.py --system-libraries \ + flac harfbuzz-ng libwebp libxml libxslt snappy yasm || ${FALSE} do-configure: - cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \ - ./build/gyp_chromium chrome/chrome.gyp --depth . + # GN generator bootstrapping and generating ninja files + cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} ${PYTHON_CMD} \ + ./tools/gn/bootstrap/bootstrap.py ${GN_BOOTSTRAP_FLAGS} + cd ${WRKSRC} && ${SETENV} ./out/${BUILDTYPE}/gn \ + gen --args='${GN_ARGS}' out/${BUILDTYPE} test regression-test: build .for t in ${TEST_TARGETS} @@ -397,14 +246,17 @@ .endfor ${INSTALL_SCRIPT} ${WRKSRC}/chrome/tools/build/linux/chrome-wrapper \ ${STAGEDIR}${DATADIR} -.for p in chrome_100_percent content_resources keyboard_resources resources +.for p in chrome_100_percent chrome_200_percent keyboard_resources resources ${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${p}.pak \ ${STAGEDIR}${DATADIR} .endfor +.for d in icudtl.dat natives_blob.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 pseudo_locales resources" ${STAGEDIR}${DATADIR} + ${COPYTREE_SHARE} "locales resources" ${STAGEDIR}${DATADIR} @${MKDIR} ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/chromium-browser.desktop \ ${STAGEDIR}${DESKTOPDIR} Index: head/www/chromium/distinfo =================================================================== --- head/www/chromium/distinfo +++ head/www/chromium/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1470404034 -SHA256 (chromium-52.0.2743.116.tar.xz) = a194ae1edb041024b3d4b6ba438f32fefdb6f1ecb24a96c50248a486b237a101 -SIZE (chromium-52.0.2743.116.tar.xz) = 458156660 -SHA256 (chromium-52.0.2743.116-testdata.tar.xz) = d3d059e1215702d8665f02b47a10e14458f54f423c323a9fcc987e6e43767c0b -SIZE (chromium-52.0.2743.116-testdata.tar.xz) = 122423496 +TIMESTAMP = 1478859835 +SHA256 (chromium-54.0.2840.100.tar.xz) = e2e7f54a780c93ec2e933af09e1126837e6cf940b57213d39f36d58df10c89df +SIZE (chromium-54.0.2840.100.tar.xz) = 479762112 +SHA256 (chromium-54.0.2840.100-testdata.tar.xz) = 44319fea6de4dbb1f6d0bbeeec633b69b7064f53a54893df5b720935a6d27460 +SIZE (chromium-54.0.2840.100-testdata.tar.xz) = 123519620 Index: head/www/chromium/files/extra-patch-10 =================================================================== --- head/www/chromium/files/extra-patch-10 +++ head/www/chromium/files/extra-patch-10 @@ -0,0 +1,10 @@ +--- content/renderer/devtools/v8_sampling_profiler.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ content/renderer/devtools/v8_sampling_profiler.cc 2016-10-30 03:00:33.775227000 +0300 +@@ -22,6 +22,7 @@ + + #if defined(OS_POSIX) + #include ++#include + #define USE_SIGNALS + #endif + Index: head/www/chromium/files/extra-patch-clang =================================================================== --- head/www/chromium/files/extra-patch-clang +++ head/www/chromium/files/extra-patch-clang @@ -1,13 +1,14 @@ ---- base/strings/safe_sprintf_unittest.cc 2015-04-15 00:18:48.000000000 +0200 -+++ base/strings/safe_sprintf_unittest.cc 2015-04-18 22:08:45.000000000 +0200 -@@ -729,12 +729,14 @@ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wconversion-null" - #endif +--- base/strings/safe_sprintf_unittest.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/strings/safe_sprintf_unittest.cc 2016-10-25 21:42:28.951114000 +0300 +@@ -728,6 +728,7 @@ + } + + TEST(SafeSPrintfTest, EmitNULL) { +/* Avoid compiler error: http://pastebin.com/1edWUE84 - EXPECT_EQ(1, SafeSPrintf(buf, "%d", NULL)); - EXPECT_EQ("0", std::string(buf)); - EXPECT_EQ(3, SafeSPrintf(buf, "%p", NULL)); + char buf[40]; + #if defined(__GNUC__) + #pragma GCC diagnostic push +@@ -739,6 +740,7 @@ EXPECT_EQ("0x0", std::string(buf)); EXPECT_EQ(6, SafeSPrintf(buf, "%s", NULL)); EXPECT_EQ("", std::string(buf)); @@ -41,7 +42,7 @@ +++ base/tracked_objects_unittest.cc 2015-09-03 09:20:53.370191000 -0400 @@ -58,9 +58,9 @@ Births* birth = ThreadData::TallyABirthIfActive(location); - + if (ThreadData::status() == ThreadData::DEACTIVATED) - EXPECT_EQ(reinterpret_cast(NULL), birth); + EXPECT_EQ(static_cast(NULL), birth); @@ -49,7 +50,7 @@ - EXPECT_NE(reinterpret_cast(NULL), birth); + EXPECT_NE(static_cast(NULL), birth); } - + // Helper function to verify the most common test expectations. --- components/sync_sessions/synced_session_tracker.cc.orig 2016-01-21 13:04:41.772845558 +0100 +++ components/sync_sessions/synced_session_tracker.cc 2016-01-21 13:05:17.652842509 +0100 @@ -70,34 +71,34 @@ .Times(2) - .WillRepeatedly(Return(reinterpret_cast(NULL))); + .WillRepeatedly(Return(static_cast(NULL))); - + EXPECT_CALL(callback_, OnError(_)) .Times(2); --- third_party/hunspell/src/hunspell/affentry.hxx.orig 2015-07-21 18:46:37.322427000 -0400 +++ third_party/hunspell/src/hunspell/affentry.hxx 2015-07-21 18:48:02.034251000 -0400 @@ -27,7 +27,7 @@ - struct hentry * checkword(const char * word, int len, char in_compound, + struct hentry * checkword(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); - + - struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL); + struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = 0); - + char * check_morph(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); @@ -90,7 +90,7 @@ // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT); const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0); - + - struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL); + struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = 0); - + char * check_twosfx_morph(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); --- third_party/sfntly/src/cpp/src/sfntly/table/core/cmap_table.cc 2015-04-15 00:31:48.000000000 +0200 +++ third_party/sfntly/src/cpp/src/sfntly/table/core/cmap_table.cc 2015-04-18 22:05:41.000000000 +0200 @@ -439,7 +439,7 @@ } - + CMapTable::CMapFormat0::Builder::Builder(const CMapId& cmap_id) - : CMap::Builder(reinterpret_cast(NULL), + : CMap::Builder(static_cast(NULL), @@ -133,13 +134,13 @@ glyph_id_array_(glyph_id_array->begin(), glyph_id_array->end()) { @@ -966,7 +966,7 @@ } - + CMapTable::CMapFormat4::Builder::Builder(const CMapId& cmap_id) - : CMap::Builder(reinterpret_cast(NULL), + : CMap::Builder(static_cast(NULL), CMapFormat::kFormat4, cmap_id) { } - + --- third_party/webrtc/base/taskrunner.cc 2015-04-15 00:32:17.000000000 +0200 +++ third_party/webrtc/base/taskrunner.cc 2015-04-18 22:10:53.000000000 +0200 @@ -102,7 +102,7 @@ @@ -148,6 +149,6 @@ tasks_.end(), - reinterpret_cast(NULL)); + static_cast(NULL)); - + tasks_.erase(it, tasks_.end()); - + Index: head/www/chromium/files/extra-patch-fixup-ffmpeg =================================================================== --- head/www/chromium/files/extra-patch-fixup-ffmpeg +++ head/www/chromium/files/extra-patch-fixup-ffmpeg @@ -1,18 +0,0 @@ ---- third_party/ffmpeg/ffmpeg.gyp.orig 2014-10-27 20:27:40.000000000 +0100 -+++ third_party/ffmpeg/ffmpeg.gyp 2014-11-06 22:53:10.000000000 +0100 -@@ -213,6 +213,15 @@ - 'cflags!': [ - '-fno-omit-frame-pointer', - ], -+ # "Tomek" from freebsd-chromium@ figured this out, rene is -+ # puzzled why this is needed. Fixes runtime on FreeBSD < 10 -+ 'cflags_c': [ -+ '-fomit-frame-pointer', -+ ], -+ 'cflags_cc': [ -+ '-fomit-frame-pointer', -+ ], -+ # back to upstream code - 'debug_extra_cflags!': [ - '-fno-omit-frame-pointer', - ], Index: head/www/chromium/files/extra-patch-gcc =================================================================== --- head/www/chromium/files/extra-patch-gcc +++ head/www/chromium/files/extra-patch-gcc @@ -3,27 +3,27 @@ @@ -5,6 +5,7 @@ #ifndef MEDIA_FILTERS_FILE_DATA_SOURCE_H_ #define MEDIA_FILTERS_FILE_DATA_SOURCE_H_ - + +#include #include - + #include "base/files/file.h" --- content/public/common/child_process_sandbox_support_linux.h.orig 2013-10-11 19:30:28.000000000 +0200 +++ content/public/common/child_process_sandbox_support_linux.h 2013-10-16 15:29:00.000000000 +0200 @@ -7,6 +7,7 @@ - + #include #include +#include - + #include "content/common/content_export.h" - + --- third_party/ffmpeg/libavutil/cpu.c.orig 2013-11-16 01:26:14.000000000 +0100 +++ third_party/ffmpeg/libavutil/cpu.c 2013-11-19 00:24:53.000000000 +0100 @@ -24,6 +24,9 @@ #include "opt.h" #include "common.h" - + +/* TODO(rene) work around a compile error with GCC 4.6.4 on FreeBSD */ +#define __BSD_VISIBLE 1 + @@ -35,22 +35,22 @@ @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + +#include + #include "content/browser/browser_shutdown_profile_dumper.h" - + #include "base/base_switches.h" --- testing/perf/perf_test.cc 2014-03-03 12:59:30.000000000 -0500 +++ testing/perf/perf_test.cc.orig 2014-02-20 15:28:27.000000000 -0500 @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + +#include + #include "testing/perf/perf_test.h" - + -#include - #include "base/logging.h" @@ -59,7 +59,7 @@ --- ui/gfx/codec/jpeg_codec.cc.orig 2014-10-02 19:19:03.000000000 +0200 +++ ui/gfx/codec/jpeg_codec.cc 2014-10-05 22:38:28.000000000 +0200 @@ -13,6 +13,7 @@ - + extern "C" { #if defined(USE_SYSTEM_LIBJPEG) +#include @@ -70,77 +70,44 @@ +++ third_party/webrtc/common_audio/wav_file.h 2014-10-18 12:04:03.000000000 +0200 @@ -14,6 +14,7 @@ #ifdef __cplusplus - + #include +#include #include #include - + --- v8/src/base/platform/platform.h.orig 2015-01-27 03:22:59.000000000 +0100 +++ v8/src/base/platform/platform.h 2015-01-28 18:37:43.268781292 +0100 @@ -22,6 +22,7 @@ #define V8_BASE_PLATFORM_PLATFORM_H_ - + #include +#include #include #include - + --- v8/src/compiler/graph-visualizer.cc.orig 2015-04-28 22:29:10.000000000 +0200 +++ v8/src/compiler/graph-visualizer.cc 2015-05-02 21:01:32.086593000 +0200 @@ -5,6 +5,7 @@ #include "src/compiler/graph-visualizer.h" - + #include +#include #include - + #include "src/code-stubs.h" -@@ -25,7 +26,7 @@ - namespace compiler { - - --FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, -+std::FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, - const char* suffix, const char* mode) { - EmbeddedVector filename; - SmartArrayPointer function_name; --- third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c.orig 2015-07-24 22:27:11.000000000 +0200 +++ third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c 2015-07-26 17:38:40.937606000 +0200 -@@ -34,6 +34,7 @@ - #include - #endif - #if HAVE_SYSCTL +@@ -1,2 +1,3 @@ + // File automatically generated. See crbug.com/495833. +#define __BSD_VISIBLE 1 - #if HAVE_SYS_PARAM_H - #include - #endif ---- v8/src/compiler/graph-visualizer.h.orig 2015-07-24 22:28:03.000000000 +0200 -+++ v8/src/compiler/graph-visualizer.h 2015-07-26 18:37:45.488253000 +0200 -@@ -5,7 +5,7 @@ - #ifndef V8_COMPILER_GRAPH_VISUALIZER_H_ - #define V8_COMPILER_GRAPH_VISUALIZER_H_ - --#include -+#include - #include - - namespace v8 { -@@ -21,7 +21,7 @@ - class Schedule; - class SourcePositionTable; - --FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, -+std::FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, - const char* suffix, const char* mode); - - struct AsDOT { + #include "cpu.c" --- v8/src/log-utils.h.orig 2015-10-13 21:04:45.000000000 +0200 +++ v8/src/log-utils.h 2015-10-17 10:17:35.535561000 +0200 @@ -5,6 +5,9 @@ #ifndef V8_LOG_UTILS_H_ #define V8_LOG_UTILS_H_ - + +#include +#include + @@ -151,7 +118,7 @@ +++ third_party/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc 2015-11-01 11:32:36.293750000 +0100 @@ -11,6 +11,7 @@ #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" - + #include +#include #include @@ -162,15 +129,15 @@ @@ -42,7 +42,7 @@ else if (hue * 3.0 < 2.0) result = temp1 + (temp2 - temp1) * (2.0 / 3.0 - hue) * 6.0; - + - return static_cast(std::round(result * 255)); + return static_cast(round(result * 255)); } - + // Assumes sRGB. @@ -85,7 +85,7 @@ } - + uint8_t GetLuma(SkColor color) { - return static_cast(std::round((0.299 * SkColorGetR(color)) + + return static_cast(round((0.299 * SkColorGetR(color)) + @@ -188,12 +155,12 @@ + static_cast(round(g)), + static_cast(round(b))); } - + void BuildLumaHistogram(const SkBitmap& bitmap, int histogram[256]) { @@ -275,10 +275,10 @@ double b = (SkColorGetB(foreground) * f_weight + SkColorGetB(background) * b_weight) / 255.0; - + - return SkColorSetARGB(static_cast(std::round(normalizer)), - static_cast(std::round(r)), - static_cast(std::round(g)), @@ -203,18 +170,18 @@ + static_cast(round(g)), + static_cast(round(b))); } - + bool IsDark(SkColor color) { --- media/filters/audio_clock.cc.orig 2016-04-07 11:55:00.678817033 +0200 +++ media/filters/audio_clock.cc 2016-04-07 11:55:28.152814716 +0200 @@ -121,7 +121,7 @@ } - + return base::TimeDelta::FromMicroseconds( - std::round(frames_until_timestamp * microseconds_per_frame_)); + round(frames_until_timestamp * microseconds_per_frame_)); } - + void AudioClock::ContiguousAudioDataBufferedForTesting( --- media/filters/audio_clock.h.orig 2016-04-08 14:22:02.833940146 +0200 +++ media/filters/audio_clock.h 2016-04-08 14:22:14.433876920 +0200 @@ -230,7 +197,7 @@ - std::round(back_timestamp_micros_)); + round(back_timestamp_micros_)); } - + // Returns the amount of wall time until |timestamp| will be played by the --- content/browser/web_contents/web_contents_impl.cc.orig 2016-04-08 15:44:21.989537858 +0200 +++ content/browser/web_contents/web_contents_impl.cc 2016-04-08 15:44:44.574535099 +0200 @@ -246,7 +213,7 @@ --- chrome/browser/ui/views/frame/browser_root_view.cc.orig 2016-04-08 17:23:19.749128496 +0200 +++ chrome/browser/ui/views/frame/browser_root_view.cc 2016-04-08 17:23:30.609126494 +0200 @@ -139,10 +139,10 @@ - + // Number of integer scroll events that have passed in each direction. int whole_scroll_amount_x = - std::lround(static_cast(scroll_remainder_x_) / @@ -256,16 +223,16 @@ - std::lround(static_cast(scroll_remainder_y_) / + lround(static_cast(scroll_remainder_y_) / ui::MouseWheelEvent::kWheelDelta); - + // Adjust the remainder such that any whole scrolls we have taken action --- base/process/memory.h.orig 2016-06-06 21:05:12.000000000 +0200 +++ base/process/memory.h 2016-06-12 20:04:24.000000000 +0200 @@ -6,6 +6,7 @@ #define BASE_PROCESS_MEMORY_H_ - + #include +#include - + #include "base/base_export.h" #include "base/process/process_handle.h" --- media/audio/audio_output_device.cc.orig 2016-06-06 21:05:19.000000000 +0200 @@ -278,61 +245,39 @@ + render_callback_->Render(output_bus_.get(), round(frames_delayed), frames_skipped); } - + --- media/audio/audio_output_stream_sink.cc.orig 2016-06-06 21:05:19.000000000 +0200 +++ media/audio/audio_output_stream_sink.cc 2016-06-12 20:35:05.000000000 +0200 @@ -85,7 +85,7 @@ if (!active_render_callback_) return 0; - + - uint32_t frames_delayed = std::round(static_cast(total_bytes_delay) / + uint32_t frames_delayed = round(static_cast(total_bytes_delay) / active_params_.GetBytesPerFrame()); - + return active_render_callback_->Render(dest, frames_delayed, frames_skipped); ---- media/base/audio_renderer_mixer_input.cc.orig 2016-06-06 21:05:19.000000000 +0200 -+++ media/base/audio_renderer_mixer_input.cc 2016-06-12 20:50:35.000000000 +0200 -@@ -164,7 +164,7 @@ - // TODO(chcunningham): Delete this conversion and change ProvideInput to more - // precisely describe delay as a count of frames delayed instead of TimeDelta. - // See http://crbug.com/587522. -- uint32_t frames_delayed = std::round(buffer_delay.InMicroseconds() / -+ uint32_t frames_delayed = round(buffer_delay.InMicroseconds() / - params_.GetMicrosecondsPerFrame()); - - int frames_filled = callback_->Render(audio_bus, frames_delayed, 0); ---- media/base/audio_renderer_mixer.cc.orig 2016-06-06 21:05:19.000000000 +0200 -+++ media/base/audio_renderer_mixer.cc 2016-06-12 20:52:34.000000000 +0200 -@@ -138,7 +138,7 @@ - // expect a count of frames delayed instead of TimeDelta (less precise). - // See http://crbug.com/587522. - base::TimeDelta audio_delay = base::TimeDelta::FromMicroseconds( -- std::round(frames_delayed * output_params_.GetMicrosecondsPerFrame())); -+ round(frames_delayed * output_params_.GetMicrosecondsPerFrame())); - - master_converter_.ConvertWithDelay(audio_delay, audio_bus); - return audio_bus->frames(); --- third_party/WebKit/Source/modules/battery/battery_status.h.orig 2016-06-06 21:05:36.000000000 +0200 +++ third_party/WebKit/Source/modules/battery/battery_status.h 2016-06-13 20:21:31.000000000 +0200 @@ -46,7 +46,7 @@ // of reducing the possibility of fingerprinting and triggers less level // change events on platforms where the granularity is high. - ASSERT(level >= 0 && level <= 1); + DCHECK(level >= 0 && level <= 1); - return std::round(level * 100) / 100.f; + return round(level * 100) / 100.f; } - + bool charging_; --- chrome/common/channel_info_posix.cc.orig 2016-06-06 21:05:14.000000000 +0200 +++ chrome/common/channel_info_posix.cc 2016-06-13 21:36:53.000000000 +0200 @@ -8,6 +8,8 @@ #include "build/build_config.h" #include "components/version_info/version_info.h" - + +#include + namespace chrome { - + namespace { --- chrome/browser/ui/views/tabs/tab_strip.cc.orig 2016-06-06 21:05:14.000000000 +0200 +++ chrome/browser/ui/views/tabs/tab_strip.cc 2016-06-13 22:03:03.000000000 +0200 @@ -360,3 +305,13 @@ CreateShadowDrawLooper(SkColorSetA(stroke_color, alpha))); canvas->DrawPath(fill, paint); +--- base/trace_event/heap_profiler_allocation_context_tracker.cc.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/trace_event/heap_profiler_allocation_context_tracker.cc 2016-08-21 04:17:53.717876000 +0300 +@@ -13,6 +13,7 @@ + #include "base/threading/thread_local_storage.h" + #include "base/trace_event/heap_profiler_allocation_context.h" + ++#include + #if defined(OS_LINUX) || defined(OS_ANDROID) + #include + #endif Index: head/www/chromium/files/extra-patch-libusb-pc =================================================================== --- head/www/chromium/files/extra-patch-libusb-pc +++ head/www/chromium/files/extra-patch-libusb-pc @@ -1,20 +0,0 @@ ---- build/linux/unbundle/libusb.gyp.orig 2014-08-12 21:02:52.000000000 +0200 -+++ build/linux/unbundle/libusb.gyp 2014-08-17 16:21:03.000000000 +0200 -@@ -18,14 +18,14 @@ - ], - 'direct_dependent_settings': { - 'cflags': [ -- ' ++#include ++#include + + // This translation unit defines a default dispatch for the allocator shim which + // routes allocations to libc functions. +-// The code here is strongly inspired from tcmalloc's libc_override_glibc.h. ++// The code here is strongly inspired from tcmalloc's override_glibc.h. + + extern "C" { +-void* __libc_malloc(size_t size); +-void* __libc_calloc(size_t n, size_t size); +-void* __libc_realloc(void* address, size_t size); +-void* __libc_memalign(size_t alignment, size_t size); +-void __libc_free(void* ptr); ++void* __malloc(size_t size); ++void* __calloc(size_t n, size_t size); ++void* __realloc(void* address, size_t size); ++void* __memalign(size_t alignment, size_t size) { ++ void *ret; ++ if (__posix_memalign(&ret, alignment, size) != 0) { ++ return nullptr; ++ } else { ++ return ret; ++ } ++} ++int __posix_memalign(void **ptr, size_t alignment, size_t size); ++void __free(void* ptr); + } // extern "C" + + namespace { +@@ -21,23 +32,27 @@ + using base::allocator::AllocatorDispatch; + + void* GlibcMalloc(const AllocatorDispatch*, size_t size) { +- return __libc_malloc(size); ++ return __malloc(size); + } + + void* GlibcCalloc(const AllocatorDispatch*, size_t n, size_t size) { +- return __libc_calloc(n, size); ++ return __calloc(n, size); + } + + void* GlibcRealloc(const AllocatorDispatch*, void* address, size_t size) { +- return __libc_realloc(address, size); ++ return __realloc(address, size); + } + + void* GlibcMemalign(const AllocatorDispatch*, size_t alignment, size_t size) { +- return __libc_memalign(alignment, size); ++ return __memalign(alignment, size); + } + ++/* int GlibcPosixMemalign(const AllocatorDispatch*, void** ptr, size_t alignment, size_t size) { */ ++/* return __posix_memalign(ptr, alignment, size); */ ++/* } */ ++ + void GlibcFree(const AllocatorDispatch*, void* address) { +- __libc_free(address); ++ __free(address); + } + + } // namespace Index: head/www/chromium/files/patch-base_allocator_allocator__shim__override__libc__symbols.h =================================================================== --- head/www/chromium/files/patch-base_allocator_allocator__shim__override__libc__symbols.h +++ head/www/chromium/files/patch-base_allocator_allocator__shim__override__libc__symbols.h @@ -0,0 +1,11 @@ +--- base/allocator/allocator_shim_override_libc_symbols.h.orig 2016-08-13 16:23:28.370905000 +0300 ++++ base/allocator/allocator_shim_override_libc_symbols.h 2016-08-13 16:23:33.784774000 +0300 +@@ -10,7 +10,7 @@ + #endif + #define BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_LIBC_SYMBOLS_H_ + +-#include ++#include + + #include "base/allocator/allocator_shim_internals.h" + Index: head/www/chromium/files/patch-base_allocator_allocator__shim__unittest.cc =================================================================== --- head/www/chromium/files/patch-base_allocator_allocator__shim__unittest.cc +++ head/www/chromium/files/patch-base_allocator_allocator__shim__unittest.cc @@ -0,0 +1,61 @@ +--- base/allocator/allocator_shim_unittest.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/allocator/allocator_shim_unittest.cc 2016-10-25 21:48:23.218013000 +0300 +@@ -4,7 +4,6 @@ + + #include "base/allocator/allocator_shim.h" + +-#include + #include + #include + +@@ -193,11 +192,13 @@ + ASSERT_GE(zero_allocs_intercepted_by_size[2 * 23], 1u); + + #if !defined(OS_WIN) ++#if !defined(OS_BSD) + void* memalign_ptr = memalign(128, 53); + ASSERT_NE(nullptr, memalign_ptr); + ASSERT_EQ(0u, reinterpret_cast(memalign_ptr) % 128); + ASSERT_GE(aligned_allocs_intercepted_by_alignment[128], 1u); + ASSERT_GE(aligned_allocs_intercepted_by_size[53], 1u); ++#endif + + void* posix_memalign_ptr = nullptr; + int res = posix_memalign(&posix_memalign_ptr, 256, 59); +@@ -214,12 +215,14 @@ + ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); + ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u); + ++#if !defined(OS_BSD) + void* pvalloc_ptr = pvalloc(67); + ASSERT_NE(nullptr, pvalloc_ptr); + ASSERT_EQ(0u, reinterpret_cast(pvalloc_ptr) % kPageSize); + ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); + // pvalloc rounds the size up to the next page. + ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u); ++#endif + #endif // OS_WIN + + char* realloc_ptr = static_cast(realloc(nullptr, 71)); +@@ -240,8 +243,10 @@ + ASSERT_GE(frees_intercepted_by_addr[Hash(zero_alloc_ptr)], 1u); + + #if !defined(OS_WIN) ++#if !defined(OS_BSD) + free(memalign_ptr); + ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u); ++#endif + + free(posix_memalign_ptr); + ASSERT_GE(frees_intercepted_by_addr[Hash(posix_memalign_ptr)], 1u); +@@ -249,8 +254,10 @@ + free(valloc_ptr); + ASSERT_GE(frees_intercepted_by_addr[Hash(valloc_ptr)], 1u); + ++#if !defined(OS_BSD) + free(pvalloc_ptr); + ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u); ++#endif + #endif // OS_WIN + + free(realloc_ptr); Index: head/www/chromium/files/patch-base_base.gyp =================================================================== --- head/www/chromium/files/patch-base_base.gyp +++ head/www/chromium/files/patch-base_base.gyp @@ -1,40 +0,0 @@ ---- ./base/base.gyp.orig 2016-07-22 00:06:49.000000000 -0400 -+++ ./base/base.gyp 2016-08-05 08:28:39.441243000 -0400 -@@ -114,7 +114,7 @@ - ], - 'link_settings': { - 'libraries': [ -- '-L/usr/local/lib -lexecinfo', -+ '-L/usr/local/lib -lexecinfo -lkvm', - ], - }, - }], -@@ -286,13 +286,13 @@ - ], - }], - ['icu_use_data_file_flag==1', { -- 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], -+ 'defines': ['ICU_UTIL_DATA_IMPL=0'], - }, { # else icu_use_data_file_flag !=1 - 'conditions': [ - ['OS=="win"', { -- 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], -+ 'defines': ['ICU_UTIL_DATA_IMPL=1'], - }, { -- 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], -+ 'defines': ['ICU_UTIL_DATA_IMPL=2'], - }], - ], - }], -@@ -773,6 +773,11 @@ - 'sync_socket_unittest.cc', - ], - }], -+ ['OS == "freebsd"', { -+ 'sources!': [ -+ 'debug/proc_maps_linux_unittest.cc', -+ ], -+ }], - ], # target_conditions - }, - { Index: head/www/chromium/files/patch-base_base.gypi =================================================================== --- head/www/chromium/files/patch-base_base.gypi +++ head/www/chromium/files/patch-base_base.gypi @@ -1,20 +0,0 @@ ---- base/base.gypi.orig 2016-05-11 19:02:11 UTC -+++ base/base.gypi -@@ -999,11 +999,16 @@ - 'process/memory_stubs.cc', - ], - 'sources/': [ -+ ['exclude', '^debug/proc_maps_linux\\.cc$'], - ['exclude', '^files/file_path_watcher_linux\\.cc$'], -- ['exclude', '^files/file_path_watcher_stub\\.cc$'], - ['exclude', '^files/file_util_linux\\.cc$'], -+ ['exclude', '^process/memory_linux\\.cc$'], - ['exclude', '^process/process_linux\\.cc$'], - ['exclude', '^sys_info_linux\\.cc$'], -+ ['exclude', '^process/process_iterator_linux\\.cc$'], -+ ['exclude', '^process/process_metrics_linux\\.cc$'], -+ ['exclude', '^files/file_path_watcher_fsevents\\.cc$'], -+ ['exclude', '^files/file_path_watcher_fsevents\\.h$'], - ], - }], - # Remove all unnecessary files for build_nexe.py to avoid exceeding Index: head/www/chromium/files/patch-base_debug_proc__maps__linux.cc =================================================================== --- head/www/chromium/files/patch-base_debug_proc__maps__linux.cc +++ head/www/chromium/files/patch-base_debug_proc__maps__linux.cc @@ -0,0 +1,11 @@ +--- base/debug/proc_maps_linux.cc.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/debug/proc_maps_linux.cc 2016-09-05 22:49:53.622055000 +0300 +@@ -12,7 +12,7 @@ + #include "base/strings/string_split.h" + #include "build/build_config.h" + +-#if defined(OS_LINUX) || defined(OS_ANDROID) ++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_ANDROID) + #include + #endif + Index: head/www/chromium/files/patch-base_files_file__path__unittest.cc =================================================================== --- head/www/chromium/files/patch-base_files_file__path__unittest.cc +++ head/www/chromium/files/patch-base_files_file__path__unittest.cc @@ -0,0 +1,11 @@ +--- base/files/file_path_unittest.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/files/file_path_unittest.cc 2016-10-25 21:44:53.079388000 +0300 +@@ -1133,7 +1133,7 @@ + "\xEF\xBC\xA1\xEF\xBC\xA2\xEF\xBC\xA3.txt" }, + }; + +-#if !defined(SYSTEM_NATIVE_UTF8) && defined(OS_LINUX) ++#if !defined(SYSTEM_NATIVE_UTF8) && (defined(OS_LINUX) || defined(OS_BSD)) + ScopedLocale locale("en_US.UTF-8"); + #endif + Index: head/www/chromium/files/patch-base_files_file__util.h =================================================================== --- head/www/chromium/files/patch-base_files_file__util.h +++ head/www/chromium/files/patch-base_files_file__util.h @@ -0,0 +1,11 @@ +--- base/files/file_util.h.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/files/file_util.h 2016-09-05 23:00:09.940024000 +0300 +@@ -391,7 +391,7 @@ + // the directory |path|, in the number of FilePath::CharType, or -1 on failure. + BASE_EXPORT int GetMaximumPathComponentLength(const base::FilePath& path); + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // Broad categories of file systems as returned by statfs() on Linux. + enum FileSystemType { + FILE_SYSTEM_UNKNOWN, // statfs failed. Index: head/www/chromium/files/patch-base_linux__util.cc =================================================================== --- head/www/chromium/files/patch-base_linux__util.cc +++ head/www/chromium/files/patch-base_linux__util.cc @@ -0,0 +1,18 @@ +--- base/linux_util.cc.orig 2016-08-13 05:03:14.838982000 +0300 ++++ base/linux_util.cc 2016-08-13 05:04:48.912092000 +0300 +@@ -86,12 +86,14 @@ + "CrOS"; + #elif defined(OS_ANDROID) + "Android"; ++#elif defined(OS_BSD) ++ "BSD"; + #else // if defined(OS_LINUX) + "Unknown"; + #endif + + std::string GetLinuxDistro() { +-#if defined(OS_CHROMEOS) || defined(OS_ANDROID) ++#if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) + return g_linux_distro; + #elif defined(OS_LINUX) + LinuxDistroHelper* distro_state_singleton = LinuxDistroHelper::GetInstance(); Index: head/www/chromium/files/patch-base_native__library__posix.cc =================================================================== --- head/www/chromium/files/patch-base_native__library__posix.cc +++ head/www/chromium/files/patch-base_native__library__posix.cc @@ -0,0 +1,11 @@ +--- base/native_library_posix.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/native_library_posix.cc 2016-10-14 03:14:48.329757000 +0300 +@@ -35,7 +35,7 @@ + // versions. Crash here to warn developers that they're trying to rely on + // uncertain behavior. + CHECK(!options.prefer_own_symbols); +-#else ++#elif !defined(OS_BSD) + if (options.prefer_own_symbols) + flags |= RTLD_DEEPBIND; + #endif Index: head/www/chromium/files/patch-base_posix_unix__domain__socket__linux.cc =================================================================== --- head/www/chromium/files/patch-base_posix_unix__domain__socket__linux.cc +++ head/www/chromium/files/patch-base_posix_unix__domain__socket__linux.cc @@ -1,10 +1,10 @@ ---- base/posix/unix_domain_socket_linux.cc.orig 2016-03-25 13:04:44 UTC -+++ base/posix/unix_domain_socket_linux.cc +--- base/posix/unix_domain_socket_linux.cc.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/posix/unix_domain_socket_linux.cc 2016-09-06 23:39:53.563078000 +0300 @@ -23,6 +23,15 @@ namespace base { -+#if defined(__FreeBSD__) ++#if defined(OS_BSD) +// Port over Linux ucred structure +struct ucred { + pid_t pid; // process ID of the sending process @@ -16,25 +16,26 @@ const size_t UnixDomainSocket::kMaxFileDescriptors = 16; #if !defined(OS_NACL_NONSFI) -@@ -41,7 +50,13 @@ static bool CreateSocketPair(ScopedFD* o +@@ -40,8 +49,14 @@ + // static bool UnixDomainSocket::EnableReceiveProcessId(int fd) { - const int enable = 1; -+#if defined(__FreeBSD__) ++#if defined(OS_BSD) + // XXX(rene) do this? : + // taken from dbus, Academic Free License 2.1 / GPL 2+ + return 0; // fake OK +#else + const int enable = 1; return setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)) == 0; +#endif } #endif // !defined(OS_NACL_NONSFI) -@@ -147,7 +162,11 @@ ssize_t UnixDomainSocket::RecvMsgWithFla +@@ -147,7 +162,11 @@ // The PNaCl toolchain for Non-SFI binary build does not support // SCM_CREDENTIALS. if (cmsg->cmsg_level == SOL_SOCKET && -+#if defined(__FreeBSD__) ++#if defined(OS_BSD) + 1) { // XXX(rene) carpet getting full ... +#else cmsg->cmsg_type == SCM_CREDENTIALS) { Index: head/www/chromium/files/patch-base_process_launch.h =================================================================== --- head/www/chromium/files/patch-base_process_launch.h +++ head/www/chromium/files/patch-base_process_launch.h @@ -1,20 +1,20 @@ ---- base/process/launch.h.orig 2016-05-11 19:02:11 UTC -+++ base/process/launch.h -@@ -135,7 +135,7 @@ struct BASE_EXPORT LaunchOptions { +--- base/process/launch.h.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/process/launch.h 2016-10-13 04:27:24.908534000 +0300 +@@ -138,7 +138,7 @@ // will be the same as its pid. - bool new_process_group; + bool new_process_group = false; -#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_FREEBSD) ++#if defined(OS_LINUX) || defined(OS_BSD) // If non-zero, start the process using clone(), using flags as provided. // Unlike in clone, clone_flags may not contain a custom termination signal // that is sent to the parent when the child dies. The termination signal will -@@ -148,7 +148,7 @@ struct BASE_EXPORT LaunchOptions { +@@ -151,7 +151,7 @@ // Sets parent process death signal to SIGKILL. - bool kill_on_parent_death; + bool kill_on_parent_death = false; -#endif // defined(OS_LINUX) -+#endif // defined(OS_LINUX) || defined(OS_FREEBSD) ++#endif // defined(OS_LINUX) || defined(OS_BSD) #if defined(OS_POSIX) - // If not empty, change to this directory before execing the new process. + // If non-null, a delegate to be run immediately prior to executing the new Index: head/www/chromium/files/patch-base_process_launch.cc =================================================================== --- head/www/chromium/files/patch-base_process_launch.cc +++ head/www/chromium/files/patch-base_process_launch.cc @@ -1,16 +1,11 @@ ---- base/process/launch.cc.orig 2016-04-08 16:02:06 UTC -+++ base/process/launch.cc -@@ -25,11 +25,11 @@ LaunchOptions::LaunchOptions() - fds_to_remap(NULL), - maximize_rlimits(NULL), - new_process_group(false) +--- base/process/launch.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/process/launch.cc 2016-10-13 04:27:47.136877000 +0300 +@@ -15,7 +15,7 @@ + + LaunchOptions LaunchOptionsForTest() { + LaunchOptions options; -#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_FREEBSD) - , clone_flags(0) - , allow_new_privs(false) - , kill_on_parent_death(false) --#endif // OS_LINUX -+#endif // OS_LINUX || OS_FREEBSD - #if defined(OS_POSIX) - , pre_exec_delegate(NULL) - #endif // OS_POSIX ++#if defined(OS_LINUX) || defined(OS_BSD) + // To prevent accidental privilege sharing to an untrusted child, processes + // are started with PR_SET_NO_NEW_PRIVS. Do not set that here, since this + // new child will be used for testing only. Index: head/www/chromium/files/patch-base_process_launch__posix.cc =================================================================== --- head/www/chromium/files/patch-base_process_launch__posix.cc +++ head/www/chromium/files/patch-base_process_launch__posix.cc @@ -0,0 +1,10 @@ +--- base/process/launch_posix.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/process/launch_posix.cc 2016-10-16 15:45:00.730008000 +0300 +@@ -62,6 +62,7 @@ + #include + #else + extern char** environ; ++#pragma weak environ + #endif + + namespace base { Index: head/www/chromium/files/patch-base_process_memory.h =================================================================== --- head/www/chromium/files/patch-base_process_memory.h +++ head/www/chromium/files/patch-base_process_memory.h @@ -0,0 +1,11 @@ +--- base/process/memory.h.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/process/memory.h 2016-09-11 01:10:36.394804000 +0300 +@@ -32,7 +32,7 @@ + // Crash reporting classifies such crashes as OOM. + BASE_EXPORT void TerminateBecauseOutOfMemory(size_t size); + +-#if defined(OS_LINUX) || defined(OS_ANDROID) ++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_ANDROID) + BASE_EXPORT extern size_t g_oom_size; + + // The maximum allowed value for the OOM score. Index: head/www/chromium/files/patch-base_process_memory.cc =================================================================== --- head/www/chromium/files/patch-base_process_memory.cc +++ head/www/chromium/files/patch-base_process_memory.cc @@ -1,39 +0,0 @@ ---- base/process/memory.cc.orig 2016-03-25 13:04:44 UTC -+++ base/process/memory.cc -@@ -46,4 +46,36 @@ bool UncheckedCalloc(size_t num_items, s - - #endif - -+#if defined(OS_FREEBSD) -+ -+#if defined(USE_TCMALLOC) -+// Used by UncheckedMalloc. If tcmalloc is linked to the executable -+// this will be replaced by a strong symbol that actually implement -+// the semantics and don't call new handler in case the allocation fails. -+extern "C" { -+ -+__attribute__((weak, visibility("default"))) -+void* tc_malloc_skip_new_handler_weak(size_t size); -+ -+void* tc_malloc_skip_new_handler_weak(size_t size) { -+ return malloc(size); -+} -+ -+} -+#endif -+ -+bool UncheckedMalloc(size_t size, void** result) { -+#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || \ -+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)) -+ *result = malloc(size); -+#elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) -+ *result = __libc_malloc(size); -+#elif defined(USE_TCMALLOC) -+ *result = tc_malloc_skip_new_handler_weak(size); -+#endif -+ return *result != NULL; -+} -+ -+#endif // defined(OS_FREEBSD) -+ - } // namespace base Index: head/www/chromium/files/patch-base_process_memory__unittest.cc =================================================================== --- head/www/chromium/files/patch-base_process_memory__unittest.cc +++ head/www/chromium/files/patch-base_process_memory__unittest.cc @@ -1,23 +1,22 @@ ---- base/process/memory_unittest.cc.orig 2016-05-11 19:02:11 UTC -+++ base/process/memory_unittest.cc -@@ -140,11 +140,11 @@ TEST(ProcessMemoryTest, MacTerminateOnHe - #endif // defined(OS_MACOSX) +--- base/process/memory_unittest.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/process/memory_unittest.cc 2016-10-13 04:32:50.457987000 +0300 +@@ -82,10 +82,10 @@ + ASSERT_TRUE(base::allocator::IsAllocatorInitialized()); + } - // Android doesn't implement set_new_handler, so we can't use the --// OutOfMemoryTest cases. OpenBSD does not support these tests either. -+// OutOfMemoryTest cases. OpenBSD and FreeBSD do not support these tests either. - // Don't test these on ASan/TSan/MSan configurations: only test the real - // allocator. +-// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan ++// BSD does not support these tests. Don't test these on ASan/TSan/MSan + // configurations: only test the real allocator. // Windows only supports these tests with the allocator shim in place. --#if !defined(OS_ANDROID) && !defined(OS_OPENBSD) && \ -+#if !defined(OS_ANDROID) && !defined(OS_BSD) && \ - !(defined(OS_WIN) && !defined(ALLOCATOR_SHIM)) && \ +-#if !defined(OS_OPENBSD) && \ ++#if !defined(OS_BSD) && \ + BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \ !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) -@@ -474,5 +474,5 @@ TEST_F(OutOfMemoryHandledTest, Unchecked +@@ -439,5 +439,5 @@ + EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_)); EXPECT_TRUE(value_ == NULL); } - #endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) --#endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !(defined(OS_WIN) && -+#endif // !defined(OS_ANDROID) && !defined(OS_BSD) && !(defined(OS_WIN) && - // !defined(ALLOCATOR_SHIM)) && !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) +-#endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && ++#endif // !defined(OS_BSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && + // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) Index: head/www/chromium/files/patch-base_process_process__handle__freebsd.cc =================================================================== --- head/www/chromium/files/patch-base_process_process__handle__freebsd.cc +++ head/www/chromium/files/patch-base_process_process__handle__freebsd.cc @@ -0,0 +1,11 @@ +--- base/process/process_handle_freebsd.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/process/process_handle_freebsd.cc 2016-10-26 19:55:22.341492000 +0300 +@@ -16,7 +16,7 @@ + + ProcessId GetParentProcessId(ProcessHandle process) { + struct kinfo_proc info; +- size_t length; ++ size_t length = sizeof(struct kinfo_proc); + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process }; + + if (sysctl(mib, arraysize(mib), &info, &length, NULL, 0) < 0) Index: head/www/chromium/files/patch-base_process_process__metrics.h =================================================================== --- head/www/chromium/files/patch-base_process_process__metrics.h +++ head/www/chromium/files/patch-base_process_process__metrics.h @@ -1,6 +1,6 @@ ---- base/process/process_metrics.h.orig 2016-05-11 19:02:11 UTC -+++ base/process/process_metrics.h -@@ -21,6 +21,13 @@ +--- base/process/process_metrics.h.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/process/process_metrics.h 2016-10-13 12:58:13.818273000 +0300 +@@ -22,6 +22,12 @@ #include "base/values.h" #include "build/build_config.h" @@ -8,13 +8,12 @@ +#include +#include +#include -+#include +#endif + #if defined(OS_MACOSX) #include #include "base/process/port_provider_mac.h" -@@ -314,13 +321,17 @@ BASE_EXPORT bool GetSystemMemoryInfo(Sys +@@ -326,13 +332,17 @@ // CPU-related ticks. Returns -1 on parse error. // Exposed for testing. BASE_EXPORT int ParseProcStatCPU(const std::string& input); Index: head/www/chromium/files/patch-base_process_process__posix.cc =================================================================== --- head/www/chromium/files/patch-base_process_process__posix.cc +++ head/www/chromium/files/patch-base_process_process__posix.cc @@ -1,5 +1,5 @@ ---- base/process/process_posix.cc.orig 2016-03-25 13:04:44 UTC -+++ base/process/process_posix.cc +--- base/process/process_posix.cc.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/process/process_posix.cc 2016-09-11 02:18:36.481940000 +0300 @@ -20,8 +20,18 @@ #include #endif @@ -19,32 +19,15 @@ #if !defined(OS_NACL_NONSFI) bool WaitpidWithTimeout(base::ProcessHandle handle, -@@ -86,7 +96,7 @@ bool WaitpidWithTimeout(base::ProcessHan - return ret_pid > 0; - } - --#if defined(OS_MACOSX) -+#if defined(OS_MACOSX) || defined(OS_BSD) - // Using kqueue on Mac so that we can wait on non-child processes. - // We can't use kqueues on child processes because we need to reap - // our own children using wait. -@@ -175,7 +185,7 @@ static bool WaitForSingleNonChildProcess - - return true; - } --#endif // OS_MACOSX -+#endif // OS_MACOSX || OS_BSD - - bool WaitForExitWithTimeoutImpl(base::ProcessHandle handle, - int* exit_code, -@@ -183,13 +193,13 @@ bool WaitForExitWithTimeoutImpl(base::Pr +@@ -183,13 +193,13 @@ base::ProcessHandle parent_pid = base::GetParentProcessId(handle); base::ProcessHandle our_pid = base::GetCurrentProcessHandle(); if (parent_pid != our_pid) { -#if defined(OS_MACOSX) +#if defined(OS_MACOSX) || defined(OS_BSD) // On Mac we can wait on non child processes. - return WaitForSingleNonChildProcess(handle, timeout); +- return WaitForSingleNonChildProcess(handle, timeout); ++ /* return WaitForSingleNonChildProcess(handle, timeout); */ #else // Currently on Linux we can't handle non child processes. NOTIMPLEMENTED(); @@ -53,7 +36,7 @@ } int status; -@@ -256,12 +266,16 @@ Process Process::DeprecatedGetProcessFro +@@ -256,12 +266,16 @@ return Process(handle); } @@ -72,7 +55,7 @@ bool Process::IsValid() const { return process_ != kNullProcessHandle; -@@ -361,15 +375,32 @@ bool Process::WaitForExitWithTimeout(Tim +@@ -361,15 +375,32 @@ bool Process::IsProcessBackgrounded() const { // See SetProcessBackgrounded(). DCHECK(IsValid()); Index: head/www/chromium/files/patch-base_profiler_stack__sampling__profiler__unittest.cc =================================================================== --- head/www/chromium/files/patch-base_profiler_stack__sampling__profiler__unittest.cc +++ head/www/chromium/files/patch-base_profiler_stack__sampling__profiler__unittest.cc @@ -0,0 +1,11 @@ +--- base/profiler/stack_sampling_profiler_unittest.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/profiler/stack_sampling_profiler_unittest.cc 2016-10-25 21:31:13.576230000 +0300 +@@ -30,7 +30,7 @@ + #include + #include + #include +-#else ++#elif !defined(OS_BSD) + #include + #endif + Index: head/www/chromium/files/patch-base_sys__info__freebsd.cc =================================================================== --- head/www/chromium/files/patch-base_sys__info__freebsd.cc +++ head/www/chromium/files/patch-base_sys__info__freebsd.cc @@ -1,5 +1,5 @@ ---- base/sys_info_freebsd.cc.orig 2016-03-25 13:04:44 UTC -+++ base/sys_info_freebsd.cc +--- base/sys_info_freebsd.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/sys_info_freebsd.cc 2016-10-13 10:20:37.344204000 +0300 @@ -12,12 +12,34 @@ namespace base { @@ -39,11 +39,14 @@ NOTREACHED(); return 0; } -@@ -35,4 +57,25 @@ uint64_t SysInfo::MaxSharedMemorySize() - return static_cast(limit); +@@ -25,14 +47,24 @@ } -+// static + // static +-uint64_t SysInfo::MaxSharedMemorySize() { +- size_t limit; +- size_t size = sizeof(limit); +- if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) { +std::string SysInfo::CPUModelName() { + int mib[] = { CTL_HW, HW_MODEL }; + char name[256]; @@ -58,10 +61,12 @@ + int ncpu; + size_t size = sizeof(ncpu); + if (sysctl(mib, arraysize(mib), &ncpu, &size, NULL, 0) == -1) { -+ NOTREACHED(); + NOTREACHED(); +- return 0; + return 1; -+ } + } +- return static_cast(limit); + return ncpu; -+} -+ + } + } // namespace base Index: head/www/chromium/files/patch-base_sys__info__posix.cc =================================================================== --- head/www/chromium/files/patch-base_sys__info__posix.cc +++ head/www/chromium/files/patch-base_sys__info__posix.cc @@ -1,11 +1,20 @@ ---- base/sys_info_posix.cc.orig 2016-03-25 13:04:44 UTC -+++ base/sys_info_posix.cc -@@ -77,7 +77,7 @@ base::LazyInstance< +--- base/sys_info_posix.cc.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/sys_info_posix.cc 2016-09-24 01:27:31.548122000 +0300 +@@ -30,7 +30,7 @@ + + namespace { + +-#if !defined(OS_OPENBSD) ++#if !defined(OS_BSD) + 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. +@@ -77,7 +77,7 @@ namespace base { -#if !defined(OS_OPENBSD) -+#if !defined(OS_OPENBSD) && !defined(OS_FREEBSD) ++#if !defined(OS_BSD) int SysInfo::NumberOfProcessors() { return g_lazy_number_of_processors.Get().value(); } Index: head/www/chromium/files/patch-base_test_BUILD.gn =================================================================== --- head/www/chromium/files/patch-base_test_BUILD.gn +++ head/www/chromium/files/patch-base_test_BUILD.gn @@ -0,0 +1,11 @@ +--- base/test/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/test/BUILD.gn 2016-09-02 23:56:39.647089000 +0300 +@@ -249,7 +249,7 @@ + ] + } + +-if (is_linux) { ++if (is_linux || is_bsd) { + shared_library("malloc_wrapper") { + testonly = true + sources = [ Index: head/www/chromium/files/patch-base_test_test__file__util__posix.cc =================================================================== --- head/www/chromium/files/patch-base_test_test__file__util__posix.cc +++ head/www/chromium/files/patch-base_test_test__file__util__posix.cc @@ -0,0 +1,11 @@ +--- base/test/test_file_util_posix.cc.orig 2016-10-06 04:02:08.000000000 +0300 ++++ base/test/test_file_util_posix.cc 2016-10-25 21:44:27.287523000 +0300 +@@ -79,7 +79,7 @@ + return DeleteFile(file, recurse); + } + +-#if !defined(OS_LINUX) && !defined(OS_MACOSX) ++#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_BSD) + bool EvictFileFromSystemCache(const FilePath& file) { + // There doesn't seem to be a POSIX way to cool the disk cache. + NOTIMPLEMENTED(); Index: head/www/chromium/files/patch-base_third__party_libevent_BUILD.gn =================================================================== --- head/www/chromium/files/patch-base_third__party_libevent_BUILD.gn +++ head/www/chromium/files/patch-base_third__party_libevent_BUILD.gn @@ -0,0 +1,12 @@ +--- base/third_party/libevent/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ base/third_party/libevent/BUILD.gn 2016-10-12 18:30:43.933710000 +0300 +@@ -29,6 +29,9 @@ + } else if (is_linux) { + sources += [ "epoll.c" ] + include_dirs = [ "linux" ] ++ } else if (is_bsd) { ++ sources += [ "kqueue.c" ] ++ include_dirs = [ "freebsd" ] + } else if (is_android) { + sources += [ "epoll.c" ] + include_dirs = [ "android" ] Index: head/www/chromium/files/patch-base_third__party_libevent_libevent.gyp =================================================================== --- head/www/chromium/files/patch-base_third__party_libevent_libevent.gyp +++ head/www/chromium/files/patch-base_third__party_libevent_libevent.gyp @@ -1,83 +0,0 @@ ---- base/third_party/libevent/libevent.gyp.orig 2016-05-20 17:19:03 UTC -+++ base/third_party/libevent/libevent.gyp -@@ -1,4 +1,4 @@ --# Copyright (c) 2012 The Chromium Authors. All rights reserved. -+# 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. - -@@ -6,59 +6,22 @@ - 'targets': [ - { - 'target_name': 'libevent', -- 'product_name': 'event', -- 'type': 'static_library', -+ 'type': 'none', - 'toolsets': ['host', 'target'], -- 'sources': [ -- 'buffer.c', -- 'evbuffer.c', -- 'evdns.c', -- 'event.c', -- 'event_tagging.c', -- 'evrpc.c', -- 'evutil.c', -- 'http.c', -- 'log.c', -- 'poll.c', -- 'select.c', -- 'signal.c', -- 'strlcpy.c', -- ], -- 'defines': [ -- 'HAVE_CONFIG_H', -- ], -- 'include_dirs': [ -- '../../..', -- ], -- 'conditions': [ -- # libevent has platform-specific implementation files. Since its -- # native build uses autoconf, platform-specific config.h files are -- # provided and live in platform-specific directories. -- [ 'OS == "linux" or (OS == "android" and _toolset == "host")', { -- 'sources': [ 'epoll.c' ], -- 'include_dirs': [ 'linux' ], -- 'link_settings': { -- 'libraries': [ -- # We need rt for clock_gettime(). -- # TODO(port) Maybe on FreeBSD as well? -- '-lrt', -- ], -- }, -- }], -- [ 'OS == "android" and _toolset == "target"', { -- # On android, clock_gettime() is in libc.so, so no need to link librt. -- 'sources': [ 'epoll.c' ], -- 'include_dirs': [ 'android' ], -- }], -- [ 'OS == "mac" or OS == "ios" or os_bsd==1', { -- 'sources': [ 'kqueue.c' ], -- 'include_dirs': [ 'mac' ] -- }], -- [ 'OS == "solaris"', { -- 'sources': [ 'devpoll.c', 'evport.c' ], -- 'include_dirs': [ 'solaris' ] -- }], -+ 'variables': { -+ 'headers_root_path': '.', -+ 'header_filenames': [ -+ 'event.h', -+ ], -+ }, -+ 'includes': [ -+ '../../../build/shim_headers.gypi', - ], -- }, -+ 'link_settings': { -+ 'libraries': [ -+ '-levent', -+ ], -+ }, -+ } - ], - } Index: head/www/chromium/files/patch-base_threading_platform__thread__linux.cc =================================================================== --- head/www/chromium/files/patch-base_threading_platform__thread__linux.cc +++ head/www/chromium/files/patch-base_threading_platform__thread__linux.cc @@ -1,21 +0,0 @@ ---- base/threading/platform_thread_linux.cc.orig 2016-04-08 16:02:06 UTC -+++ base/threading/platform_thread_linux.cc -@@ -17,7 +17,9 @@ - - #if !defined(OS_NACL) - #include -+#if !defined(OS_BSD) - #include -+#endif - #include - #include - #endif -@@ -70,7 +72,7 @@ void PlatformThread::SetName(const std:: - ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name); - tracked_objects::ThreadData::InitializeThreadContext(name); - --#if !defined(OS_NACL) -+#if !defined(OS_NACL) && !defined(OS_BSD) - // On linux we can get the thread names to show up in the debugger by setting - // the process name for the LWP. We don't want to do this for the main - // thread because that would rename the process, causing tools like killall Index: head/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc =================================================================== --- head/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc +++ head/www/chromium/files/patch-base_trace__event_malloc__dump__provider.cc @@ -0,0 +1,11 @@ +--- base/trace_event/malloc_dump_provider.cc.orig 2016-07-20 22:03:18.000000000 +0300 ++++ base/trace_event/malloc_dump_provider.cc 2016-08-14 13:06:10.819247000 +0300 +@@ -20,7 +20,7 @@ + #if defined(OS_MACOSX) + #include + #else +-#include ++#include + #endif + + namespace base { Index: head/www/chromium/files/patch-breakpad_BUILD.gn =================================================================== --- head/www/chromium/files/patch-breakpad_BUILD.gn +++ head/www/chromium/files/patch-breakpad_BUILD.gn @@ -0,0 +1,11 @@ +--- breakpad/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ breakpad/BUILD.gn 2016-09-03 00:07:22.742094000 +0300 +@@ -420,7 +420,7 @@ + } + } + +-if (is_linux || is_android) { ++if (is_linux || is_bsd || is_android) { + if (current_toolchain == host_toolchain) { + executable("symupload") { + sources = [ Index: head/www/chromium/files/patch-build_common.gypi =================================================================== --- head/www/chromium/files/patch-build_common.gypi +++ head/www/chromium/files/patch-build_common.gypi @@ -1,40 +0,0 @@ ---- build/common.gypi.orig 2016-07-22 00:06:49.000000000 -0400 -+++ build/common.gypi 2016-08-03 11:18:18.437811000 -0400 -@@ -726,6 +726,12 @@ - 'os_bsd%': 0, - }], - -+ ['OS=="freebsd" or OS=="openbsd"', { -+ 'icu_use_data_file_flag%': 0, -+ }, { -+ 'icu_use_data_file_flag%': 1, -+ }], -+ - # NSS usage. - ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', { - 'use_nss_certs%': 1, -@@ -1303,6 +1309,10 @@ - # able to turn it off for various reasons. - 'linux_disable_pie%': 0, - -+ # XXX(rene) More options, keep them? -+ 'os_ver%': 0, -+ 'use_system_libjpeg%': 0, -+ - # The release channel that this build targets. This is used to restrict - # channel-specific build options, like which installer packages to create. - # The default is 'all', which does no channel-specific filtering. -@@ -4709,6 +4719,13 @@ - 'ldflags': [ - '-Wl,--no-keep-memory', - ], -+ 'ldflags!': [ -+ '-ldl', -+ '-pie' -+ ], -+ 'libraries!': [ -+ '-ldl', -+ ], - }, - }], - # Android-specific options; note that most are set above with Linux. Index: head/www/chromium/files/patch-build_config_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_config_BUILD.gn +++ head/www/chromium/files/patch-build_config_BUILD.gn @@ -0,0 +1,20 @@ +--- build/config/BUILD.gn.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/config/BUILD.gn 2016-10-13 04:42:48.294016000 +0300 +@@ -297,7 +297,7 @@ + # builds, and we have to tell it to turn it off. + defines += [ "_HAS_ITERATOR_DEBUGGING=0" ] + } +- } else if (is_linux && current_cpu == "x64" && enable_iterator_debugging) { ++ } else if ((is_linux || is_bsd) && current_cpu == "x64" && enable_iterator_debugging) { + # Enable libstdc++ debugging facilities to help catch problems early, see + # http://crbug.com/65151 . + # TODO(phajdan.jr): Should we enable this for all of POSIX? +@@ -411,7 +411,7 @@ + ] + } else if (is_ios) { + configs += [ "//build/config/ios:ios_dynamic_flags" ] +- } else if (is_linux || is_android) { ++ } else if (is_linux || is_android || is_bsd) { + configs += [ "//build/config/gcc:executable_ldconfig" ] + if (is_android) { + configs += [ "//build/config/android:executable_config" ] Index: head/www/chromium/files/patch-build_config_BUILDCONFIG.gn =================================================================== --- head/www/chromium/files/patch-build_config_BUILDCONFIG.gn +++ head/www/chromium/files/patch-build_config_BUILDCONFIG.gn @@ -0,0 +1,66 @@ +--- build/config/BUILDCONFIG.gn.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/config/BUILDCONFIG.gn 2016-10-13 04:48:31.029743000 +0300 +@@ -134,12 +134,13 @@ + is_debug = !is_official_build + + # Whether we're a traditional desktop unix. +- is_desktop_linux = current_os == "linux" ++ is_desktop_linux = current_os == "linux" || current_os == "bsd" + + # Set to true when compiling with the Clang compiler. Typically this is used + # to configure warnings. + is_clang = current_os == "mac" || current_os == "ios" || +- current_os == "linux" || current_os == "chromeos" ++ current_os == "linux" || current_os == "chromeos" || ++ current_os == "bsd" + + # Allows the path to a custom target toolchain to be injected as a single + # argument, and set as the default toolchain. +@@ -183,8 +184,8 @@ + # TODO(dpranke): Add some sort of assert here that verifies that + # no toolchain omitted host_toolchain from its toolchain_args(). + +- if (host_os == "linux") { +- if (target_os != "linux") { ++ if (host_os == "linux" || host_os == "bsd") { ++ if (target_os != "linux" || target_os != "bsd") { + # TODO(dpranke) - is_clang normally applies only to the target + # build, and there is no way to indicate that you want to override + # it for both the target build *and* the host build. Do we need to +@@ -220,7 +221,7 @@ + } else { + _default_toolchain = "//build/toolchain/android:$target_cpu" + } +-} else if (target_os == "chromeos" || target_os == "linux") { ++} else if (target_os == "chromeos" || target_os == "linux" || target_os == "bsd") { + # See comments in build/toolchain/cros/BUILD.gn about board compiles. + if (is_clang) { + _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" +@@ -340,8 +341,17 @@ + is_nacl = false + is_posix = true + is_win = false ++} else if (current_os == "bsd") { ++ is_android = false ++ is_chromeos = false ++ is_ios = false ++ is_linux = false ++ is_bsd = true ++ is_mac = false ++ is_nacl = false ++ is_posix = true ++ is_win = false + } +- + # ============================================================================= + # SOURCES FILTERS + # ============================================================================= +@@ -410,7 +420,7 @@ + if (!is_mac && !is_ios) { + sources_assignment_filter += [ "*.mm" ] + } +-if (!is_linux) { ++if (!is_linux && !is_bsd) { + sources_assignment_filter += [ + "*_linux.h", + "*_linux.cc", Index: head/www/chromium/files/patch-build_config_allocator.gni =================================================================== --- head/www/chromium/files/patch-build_config_allocator.gni +++ head/www/chromium/files/patch-build_config_allocator.gni @@ -0,0 +1,11 @@ +--- build/config/allocator.gni.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/config/allocator.gni 2016-10-13 10:29:19.634367000 +0300 +@@ -44,7 +44,7 @@ + assert(!is_win || use_allocator == "none", "Tcmalloc doesn't work on Windows.") + + assert( +- !use_experimental_allocator_shim || is_linux || is_android || is_win, ++ !use_experimental_allocator_shim || is_linux || is_android || is_win || is_bsd, + "use_experimental_allocator_shim supported only on Linux, Android and Windows targets") + + if (is_win && use_experimental_allocator_shim) { Index: head/www/chromium/files/patch-build_config_clang_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_config_clang_BUILD.gn +++ head/www/chromium/files/patch-build_config_clang_BUILD.gn @@ -0,0 +1,20 @@ +--- build/config/clang/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/clang/BUILD.gn 2016-09-03 01:38:15.236274000 +0300 +@@ -21,7 +21,7 @@ + "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib", + root_build_dir), + ] +- } else if (is_linux || is_android) { ++ } else if (is_linux || is_bsd || is_android) { + cflags += [ + "-Xclang", + "-load", +@@ -51,7 +51,7 @@ + "check-implicit-copy-ctors", + ] + +- if ((is_linux || is_android) && !is_chromecast) { ++ if ((is_linux || is_bsd || is_android) && !is_chromecast) { + cflags += [ + "-Xclang", + "-plugin-arg-find-bad-constructs", Index: head/www/chromium/files/patch-build_config_compiler_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_config_compiler_BUILD.gn +++ head/www/chromium/files/patch-build_config_compiler_BUILD.gn @@ -0,0 +1,100 @@ +--- build/config/compiler/BUILD.gn.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/config/compiler/BUILD.gn 2016-10-24 23:25:32.101459000 +0300 +@@ -141,7 +141,7 @@ + configs += [ "//build/config/win:compiler" ] + } else if (is_android) { + configs += [ "//build/config/android:compiler" ] +- } else if (is_linux) { ++ } else if (is_linux || is_bsd) { + configs += [ "//build/config/linux:compiler" ] + } else if (is_nacl) { + configs += [ "//build/config/nacl:compiler" ] +@@ -271,7 +271,7 @@ + + # Linux/Android common flags setup. + # --------------------------------- +- if (is_linux || is_android) { ++ if (is_linux || is_bsd || is_android) { + cflags += [ + "-fPIC", + "-pipe", # Use pipes for communicating between sub-processes. Faster. +@@ -376,14 +376,14 @@ + # clang-cl (used if is_win) doesn't expose this flag. + # Currently disabled for nacl since its toolchain lacks this flag (too old). + # TODO(zforman): Once nacl's toolchain is updated, remove check. +- if (is_clang && is_linux) { ++ if (is_clang && (is_linux || is_bsd)) { + absolute_path = rebase_path("//.") + cflags += [ "-fdebug-prefix-map=$absolute_path=." ] + } + + # C++11 compiler flags setup. + # --------------------------- +- if (is_linux || is_android || (is_nacl && is_clang)) { ++ if (is_linux || is_bsd || is_android || (is_nacl && is_clang)) { + # gnu++11 instead of c++11 is needed because some code uses typeof() (a + # GNU extension). + # TODO(thakis): Eventually switch this to c++11 instead, +@@ -441,7 +441,7 @@ + ldflags += [ "-flto" ] + + # Apply a lower LTO optimization level as the default is too slow. +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (use_lld) { + ldflags += [ "-Wl,--lto-O1" ] + } else { +@@ -460,7 +460,7 @@ + # targeting ARM, without this flag, LTO produces a .text section that is + # larger than the maximum call displacement, preventing the linker from + # relocating calls (http://llvm.org/PR22999). +- if (is_linux) { ++ if (is_linux || is_bsd) { + ldflags += [ "-Wl,-plugin-opt,-function-sections" ] + } + +@@ -738,7 +738,7 @@ + # configs -= [ "//build/config/compiler:clang_stackrealign" ] + # See https://crbug.com/556393 for details of where it must be avoided. + config("clang_stackrealign") { +- if (is_clang && current_cpu == "x86" && is_linux) { ++ if (is_clang && current_cpu == "x86" && (is_linux || is_bsd)) { + cflags = [ + # Align the stack on 16-byte boundaries, http://crbug.com/418554. + "-mstack-alignment=16", +@@ -773,7 +773,7 @@ + # smaller. + if (is_win) { + configs += [ "//build/config/win:runtime_library" ] +- } else if (is_linux) { ++ } else if (is_linux || is_bsd) { + configs += [ "//build/config/linux:runtime_library" ] + } else if (is_ios) { + configs += [ "//build/config/ios:runtime_library" ] +@@ -1032,7 +1032,7 @@ + "-Wno-nonportable-include-path", + + # TODO(hans): https://crbug.com/637306 +- "-Wno-address-of-packed-member", ++ # "-Wno-address-of-packed-member", + ] + } + } +@@ -1064,7 +1064,7 @@ + ] + + if (!is_debug && !using_sanitizer && +- (!is_linux || !is_clang || is_official_build)) { ++ (!is_linux || !is_bsd || !is_clang || is_official_build)) { + # _FORTIFY_SOURCE isn't really supported by Clang now, see + # http://llvm.org/bugs/show_bug.cgi?id=16821. + # It seems to work fine with Ubuntu 12 headers though, so use it in +@@ -1124,7 +1124,7 @@ + ] + } + +- if (is_linux || is_android) { ++ if (is_linux || is_bsd || is_android) { + cflags_cc += [ + # Don't warn about hash_map in third-party code. + "-Wno-deprecated", Index: head/www/chromium/files/patch-build_config_crypto.gni =================================================================== --- head/www/chromium/files/patch-build_config_crypto.gni +++ head/www/chromium/files/patch-build_config_crypto.gni @@ -0,0 +1,8 @@ +--- build/config/crypto.gni.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/crypto.gni 2016-09-03 01:37:11.785915000 +0300 +@@ -20,4 +20,4 @@ + + # True if NSS is used for certificate handling. It is possible to use OpenSSL + # for the crypto library, but NSS for the platform certificate library. +-use_nss_certs = is_linux ++use_nss_certs = is_linux || is_bsd Index: head/www/chromium/files/patch-build_config_features.gni =================================================================== --- head/www/chromium/files/patch-build_config_features.gni +++ head/www/chromium/files/patch-build_config_features.gni @@ -0,0 +1,37 @@ +--- build/config/features.gni.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/features.gni 2016-09-01 02:42:02.955488000 +0300 +@@ -22,7 +22,7 @@ + + declare_args() { + # Multicast DNS. +- enable_mdns = is_win || is_linux ++ enable_mdns = is_win || is_linux || is_bsd + + enable_extensions = !is_android && !is_ios + enable_plugins = (!is_android && !is_ios) || is_chromecast +@@ -100,13 +100,13 @@ + # libudev usage. This currently only affects the content layer. + use_udev = is_linux && !is_chromecast + +- use_dbus = is_linux && !is_chromecast ++ use_dbus = (is_linux || is_bsd) && !is_chromecast + + # Option controlling the use of GConf (the classic GNOME configuration + # system). +- use_gconf = is_linux && !is_chromeos && !is_chromecast ++ use_gconf = (is_linux || is_bsd) && !is_chromeos && !is_chromecast + +- use_gio = is_linux && !is_chromeos && !is_chromecast ++ use_gio = (is_linux || is_bsd) && !is_chromeos && !is_chromecast + + # Enable basic printing support and UI. + enable_basic_printing = !is_chromeos && !is_chromecast && !is_ios +@@ -126,7 +126,7 @@ + + # Enables the use of CDMs in pepper plugins. + enable_pepper_cdms = +- enable_plugins && (is_linux || is_mac || is_win) && !is_chromecast ++ enable_plugins && (is_linux || is_bsd || is_mac || is_win) && !is_chromecast + + # The seccomp-bpf sandbox is only supported on five architectures + # currently. Index: head/www/chromium/files/patch-build_config_linux_gtk2_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_config_linux_gtk2_BUILD.gn +++ head/www/chromium/files/patch-build_config_linux_gtk2_BUILD.gn @@ -0,0 +1,11 @@ +--- build/config/linux/gtk2/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/linux/gtk2/BUILD.gn 2016-09-02 22:54:36.628597000 +0300 +@@ -4,7 +4,7 @@ + + import("//build/config/linux/pkg_config.gni") + +-assert(is_linux, "This file should only be referenced on Linux") ++assert(is_linux || is_bsd, "This file should only be referenced on Linux") + + # Depend on //build/config/linux/gtk2 to use GTKv2. + # Index: head/www/chromium/files/patch-build_config_linux_gtk3_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_config_linux_gtk3_BUILD.gn +++ head/www/chromium/files/patch-build_config_linux_gtk3_BUILD.gn @@ -0,0 +1,11 @@ +--- build/config/linux/gtk3/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/linux/gtk3/BUILD.gn 2016-09-03 01:35:58.974361000 +0300 +@@ -4,7 +4,7 @@ + + import("//build/config/linux/pkg_config.gni") + +-assert(is_linux, "This file should only be referenced on Linux") ++assert(is_linux || is_bsd, "This file should only be referenced on Linux") + + # Depend on //build/config/linux/gtk3 to use GTKv3. + # Index: head/www/chromium/files/patch-build_config_linux_pkg-config.py =================================================================== --- head/www/chromium/files/patch-build_config_linux_pkg-config.py +++ head/www/chromium/files/patch-build_config_linux_pkg-config.py @@ -0,0 +1,26 @@ +--- build/config/linux/pkg-config.py.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/linux/pkg-config.py 2016-09-04 01:43:37.226981000 +0300 +@@ -57,8 +57,12 @@ + print "You must specify an architecture via -a if using a sysroot." + sys.exit(1) + +- libdir = sysroot + '/usr/' + options.system_libdir + '/pkgconfig' +- libdir += ':' + sysroot + '/usr/share/pkgconfig' ++ if "linux" in sys.platform: ++ libdir = sysroot + '/libdata/' + options.system_libdir + '/pkgconfig' ++ libdir += ':' + sysroot + '/usr/share/pkgconfig' ++ elif "bsd" in sys.platform: ++ libdir = sysroot + '/libdata/pkgconfig' ++ libdir += ':' + '/usr/libdata/pkgconfig' + os.environ['PKG_CONFIG_LIBDIR'] = libdir + return libdir + +@@ -107,7 +111,7 @@ + # 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 "bsd" not in sys.platform: + print "[[],[],[],[],[]]" + return 0 + Index: head/www/chromium/files/patch-build_config_sanitizers_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_config_sanitizers_BUILD.gn +++ head/www/chromium/files/patch-build_config_sanitizers_BUILD.gn @@ -0,0 +1,20 @@ +--- build/config/sanitizers/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ build/config/sanitizers/BUILD.gn 2016-09-03 00:19:39.656881000 +0300 +@@ -280,7 +280,7 @@ + + config("msan_flags") { + if (is_msan) { +- assert(is_linux, "msan only supported on linux x86_64") ++ assert(is_linux || is_bsd, "msan only supported on linux x86_64") + msan_blacklist_path = + rebase_path("//tools/msan/blacklist.txt", root_build_dir) + cflags = [ +@@ -293,7 +293,7 @@ + + config("tsan_flags") { + if (is_tsan) { +- assert(is_linux, "tsan only supported on linux x86_64") ++ assert(is_linux || is_bsd, "tsan only supported on linux x86_64") + tsan_blacklist_path = + rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir) + cflags = [ Index: head/www/chromium/files/patch-build_config_sanitizers_sanitizers.gni =================================================================== --- head/www/chromium/files/patch-build_config_sanitizers_sanitizers.gni +++ head/www/chromium/files/patch-build_config_sanitizers_sanitizers.gni @@ -0,0 +1,13 @@ +--- build/config/sanitizers/sanitizers.gni.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/config/sanitizers/sanitizers.gni 2016-10-24 22:57:06.565590000 +0300 +@@ -53,8 +53,8 @@ + # See http://clang.llvm.org/docs/ControlFlowIntegrity.html + # + # TODO(pcc): Remove this flag if/when CFI is enabled in all official builds. +- is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" && +- is_chrome_branded && is_official_build ++ is_cfi = (target_os == "linux" || target_os == "bsd") && !is_chromeos && ++ target_cpu == "x64" && is_chrome_branded && is_official_build + + # Enable checks for bad casts: derived cast and unrelated cast. + # TODO(krasin): remove this, when we're ready to add these checks by default. Index: head/www/chromium/files/patch-build_config_ui.gni =================================================================== --- head/www/chromium/files/patch-build_config_ui.gni +++ head/www/chromium/files/patch-build_config_ui.gni @@ -0,0 +1,43 @@ +--- build/config/ui.gni.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/config/ui.gni 2016-10-13 05:04:25.545377000 +0300 +@@ -31,7 +31,7 @@ + + # 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 ++ use_aura = is_win || is_linux || is_bsd + + # True means the UI is built using the "views" framework. + toolkit_views = +@@ -47,7 +47,7 @@ + use_xkbcommon = false + + # Whether we should use glib, a low level C utility library. +- use_glib = is_linux ++ use_glib = is_linux || is_bsd + + # Indicates if Wayland display server support is enabled. + enable_wayland_server = is_chromeos +@@ -65,19 +65,19 @@ + + # Use GPU accelerated cross process image transport by default on linux builds + # with the Aura window manager. +-ui_compositor_image_transport = use_aura && is_linux ++ui_compositor_image_transport = use_aura && (is_linux || is_bsd) + + use_default_render_theme = use_aura && !is_android + + # Indicates if the UI toolkit depends on X11. +-use_x11 = is_linux && !use_ozone ++use_x11 = (is_linux || is_bsd) && !use_ozone + + # Turn off glib if Ozone is enabled. + if (use_ozone) { + use_glib = false + } + +-if (is_linux && !use_ozone) { ++if ((is_linux || is_bsd) && !use_ozone) { + use_cairo = true + use_pango = true + } else { Index: head/www/chromium/files/patch-build_filename__rules.gypi =================================================================== --- head/www/chromium/files/patch-build_filename__rules.gypi +++ head/www/chromium/files/patch-build_filename__rules.gypi @@ -1,11 +0,0 @@ ---- build/filename_rules.gypi.orig 2016-04-08 16:02:06 UTC -+++ build/filename_rules.gypi -@@ -89,7 +89,7 @@ - ['exclude', '_ashwin\\.(h|cc)$'] - ] - }], -- ['<(use_aura)==0 or OS!="linux" or >(nacl_untrusted_build)==1', { -+ ['<(use_aura)==0 or (OS!="linux" and OS!="openbsd" and OS!="freebsd") or >(nacl_untrusted_build)==1', { - 'sources/': [ ['exclude', '_auralinux\\.(h|cc)$'] ] - }], - ['<(use_ozone)==0 or >(nacl_untrusted_build)==1', { Index: head/www/chromium/files/patch-build_linux_libpci_BUILD.gn =================================================================== --- head/www/chromium/files/patch-build_linux_libpci_BUILD.gn +++ head/www/chromium/files/patch-build_linux_libpci_BUILD.gn @@ -0,0 +1,54 @@ +--- build/linux/libpci/BUILD.gn.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/linux/libpci/BUILD.gn 2016-10-29 18:17:51.990988000 +0300 +@@ -3,20 +3,36 @@ + # found in the LICENSE file. + + import("//tools/generate_library_loader/generate_library_loader.gni") ++import("//build/config/linux/pkg_config.gni") + +-# This generates a target named "libpci". +-generate_library_loader("libpci") { +- name = "LibPciLoader" +- output_h = "libpci.h" +- output_cc = "libpci_loader.cc" +- header = "" +- +- functions = [ +- "pci_alloc", +- "pci_init", +- "pci_cleanup", +- "pci_scan_bus", +- "pci_fill_info", +- "pci_lookup_name", +- ] ++declare_args() { ++ use_system_libpci = is_bsd ++} ++ ++if (use_system_libpci) { ++ pkg_config("system_libpci") { ++ packages = [ "libpci" ] ++ } ++ ++ source_set("libpci") { ++ public_configs = [ ":system_libpci" ] ++ } ++ ++} else { ++ # This generates a target named "libpci". ++ generate_library_loader("libpci") { ++ name = "LibPciLoader" ++ output_h = "libpci.h" ++ output_cc = "libpci_loader.cc" ++ header = "" ++ ++ functions = [ ++ "pci_alloc", ++ "pci_init", ++ "pci_cleanup", ++ "pci_scan_bus", ++ "pci_fill_info", ++ "pci_lookup_name", ++ ] ++ } + } Index: head/www/chromium/files/patch-build_linux_system.gyp =================================================================== --- head/www/chromium/files/patch-build_linux_system.gyp +++ head/www/chromium/files/patch-build_linux_system.gyp @@ -1,16 +0,0 @@ ---- build/linux/system.gyp.orig 2016-05-11 19:02:12 UTC -+++ build/linux/system.gyp -@@ -1051,6 +1051,13 @@ - 'include_dirs': [ - '../..', - ], -+ 'conditions' : [ -+ ['OS=="freebsd"', { -+ 'include_dirs': [ -+ '<(prefix_dir)/include', -+ ], -+ }], -+ ], - 'hard_dependency': 1, - 'actions': [ - { Index: head/www/chromium/files/patch-build_linux_unbundle_libwebp.gyp =================================================================== --- head/www/chromium/files/patch-build_linux_unbundle_libwebp.gyp +++ head/www/chromium/files/patch-build_linux_unbundle_libwebp.gyp @@ -1,17 +0,0 @@ ---- build/linux/unbundle/libwebp.gyp.orig 2016-03-25 13:04:44 UTC -+++ build/linux/unbundle/libwebp.gyp -@@ -14,13 +14,7 @@ - }, - 'link_settings': { - 'libraries': [ -- # Check for presence of webpdemux library, use it if present. -- '= clang39") ++ # cxx = getenv("CXX") ++ # assert(cxx != "", "CXX env must me set with >= clang++39") ++ # ld = cxx ++ cc = "${toolprefix}clang39" ++ cxx = "${toolprefix}clang++39" ++ ld = cxx ++ readelf = "readelf" ++ ar = "${toolprefix}llvm-ar39" ++ nm = "${toolprefix}llvm-nm39" ++ } else { ++ prefix = rebase_path("$clang_base_path/bin", root_build_dir) ++ cc = "$prefix/clang" ++ cxx = "$prefix/clang++" ++ ld = cxx + +- readelf = "${toolprefix}readelf" +- ar = "${toolprefix}ar" +- nm = "${toolprefix}nm" ++ readelf = "${toolprefix}readelf" ++ ar = "${toolprefix}ar" ++ nm = "${toolprefix}nm" ++ } + + forward_variables_from(invoker, [ "strip" ]) + Index: head/www/chromium/files/patch-build_toolchain_get__concurrent__links.py =================================================================== --- head/www/chromium/files/patch-build_toolchain_get__concurrent__links.py +++ head/www/chromium/files/patch-build_toolchain_get__concurrent__links.py @@ -0,0 +1,17 @@ +--- build/toolchain/get_concurrent_links.py.orig 2016-10-06 04:02:08.000000000 +0300 ++++ build/toolchain/get_concurrent_links.py 2016-10-13 05:28:45.448027000 +0300 +@@ -45,6 +45,14 @@ + return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize'])) + except Exception: + return 0 ++ elif sys.platform.startswith('freebsd'): ++ try: ++ avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.physmem'])) ++ # With -fuse-lld it doesn't take a lot of ram, feel free to change that ++ # 1 * ... to needed amount ++ return max(1, avail_bytes / (1 * (2 ** 30))) # total / 4GB ++ except Exception: ++ return 1 + # TODO(scottmg): Implement this for other platforms. + return 0 + Index: head/www/chromium/files/patch-chrome_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_BUILD.gn +++ head/www/chromium/files/patch-chrome_BUILD.gn @@ -0,0 +1,29 @@ +--- chrome/BUILD.gn.orig 2016-08-03 22:02:10.000000000 +0300 ++++ chrome/BUILD.gn 2016-09-03 00:02:50.206193000 +0300 +@@ -86,7 +86,7 @@ + data = [ + "$root_out_dir/resources.pak", + ] +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/locales/en-US.pak", +@@ -160,7 +160,7 @@ + sources += [ "app/chrome_exe_main_aura.cc" ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ + "app/chrome_dll_resource.h", + "app/chrome_main.cc", +@@ -1461,7 +1461,7 @@ + } + } + +-if (is_linux) { ++if (is_linux || is_bsd) { + action("manpage") { + if (is_chrome_branded) { + name = "Google Chrome" Index: head/www/chromium/files/patch-chrome_app_chrome__command__ids.h =================================================================== --- head/www/chromium/files/patch-chrome_app_chrome__command__ids.h +++ head/www/chromium/files/patch-chrome_app_chrome__command__ids.h @@ -0,0 +1,11 @@ +--- chrome/app/chrome_command_ids.h.orig 2016-10-06 04:02:10.000000000 +0300 ++++ chrome/app/chrome_command_ids.h 2016-10-14 06:38:03.530973000 +0300 +@@ -75,7 +75,7 @@ + #define IDC_VISIT_DESKTOP_OF_LRU_USER_2 34049 + #define IDC_VISIT_DESKTOP_OF_LRU_USER_3 34050 + +-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) + #define IDC_USE_SYSTEM_TITLE_BAR 34051 + #endif + Index: head/www/chromium/files/patch-chrome_app_generated__resources.grd =================================================================== --- head/www/chromium/files/patch-chrome_app_generated__resources.grd +++ head/www/chromium/files/patch-chrome_app_generated__resources.grd @@ -1,11 +1,38 @@ ---- chrome/app/generated_resources.grd.orig 2016-05-11 19:02:13 UTC -+++ chrome/app/generated_resources.grd -@@ -6564,7 +6564,7 @@ Keep your key file in a safe place. You +--- chrome/app/generated_resources.grd.orig 2016-10-06 04:02:10.000000000 +0300 ++++ chrome/app/generated_resources.grd 2016-10-14 07:09:15.305398000 +0300 +@@ -6841,7 +6841,7 @@ Right-to-left - -+ ++ Enable Input IME API +@@ -10134,7 +10134,7 @@ + + Appearance + +- ++ + + Themes + +@@ -10142,7 +10142,7 @@ + + Reset to default theme + +- ++ + + Use GTK+ theme + +@@ -11429,7 +11429,7 @@ + Set as default + + +- ++ + + Use system title bar and borders + Index: head/www/chromium/files/patch-chrome_browser_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_browser_BUILD.gn +++ head/www/chromium/files/patch-chrome_browser_BUILD.gn @@ -0,0 +1,52 @@ +--- chrome/browser/BUILD.gn.orig 2016-08-03 22:02:11.000000000 +0300 ++++ chrome/browser/BUILD.gn 2016-09-27 09:40:30.879973000 +0300 +@@ -540,7 +540,7 @@ + deps += [ "//device/udev_linux" ] + } + +- if (is_linux && !is_chromeos) { ++ if ((is_linux || is_bsd) && !is_chromeos) { + deps += [ "//third_party/speech-dispatcher" ] + } + +@@ -730,6 +730,22 @@ + sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources, + ".", + "//chrome") ++ if (is_bsd) { ++ sources -= [ ++ "media_galleries/linux/mtp_device_delegate_impl_linux.cc", ++ "media_galleries/linux/mtp_device_delegate_impl_linux.h", ++ "media_galleries/linux/mtp_device_object_enumerator.cc", ++ "media_galleries/linux/mtp_device_object_enumerator.h", ++ "media_galleries/linux/mtp_device_task_helper.cc", ++ "media_galleries/linux/mtp_device_task_helper.h", ++ "media_galleries/linux/mtp_device_task_helper_map_service.cc", ++ "media_galleries/linux/mtp_device_task_helper_map_service.h", ++ "media_galleries/linux/mtp_read_file_worker.cc", ++ "media_galleries/linux/mtp_read_file_worker.h", ++ "media_galleries/linux/snapshot_file_details.cc", ++ "media_galleries/linux/snapshot_file_details.h", ++ ] ++ } + } + + if (!is_chrome_branded) { +@@ -857,7 +873,7 @@ + } + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (use_aura) { + configs += [ "//build/config/linux/dbus" ] + deps += [ +@@ -871,7 +887,7 @@ + } + } + +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + sources += rebase_path(gypi_values.chrome_browser_non_mac_desktop_sources, + ".", + "//chrome") Index: head/www/chromium/files/patch-chrome_browser_browser__process__impl.h =================================================================== --- head/www/chromium/files/patch-chrome_browser_browser__process__impl.h +++ head/www/chromium/files/patch-chrome_browser_browser__process__impl.h @@ -0,0 +1,11 @@ +--- chrome/browser/browser_process_impl.h.orig 2016-10-06 04:02:11.000000000 +0300 ++++ chrome/browser/browser_process_impl.h 2016-10-16 22:37:41.017296000 +0300 +@@ -336,7 +336,7 @@ + + std::unique_ptr device_client_; + +-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ++#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) + // Any change to this #ifdef must be reflected as well in + // chrome/browser/memory/tab_manager_browsertest.cc + std::unique_ptr tab_manager_; Index: head/www/chromium/files/patch-chrome_browser_browser__process__impl.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_browser__process__impl.cc +++ head/www/chromium/files/patch-chrome_browser_browser__process__impl.cc @@ -0,0 +1,20 @@ +--- chrome/browser/browser_process_impl.cc.orig 2016-10-06 04:02:11.000000000 +0300 ++++ chrome/browser/browser_process_impl.cc 2016-10-16 22:35:35.925144000 +0300 +@@ -161,7 +161,7 @@ + #include "chrome/browser/media/webrtc_log_uploader.h" + #endif + +-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ++#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) + #include "chrome/browser/memory/tab_manager.h" + #endif + +@@ -765,7 +765,7 @@ + + memory::TabManager* BrowserProcessImpl::GetTabManager() { + DCHECK(CalledOnValidThread()); +-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ++#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) + if (!tab_manager_.get()) + tab_manager_.reset(new memory::TabManager()); + return tab_manager_.get(); Index: head/www/chromium/files/patch-chrome_browser_browser__resources.grd =================================================================== --- head/www/chromium/files/patch-chrome_browser_browser__resources.grd +++ head/www/chromium/files/patch-chrome_browser_browser__resources.grd @@ -1,11 +0,0 @@ ---- chrome/browser/browser_resources.grd.orig 2016-05-11 19:02:13 UTC -+++ chrome/browser/browser_resources.grd -@@ -280,7 +280,7 @@ - - - -- -+ - - - Index: head/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn +++ head/www/chromium/files/patch-chrome_browser_extensions_BUILD.gn @@ -0,0 +1,24 @@ +--- chrome/browser/extensions/BUILD.gn.orig 2016-10-06 04:02:11.000000000 +0300 ++++ chrome/browser/extensions/BUILD.gn 2016-10-13 05:50:49.572236000 +0300 +@@ -186,7 +186,7 @@ + sources -= [ "global_shortcut_listener_ozone.cc" ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + deps += [ "//build/linux:fontconfig" ] + + if (use_dbus) { +@@ -252,6 +252,12 @@ + defines += [ "ENABLE_HOTWORDING" ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "api/image_writer_private/removable_storage_provider_linux.cc", ++ ] ++ } ++ + if (enable_service_discovery) { + sources += rebase_path( + gypi_values.chrome_browser_extensions_service_discovery_sources, Index: head/www/chromium/files/patch-chrome_browser_extensions_window__open__apitest.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_extensions_window__open__apitest.cc +++ head/www/chromium/files/patch-chrome_browser_extensions_window__open__apitest.cc @@ -1,11 +0,0 @@ ---- chrome/browser/extensions/window_open_apitest.cc.orig 2016-05-11 19:02:14 UTC -+++ chrome/browser/extensions/window_open_apitest.cc -@@ -285,7 +285,7 @@ IN_PROC_BROWSER_TEST_F(WindowOpenPanelTe - << message_; - } - --#if defined(USE_ASH_PANELS) || defined(OS_LINUX) -+#if defined(USE_ASH_PANELS) || defined(OS_LINUX) || defined(OS_FREEBSD) - // On Ash, this currently fails because we're currently opening new panel - // windows as popup windows instead. - // We're also failing on Linux-aura due to the panel is not opened in the Index: head/www/chromium/files/patch-chrome_browser_memory__details.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_memory__details.cc +++ head/www/chromium/files/patch-chrome_browser_memory__details.cc @@ -1,6 +1,6 @@ ---- chrome/browser/memory_details.cc.orig 2016-05-11 19:02:14 UTC -+++ chrome/browser/memory_details.cc -@@ -33,7 +33,7 @@ +--- chrome/browser/memory_details.cc.orig 2016-08-03 22:02:12.000000000 +0300 ++++ chrome/browser/memory_details.cc 2016-09-30 22:07:01.106885000 +0300 +@@ -32,7 +32,7 @@ #include "content/public/common/content_constants.h" #include "ui/base/l10n/l10n_util.h" @@ -9,8 +9,8 @@ #include "content/public/browser/zygote_host_linux.h" #endif -@@ -365,7 +365,7 @@ void MemoryDetails::CollectChildInfoOnUI - } +@@ -334,7 +334,7 @@ + process.titles.push_back(title); } -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) Index: head/www/chromium/files/patch-chrome_browser_resources_safe__browsing_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_browser_resources_safe__browsing_BUILD.gn +++ head/www/chromium/files/patch-chrome_browser_resources_safe__browsing_BUILD.gn @@ -0,0 +1,11 @@ +--- chrome/browser/resources/safe_browsing/BUILD.gn.orig 2016-08-03 22:02:13.000000000 +0300 ++++ chrome/browser/resources/safe_browsing/BUILD.gn 2016-09-20 02:51:43.112078000 +0300 +@@ -26,6 +26,8 @@ + target_arch = "mac" + } else if (is_linux) { + target_arch = "linux" ++ } else if (is_bsd) { ++ target_arch = "bsd" + } else { + # This will cause the script to fail. + target_arch = "unknown_target_arch" Index: head/www/chromium/files/patch-chrome_browser_resources_safe__browsing_gen__file__type__proto.py =================================================================== --- head/www/chromium/files/patch-chrome_browser_resources_safe__browsing_gen__file__type__proto.py +++ head/www/chromium/files/patch-chrome_browser_resources_safe__browsing_gen__file__type__proto.py @@ -1,10 +1,10 @@ ---- chrome/browser/resources/safe_browsing/gen_file_type_proto.py.orig 2016-08-04 11:13:17.290964000 -0400 -+++ chrome/browser/resources/safe_browsing/gen_file_type_proto.py 2016-08-04 11:13:54.901432000 -0400 +--- chrome/browser/resources/safe_browsing/gen_file_type_proto.py.orig 2016-08-03 22:02:13.000000000 +0300 ++++ chrome/browser/resources/safe_browsing/gen_file_type_proto.py 2016-09-20 02:52:27.389763000 +0300 @@ -39,6 +39,7 @@ "android": config_pb2.DownloadFileType.PLATFORM_ANDROID, "chromeos": config_pb2.DownloadFileType.PLATFORM_CHROME_OS, "linux": config_pb2.DownloadFileType.PLATFORM_LINUX, -+ "freebsd": config_pb2.DownloadFileType.PLATFORM_LINUX, ++ "bsd": config_pb2.DownloadFileType.PLATFORM_LINUX, "mac": config_pb2.DownloadFileType.PLATFORM_MAC, "win": config_pb2.DownloadFileType.PLATFORM_WINDOWS, } @@ -13,7 +13,7 @@ parser.add_option('-t', '--type', help='The platform type. One of android, chromeos, ' + - 'linux, mac, win') -+ 'linux, freebsd, mac, win') ++ 'linux, bsd, mac, win') parser.add_option('-i', '--infile', help='The ASCII DownloadFileType-proto file to read.') parser.add_option('-o', '--outfile', Index: head/www/chromium/files/patch-chrome_browser_safe__browsing_permission__reporter.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_safe__browsing_permission__reporter.cc +++ head/www/chromium/files/patch-chrome_browser_safe__browsing_permission__reporter.cc @@ -0,0 +1,11 @@ +--- chrome/browser/safe_browsing/permission_reporter.cc.orig 2016-10-06 04:02:12.000000000 +0300 ++++ chrome/browser/safe_browsing/permission_reporter.cc 2016-10-14 06:15:01.051089000 +0300 +@@ -190,7 +190,7 @@ + #if defined(OS_ANDROID) + report.set_platform_type(PermissionReport::ANDROID_PLATFORM); + #elif defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_CHROMEOS) || \ +- defined(OS_LINUX) ++ defined(OS_LINUX) || defined(OS_BSD) + report.set_platform_type(PermissionReport::DESKTOP_PLATFORM); + #else + #error Unsupported platform. Index: head/www/chromium/files/patch-chrome_browser_ui_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_BUILD.gn +++ head/www/chromium/files/patch-chrome_browser_ui_BUILD.gn @@ -0,0 +1,11 @@ +--- chrome/browser/ui/BUILD.gn.orig 2016-08-03 22:02:13.000000000 +0300 ++++ chrome/browser/ui/BUILD.gn 2016-09-03 00:04:02.109457000 +0300 +@@ -503,7 +503,7 @@ + "//ui/events:dom_keycode_converter", + ] + } +- if (is_linux) { # Both desktop Linux and ChromeOS. ++ if (is_linux || is_bsd) { # Both desktop Linux and ChromeOS. + sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources, + ".", + "//chrome") Index: head/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc +++ head/www/chromium/files/patch-chrome_browser_ui_browser__command__controller.cc @@ -1,15 +1,15 @@ ---- chrome/browser/ui/browser_command_controller.cc.orig 2016-05-11 19:02:16 UTC -+++ chrome/browser/ui/browser_command_controller.cc -@@ -77,7 +77,7 @@ +--- chrome/browser/ui/browser_command_controller.cc.orig 2016-10-06 04:02:13.000000000 +0300 ++++ chrome/browser/ui/browser_command_controller.cc 2016-10-13 05:57:01.306342000 +0300 +@@ -76,7 +76,7 @@ #include "chrome/browser/ui/browser_commands_chromeos.h" #endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) +#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) - #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" + #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" #endif -@@ -221,7 +221,7 @@ bool BrowserCommandController::IsReserve +@@ -216,7 +216,7 @@ if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) return true; @@ -18,7 +18,7 @@ // If this key was registered by the user as a content editing hotkey, then // it is not reserved. ui::TextEditKeyBindingsDelegateAuraLinux* delegate = -@@ -414,7 +414,7 @@ void BrowserCommandController::ExecuteCo +@@ -419,7 +419,7 @@ break; #endif @@ -27,7 +27,7 @@ case IDC_USE_SYSTEM_TITLE_BAR: { PrefService* prefs = browser_->profile()->GetPrefs(); prefs->SetBoolean(prefs::kUseCustomChromeFrame, -@@ -815,7 +815,7 @@ void BrowserCommandController::InitComma +@@ -812,7 +812,7 @@ command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_2, true); command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_3, true); #endif Index: head/www/chromium/files/patch-chrome_browser_ui_browser__view__prefs.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_browser__view__prefs.cc +++ head/www/chromium/files/patch-chrome_browser_ui_browser__view__prefs.cc @@ -1,5 +1,5 @@ ---- chrome/browser/ui/browser_view_prefs.cc.orig 2016-05-11 19:02:16 UTC -+++ chrome/browser/ui/browser_view_prefs.cc +--- chrome/browser/ui/browser_view_prefs.cc.orig 2016-10-06 04:02:13.000000000 +0300 ++++ chrome/browser/ui/browser_view_prefs.cc 2016-10-13 05:59:52.802478000 +0300 @@ -10,7 +10,7 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" @@ -9,12 +9,12 @@ #include "ui/base/x/x11_util.h" #endif -@@ -43,7 +43,7 @@ void RegisterBrowserViewLocalPrefs(PrefR +@@ -32,7 +32,7 @@ + void RegisterBrowserViewProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { - bool custom_frame_default = false; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) || defined(OS_BSD) - custom_frame_default = ui::GetCustomFramePrefDefault(); ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) + registry->RegisterBooleanPref(prefs::kUseCustomChromeFrame, + ui::GetCustomFramePrefDefault()); #endif - Index: head/www/chromium/files/patch-chrome_browser_ui_libgtk2ui_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_libgtk2ui_BUILD.gn +++ head/www/chromium/files/patch-chrome_browser_ui_libgtk2ui_BUILD.gn @@ -0,0 +1,11 @@ +--- chrome/browser/ui/libgtk2ui/BUILD.gn.orig 2016-08-03 22:02:13.000000000 +0300 ++++ chrome/browser/ui/libgtk2ui/BUILD.gn 2016-09-03 00:03:44.741182000 +0300 +@@ -2,7 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-assert(is_linux, "This file should only be referenced on Linux") ++assert(is_linux || is_bsd, "This file should only be referenced on Linux") + + import("//build/config/features.gni") + import("//build/config/ui.gni") Index: head/www/chromium/files/patch-chrome_browser_ui_panels_panel__manager.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_panels_panel__manager.cc +++ head/www/chromium/files/patch-chrome_browser_ui_panels_panel__manager.cc @@ -1,11 +0,0 @@ ---- chrome/browser/ui/panels/panel_manager.cc.orig 2016-05-11 19:02:16 UTC -+++ chrome/browser/ui/panels/panel_manager.cc -@@ -142,7 +142,7 @@ bool PanelManager::ShouldUsePanels(const - // static - bool PanelManager::IsPanelStackingEnabled() { - // Stacked panel mode is not supported in linux-aura. --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_FREEBSD) - return false; - #else - return true; Index: head/www/chromium/files/patch-chrome_browser_ui_views_first__run__dialog.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_views_first__run__dialog.cc +++ head/www/chromium/files/patch-chrome_browser_ui_views_first__run__dialog.cc @@ -1,20 +1,13 @@ ---- chrome/browser/ui/views/first_run_dialog.cc.orig 2016-05-11 19:02:16 UTC -+++ chrome/browser/ui/views/first_run_dialog.cc -@@ -114,12 +114,16 @@ views::View* FirstRunDialog::CreateExtra - bool FirstRunDialog::Accept() { - GetWidget()->Hide(); +--- chrome/browser/ui/views/first_run_dialog.cc.orig 2016-10-06 04:02:13.000000000 +0300 ++++ chrome/browser/ui/views/first_run_dialog.cc 2016-10-15 10:10:45.850050000 +0300 +@@ -35,8 +35,10 @@ + namespace { -+#if !defined(OS_BSD) - if (report_crashes_ && report_crashes_->checked()) { - if (GoogleUpdateSettings::SetCollectStatsConsent(true)) - breakpad::InitCrashReporter(std::string()); -- } else { -+ } else -+#else -+ { - GoogleUpdateSettings::SetCollectStatsConsent(false); - } + void InitCrashReporterIfEnabled(bool enabled) { ++#ifndef OS_BSD + if (enabled) + breakpad::InitCrashReporter(std::string()); +#endif + } - if (make_default_ && make_default_->checked()) - shell_integration::SetAsDefaultBrowser(); + } // namespace Index: head/www/chromium/files/patch-chrome_browser_ui_views_panels_panel__frame__view.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_views_panels_panel__frame__view.cc +++ head/www/chromium/files/patch-chrome_browser_ui_views_panels_panel__frame__view.cc @@ -1,11 +0,0 @@ ---- chrome/browser/ui/views/panels/panel_frame_view.cc.orig 2016-05-11 19:02:16 UTC -+++ chrome/browser/ui/views/panels/panel_frame_view.cc -@@ -589,7 +589,7 @@ bool PanelFrameView::OnMousePressed(cons - } - - bool PanelFrameView::OnMouseDragged(const ui::MouseEvent& event) { --#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) - // Converting the mouse location to screen coordinates returns an incorrect - // location while the panel is moving. See crbug.com/353393 for more details. - // TODO(pkotwicz): Fix conversion to screen coordinates Index: head/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc =================================================================== --- head/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc +++ head/www/chromium/files/patch-chrome_browser_ui_webui_about__ui.cc @@ -1,40 +1,56 @@ ---- chrome/browser/ui/webui/about_ui.cc.orig 2016-05-11 19:02:16 UTC -+++ chrome/browser/ui/webui/about_ui.cc -@@ -74,7 +74,7 @@ +--- chrome/browser/ui/webui/about_ui.cc.orig 2016-07-20 22:03:21.000000000 +0300 ++++ chrome/browser/ui/webui/about_ui.cc 2016-08-10 15:53:44.885419000 +0300 +@@ -73,7 +73,7 @@ #include "chrome/browser/ui/webui/theme_source.h" #endif - + -#if defined(OS_LINUX) || defined(OS_OPENBSD) +#if defined(OS_LINUX) || defined(OS_BSD) #include "content/public/browser/zygote_host_linux.h" #include "content/public/common/sandbox_linux.h" #endif -@@ -707,7 +707,7 @@ void FinishMemoryDataRequest( - } - } - +@@ -642,7 +642,7 @@ + DISALLOW_COPY_AND_ASSIGN(AboutDnsHandler); + }; + -#if defined(OS_LINUX) || defined(OS_OPENBSD) +#if defined(OS_LINUX) || defined(OS_BSD) std::string AboutLinuxProxyConfig() { std::string data; AppendHeader(&data, 0, -@@ -723,6 +723,7 @@ std::string AboutLinuxProxyConfig() { +@@ -658,6 +658,7 @@ return data; } - + +#if !defined(OS_BSD) void AboutSandboxRow(std::string* data, int name_id, bool good) { data->append(""); data->append(l10n_util::GetStringUTF8(name_id)); -@@ -791,6 +792,7 @@ std::string AboutSandbox() { - return data; +@@ -672,6 +673,7 @@ + } + data->append(""); } - #endif +#endif - - // AboutMemoryHandler ---------------------------------------------------------- - -@@ -963,7 +965,7 @@ void AboutUIHTMLSource::StartDataRequest + + std::string AboutSandbox() { + std::string data; +@@ -681,6 +683,7 @@ + data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_TITLE)); + data.append(""); + ++#if !defined(OS_BSD) + // Get expected sandboxing status of renderers. + const int status = + content::ZygoteHost::GetInstance()->GetRendererSandboxStatus(); +@@ -721,6 +724,7 @@ + data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_BAD)); + } + data.append("

"); ++#endif + + AppendFooter(&data); + return data; +@@ -769,7 +773,7 @@ } else if (source_name_ == chrome::kChromeUIDNSHost) { AboutDnsHandler::Start(profile(), callback); return; @@ -43,12 +59,12 @@ } else if (source_name_ == chrome::kChromeUILinuxProxyConfigHost) { response = AboutLinuxProxyConfig(); #endif -@@ -977,7 +979,7 @@ void AboutUIHTMLSource::StartDataRequest +@@ -778,7 +782,7 @@ ChromeOSCreditsHandler::Start(path, callback); return; #endif -#if defined(OS_LINUX) || defined(OS_OPENBSD) -+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_FREEBSD) ++#if defined(OS_LINUX) || defined(OS_BSD) } else if (source_name_ == chrome::kChromeUISandboxHost) { response = AboutSandbox(); #endif Index: head/www/chromium/files/patch-chrome_chrome__browser.gypi =================================================================== --- head/www/chromium/files/patch-chrome_chrome__browser.gypi +++ head/www/chromium/files/patch-chrome_chrome__browser.gypi @@ -1,51 +0,0 @@ ---- chrome/chrome_browser.gypi.orig 2016-05-11 19:02:17 UTC -+++ chrome/chrome_browser.gypi -@@ -3638,7 +3638,7 @@ - '../device/media_transfer_protocol/media_transfer_protocol.gyp:device_media_transfer_protocol', - ], - }], -- ['OS=="linux" and chromeos==0', { -+ ['(OS=="linux" and chromeos==0) or os_bsd==1', { - 'dependencies': [ - '../build/linux/system.gyp:libspeechd', - ], -@@ -3702,7 +3702,7 @@ - ['use_x11==1', { - 'sources': [ '<@(chrome_browser_x11_sources)' ], - }], -- ['os_posix == 1 and OS != "mac" and OS != "ios"', { -+ ['os_posix == 1 and OS != "mac" and OS != "ios" and os_bsd != 1', { - 'sources': [ - 'app/chrome_crash_reporter_client.cc', - 'app/chrome_crash_reporter_client.h', -@@ -3834,6 +3834,12 @@ - }], - ], - }], -+ ['os_bsd==1', { -+ 'sources/': [ -+ ['exclude', '^browser/media_galleries/linux/'], -+ ['exclude', '^browser/memory/system_memory_stats_recorder_linux.cc'], -+ ], -+ }], - ['OS=="mac"', { - 'dependencies': [ - '../third_party/google_toolbox_for_mac/google_toolbox_for_mac.gyp:google_toolbox_for_mac', -@@ -3943,7 +3949,7 @@ - }], - ], - }], -- ['OS=="linux"', { -+ ['OS=="linux" or os_bsd==1', { - 'conditions': [ - ['use_aura==1', { - 'dependencies': [ -@@ -3962,7 +3968,7 @@ - }], - ], - }], -- ['OS=="linux" or OS=="win"', { -+ ['OS=="linux" or OS=="win" or os_bsd==1', { - 'sources': [ '<@(chrome_browser_non_mac_desktop_sources)' ], - }], - ['desktop_linux==1', { Index: head/www/chromium/files/patch-chrome_chrome__browser__extensions.gypi =================================================================== --- head/www/chromium/files/patch-chrome_chrome__browser__extensions.gypi +++ head/www/chromium/files/patch-chrome_chrome__browser__extensions.gypi @@ -1,23 +0,0 @@ ---- chrome/chrome_browser_extensions.gypi.orig 2016-05-25 15:00:58.000000000 -0400 -+++ chrome/chrome_browser_extensions.gypi 2016-05-27 09:56:46.969693000 -0400 -@@ -1019,6 +1019,11 @@ - '<@(chrome_browser_extensions_task_manager_enabled_sources)', - ], - }], -+ ['os_bsd==1', { -+ 'sources/': [ -+ ['exclude', '^browser/extensions/api/image_writer_private/removable_storage_provider_linux.cc'], -+ ], -+ }], - ['chromeos==1', { - 'dependencies': [ - '../build/linux/system.gyp:dbus', -@@ -1061,7 +1066,7 @@ - '../ui/views/views.gyp:views', - ], - }], -- ['OS=="linux"', { -+ ['OS=="linux" or os_bsd==1', { - 'conditions': [ - ['use_aura==1', { - 'dependencies': [ Index: head/www/chromium/files/patch-chrome_chrome__browser__ui.gypi =================================================================== --- head/www/chromium/files/patch-chrome_chrome__browser__ui.gypi +++ head/www/chromium/files/patch-chrome_chrome__browser__ui.gypi @@ -1,20 +0,0 @@ ---- chrome/chrome_browser_ui.gypi.orig 2016-05-11 19:02:17 UTC -+++ chrome/chrome_browser_ui.gypi -@@ -3069,7 +3069,7 @@ - }], - ], - }], -- ['use_aura==1 and chromeos==0 and use_ozone==0 and OS=="linux"', { -+ ['use_aura==1 and chromeos==0 and use_ozone==0 and (OS=="linux" or OS=="freebsd" or OS=="openbsd")', { - 'dependencies': [ - # gtk2 is the only component that can interact with gtk2 in our new - # world. -@@ -3251,7 +3251,7 @@ - ], - 'sources': [ '<@(chrome_browser_ui_desktop_linux_sources)' ], - }], -- ['OS=="linux"', { # Both desktop Linux and ChromeOS. -+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { # Both desktop Linux and ChromeOS. - 'sources': [ '<@(chrome_browser_ui_linux_sources)' ], - 'conditions': [ - ['use_aura==1', { Index: head/www/chromium/files/patch-chrome_chrome__common.gypi =================================================================== --- head/www/chromium/files/patch-chrome_chrome__common.gypi +++ head/www/chromium/files/patch-chrome_chrome__common.gypi @@ -1,22 +0,0 @@ ---- chrome/chrome_common.gypi.orig 2016-05-11 19:02:17 UTC -+++ chrome/chrome_common.gypi -@@ -30,8 +30,8 @@ - 'common/common_param_traits.cc', - 'common/common_param_traits.h', - 'common/common_param_traits_macros.h', -- 'common/component_flash_hint_file_linux.cc', -- 'common/component_flash_hint_file_linux.h', -+# 'common/component_flash_hint_file_linux.cc', -+# 'common/component_flash_hint_file_linux.h', - 'common/content_restriction.h', - 'common/content_settings_pattern_serializer.cc', - 'common/content_settings_pattern_serializer.h', -@@ -381,7 +381,7 @@ - ['chromeos==1', { - 'sources': [ '<@(chrome_common_extensions_chromeos_sources)' ], - }], -- ['OS=="win" or OS=="linux"', { -+ ['OS=="win" or OS=="linux" or os_bsd==1', { - 'sources': [ - 'common/extensions/api/input_ime/input_components_handler.cc', - 'common/extensions/api/input_ime/input_components_handler.h', Index: head/www/chromium/files/patch-chrome_chrome__exe.gypi =================================================================== --- head/www/chromium/files/patch-chrome_chrome__exe.gypi +++ head/www/chromium/files/patch-chrome_chrome__exe.gypi @@ -1,11 +0,0 @@ ---- chrome/chrome_exe.gypi.orig 2016-05-11 19:02:17 UTC -+++ chrome/chrome_exe.gypi -@@ -182,7 +182,7 @@ - '../build/linux/system.gyp:xext', - ], - }], -- ['OS=="linux" and enable_plugins==1', { -+ ['(OS=="linux" or os_bsd==1) and enable_plugins==1', { - 'dependencies': [ - '../pdf/pdf.gyp:pdf', - ], Index: head/www/chromium/files/patch-chrome_chrome__resources.gyp =================================================================== --- head/www/chromium/files/patch-chrome_chrome__resources.gyp +++ head/www/chromium/files/patch-chrome_chrome__resources.gyp @@ -1,11 +0,0 @@ ---- chrome/chrome_resources.gyp.orig 2016-08-04 11:15:29.707642000 -0400 -+++ chrome/chrome_resources.gyp 2016-08-04 11:17:02.866434000 -0400 -@@ -321,6 +321,8 @@ - 'platform': 'chromeos' - }, 'OS=="linux"', { - 'platform': 'linux' -+ }, 'OS=="freebsd"', { -+ 'platform': 'freebsd' - }, 'OS=="mac"', { - 'platform': 'mac' - }, 'OS=="win"', { Index: head/www/chromium/files/patch-chrome_common_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_common_BUILD.gn +++ head/www/chromium/files/patch-chrome_common_BUILD.gn @@ -0,0 +1,16 @@ +--- chrome/common/BUILD.gn.orig 2016-08-03 22:02:14.000000000 +0300 ++++ chrome/common/BUILD.gn 2016-09-27 19:17:20.410265000 +0300 +@@ -156,6 +156,13 @@ + ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "component_flash_hint_file_linux.cc", ++ "component_flash_hint_file_linux.h", ++ ] ++ } ++ + if (enable_extensions) { + sources += rebase_path(gypi_values.chrome_common_extensions_sources, + ".", Index: head/www/chromium/files/patch-chrome_common_chrome__switches.h =================================================================== --- head/www/chromium/files/patch-chrome_common_chrome__switches.h +++ head/www/chromium/files/patch-chrome_common_chrome__switches.h @@ -1,11 +1,11 @@ ---- chrome/common/chrome_switches.h.orig 2016-05-25 15:00:58.000000000 -0400 -+++ chrome/common/chrome_switches.h 2016-05-27 10:00:47.232609000 -0400 -@@ -387,7 +387,7 @@ +--- chrome/common/chrome_switches.h.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/common/chrome_switches.h 2016-10-13 06:13:55.604411000 +0300 +@@ -378,7 +378,7 @@ extern const char kEnableWaylandServer[]; #endif -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) - extern const char kEnableInputImeAPI[]; extern const char kDisableInputImeAPI[]; + extern const char kEnableInputImeAPI[]; #endif Index: head/www/chromium/files/patch-chrome_common_chrome__switches.cc =================================================================== --- head/www/chromium/files/patch-chrome_common_chrome__switches.cc +++ head/www/chromium/files/patch-chrome_common_chrome__switches.cc @@ -1,11 +1,11 @@ ---- chrome/common/chrome_switches.cc.orig 2016-05-25 15:00:58.000000000 -0400 -+++ chrome/common/chrome_switches.cc 2016-05-27 09:57:28.188798000 -0400 -@@ -1298,7 +1298,7 @@ - "tab-management-experiment-type-elderberry"; - #endif // defined(OS_ANDROID) +--- chrome/common/chrome_switches.cc.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/common/chrome_switches.cc 2016-10-13 06:11:21.058074000 +0300 +@@ -1277,7 +1277,7 @@ + const char kEnableWaylandServer[] = "enable-wayland-server"; + #endif -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) - extern const char kEnableInputImeAPI[] = "enable-input-ime-api"; extern const char kDisableInputImeAPI[] = "disable-input-ime-api"; + extern const char kEnableInputImeAPI[] = "enable-input-ime-api"; #endif Index: head/www/chromium/files/patch-chrome_common_component__flash__hint__file__linux.h =================================================================== --- head/www/chromium/files/patch-chrome_common_component__flash__hint__file__linux.h +++ head/www/chromium/files/patch-chrome_common_component__flash__hint__file__linux.h @@ -1,14 +0,0 @@ ---- chrome/common/component_flash_hint_file_linux.h.orig 2016-03-25 13:04:46 UTC -+++ chrome/common/component_flash_hint_file_linux.h -@@ -7,9 +7,9 @@ - - #include "build/build_config.h" - --#if !defined(OS_LINUX) -+#if !defined(OS_LINUX) && !defined(OS_FREEBSD) - #error "This file only applies to the Linux component update of Flash." --#endif // !defined(OS_LINUX) -+#endif // !defined(OS_LINUX) && !defined(OS_FREEBSD) - - #include - Index: head/www/chromium/files/patch-chrome_common_extensions_api_schemas.gni =================================================================== --- head/www/chromium/files/patch-chrome_common_extensions_api_schemas.gni +++ head/www/chromium/files/patch-chrome_common_extensions_api_schemas.gni @@ -0,0 +1,11 @@ +--- chrome/common/extensions/api/schemas.gni.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/common/extensions/api/schemas.gni 2016-10-13 06:16:40.629706000 +0300 +@@ -19,7 +19,7 @@ + } + if (is_chromeos) { + schema_sources += gypi_values.chromeos_schema_files +-} else if (is_linux || is_win) { ++} else if (is_linux || is_win || is_bsd) { + schema_sources += gypi_values.input_ime_schema_file + } + if (enable_service_discovery) { Index: head/www/chromium/files/patch-chrome_common_extensions_api_schemas.gypi =================================================================== --- head/www/chromium/files/patch-chrome_common_extensions_api_schemas.gypi +++ head/www/chromium/files/patch-chrome_common_extensions_api_schemas.gypi @@ -1,11 +0,0 @@ ---- chrome/common/extensions/api/schemas.gypi.orig 2016-05-21 16:05:09 UTC -+++ chrome/common/extensions/api/schemas.gypi -@@ -177,7 +177,7 @@ - ], - }, { # chromeos==0 - 'conditions': [ -- ['OS=="linux" or OS=="win"', { -+ ['OS=="linux" or OS=="win" or os_bsd==1', { - 'schema_files': [ - '<@(input_ime_schema_file)', - ], Index: head/www/chromium/files/patch-chrome_common_features.gni =================================================================== --- head/www/chromium/files/patch-chrome_common_features.gni +++ head/www/chromium/files/patch-chrome_common_features.gni @@ -0,0 +1,11 @@ +--- chrome/common/features.gni.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/common/features.gni 2016-10-13 06:19:10.348914000 +0300 +@@ -21,7 +21,7 @@ + enable_background = !is_ios && !is_android && !is_chromecast + + enable_one_click_signin = +- is_win || is_mac || (is_linux && !is_chromeos && !is_chromecast) ++ is_win || is_mac || is_bsd || (is_linux && !is_chromeos && !is_chromecast) + + # Google Now is disabled to prepare for its removal. + # http://crbug.com/539674 Index: head/www/chromium/files/patch-chrome_common_pref__names.h =================================================================== --- head/www/chromium/files/patch-chrome_common_pref__names.h +++ head/www/chromium/files/patch-chrome_common_pref__names.h @@ -1,15 +1,24 @@ ---- chrome/common/pref_names.h.orig 2016-05-25 15:00:58.000000000 -0400 -+++ chrome/common/pref_names.h 2016-05-27 10:03:13.560677000 -0400 -@@ -307,7 +307,7 @@ - extern const char kDeleteTimePeriod[]; +--- chrome/common/pref_names.h.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/common/pref_names.h 2016-10-14 07:01:22.105649000 +0300 +@@ -315,7 +315,7 @@ + extern const char kAllowedDomainsForApps[]; extern const char kLastClearBrowsingDataTime[]; extern const char kClearBrowsingDataHistoryNoticeShownTimes[]; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) extern const char kUsesSystemTheme[]; #endif extern const char kCurrentThemePackFilename[]; -@@ -477,7 +477,7 @@ +@@ -347,7 +347,7 @@ + #if defined(OS_MACOSX) + extern const char kShowUpdatePromotionInfoBar[]; + #endif +-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) + extern const char kUseCustomChromeFrame[]; + #endif + extern const char kBackShortcutBubbleShownCount[]; +@@ -496,7 +496,7 @@ extern const char kDownloadDefaultDirectory[]; extern const char kDownloadExtensionsToOpen[]; extern const char kDownloadDirUpgraded[]; Index: head/www/chromium/files/patch-chrome_common_pref__names.cc =================================================================== --- head/www/chromium/files/patch-chrome_common_pref__names.cc +++ head/www/chromium/files/patch-chrome_common_pref__names.cc @@ -1,15 +1,24 @@ ---- chrome/common/pref_names.cc.orig 2016-05-11 19:02:17 UTC -+++ chrome/common/pref_names.cc -@@ -885,7 +885,7 @@ const char kForceYouTubeSafetyMode[] = " - // supervised users. - const char kRecordHistory[] = "settings.history_recorded"; +--- chrome/common/pref_names.cc.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/common/pref_names.cc 2016-10-14 06:57:51.856679000 +0300 +@@ -952,7 +952,7 @@ + // only using an account that belongs to one of the domains from this pref. + const char kAllowedDomainsForApps[] = "settings.allowed_domains_for_apps"; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) // Linux specific preference on whether we should match the system theme. const char kUsesSystemTheme[] = "extensions.theme.use_system"; #endif -@@ -1348,7 +1348,7 @@ const char kDownloadDefaultDirectory[] = +@@ -1035,7 +1035,7 @@ + "browser.show_update_promotion_info_bar"; + #endif + +-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) + // Boolean that is false if we should show window manager decorations. If + // true, we draw a custom chrome frame (thicker title bar and blue border). + const char kUseCustomChromeFrame[] = "browser.custom_chrome_frame"; +@@ -1408,7 +1408,7 @@ // upgrade a unsafe location to a safe location. const char kDownloadDirUpgraded[] = "download.directory_upgrade"; Index: head/www/chromium/files/patch-chrome_common_variations_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_common_variations_BUILD.gn +++ head/www/chromium/files/patch-chrome_common_variations_BUILD.gn @@ -0,0 +1,11 @@ +--- chrome/common/variations/BUILD.gn.orig 2016-08-03 22:02:14.000000000 +0300 ++++ chrome/common/variations/BUILD.gn 2016-09-03 23:17:02.937969000 +0300 +@@ -12,7 +12,7 @@ + if (is_mac) { + source = "//testing/variations/fieldtrial_testing_config_mac.json" + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + source = "//testing/variations/fieldtrial_testing_config_linux.json" + } + if (is_chromeos) { Index: head/www/chromium/files/patch-chrome_common_variations_fieldtrial__testing__config.gyp =================================================================== --- head/www/chromium/files/patch-chrome_common_variations_fieldtrial__testing__config.gyp +++ head/www/chromium/files/patch-chrome_common_variations_fieldtrial__testing__config.gyp @@ -1,11 +0,0 @@ ---- chrome/common/variations/fieldtrial_testing_config.gyp.orig 2016-03-25 13:04:46 UTC -+++ chrome/common/variations/fieldtrial_testing_config.gyp -@@ -19,7 +19,7 @@ - 'conditions': [ - ['OS!="android"', {'sources/': [['exclude', '_android\\.json$']]}], - ['OS!="win"', {'sources/': [['exclude', '_win\\.json$']]}], -- ['OS!="linux" or chromeos==1', {'sources/': [['exclude', '_linux\\.json$']]}], -+ ['(OS!="linux" or chromeos==1) and os_bsd!=1', {'sources/': [['exclude', '_linux\\.json$']]}], - ['OS!="mac"', {'sources/': [['exclude', '_mac\\.json$']]}], - ['chromeos!=1', {'sources/': [['exclude', '_chromeos\\.json$']]}], - ['OS!="ios"', {'sources/': [['exclude', '_ios\\.json$']]}], Index: head/www/chromium/files/patch-chrome_test_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chrome_test_BUILD.gn +++ head/www/chromium/files/patch-chrome_test_BUILD.gn @@ -0,0 +1,176 @@ +--- chrome/test/BUILD.gn.orig 2016-10-06 04:02:14.000000000 +0300 ++++ chrome/test/BUILD.gn 2016-10-13 06:28:37.584668000 +0300 +@@ -179,7 +179,7 @@ + ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + public_deps += [ "//crypto:platform" ] + } + if (is_mac) { +@@ -383,7 +383,7 @@ + "$root_out_dir/test_page.css.mock-http-headers", + "$root_out_dir/ui_test.pak", + ] +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/chrome_200_percent.pak", +@@ -391,7 +391,7 @@ + "$root_out_dir/locales/fr.pak", + ] + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + data += [ "$root_out_dir/libppapi_tests.so" ] + } + +@@ -462,7 +462,7 @@ + ".", + "//chrome") + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (!is_chromeos) { + # Desktop linux. + sources -= [ +@@ -1097,14 +1097,14 @@ + sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ] + deps += [ "//chrome/browser/chromeos" ] + data_deps += [ "//third_party/liblouis:liblouis_test_data" ] +- } else if (is_linux || is_win) { ++ } else if (is_linux || is_bsd || is_win) { + sources += [ + "../browser/ui/views/ime/ime_warning_bubble_browsertest.cc", + "../browser/ui/views/ime/ime_window_browsertest.cc", + ] + } + +- if (is_win || is_linux) { ++ if (is_win || is_linux || is_bsd) { + sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ] + data_deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ] + } +@@ -1116,7 +1116,7 @@ + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + data_deps += [ "//components/nacl/loader:nacl_helper" ] + + if (enable_nacl_nonsfi) { +@@ -1176,7 +1176,7 @@ + } + } + +- if (is_linux && !is_component_build) { ++ if ((is_linux || is_bsd) && !is_component_build) { + # Set rpath to find the CDM adapter even in a non-component build. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } +@@ -1226,7 +1226,7 @@ + if (toolkit_views) { + sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ] + } +- if (is_win || is_linux) { ++ if (is_win || is_linux || is_bsd) { + sources += + [ "../browser/ui/views/ime/input_ime_apitest_nonchromeos.cc" ] + } +@@ -1385,7 +1385,7 @@ + ] + deps += [ "//components/wifi:test_support" ] + } +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_non_mac_desktop_sources, + ".", +@@ -1400,7 +1400,7 @@ + "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc", + ] + } +- if (is_mac || is_win || (is_linux && !is_chromeos)) { ++ if (is_mac || is_win || is_bsd || (is_linux && !is_chromeos)) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_non_mobile_non_cros_sources, + ".", +@@ -1519,7 +1519,7 @@ + "$root_out_dir/pyproto/", + ] + +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/chrome_200_percent.pak", +@@ -1768,7 +1768,7 @@ + "$root_out_dir/locales/en-US.pak", + ] + } +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + data += [ "$root_out_dir/chrome_200_percent.pak" ] + } + +@@ -1974,7 +1974,7 @@ + "//ui/wm", + ] + } +- if (!is_chromeos && is_linux) { ++ if (!is_chromeos && (is_linux || is_bsd)) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_desktop_linux_sources, + ".", +@@ -1991,7 +1991,7 @@ + if (use_gio) { + deps += [ "//build/linux/libgio" ] + } +- if (!is_chromeos && !use_ozone && is_linux) { ++ if (!is_chromeos && !use_ozone && (is_linux || is_bsd)) { + deps += [ "//chrome/browser/ui/libgtk2ui" ] + } + +@@ -2119,18 +2119,18 @@ + "//components/os_crypt:gnome_keyring_direct", + ] + } +- if (is_linux && !is_chromeos) { ++ if ((is_linux || is_bsd) && !is_chromeos) { + sources += + [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ] + deps += [ "//third_party/libsecret" ] + } +- if (is_linux && use_aura) { ++ if ((is_linux || is_bsd) && use_aura) { + deps += [ "//ui/aura:test_support" ] + if (use_dbus) { + deps += [ "//dbus:test_support" ] + } + } +- if (is_linux && is_chrome_branded && current_cpu == "x86") { ++ if ((is_linux || is_bsd) && is_chrome_branded && current_cpu == "x86") { + ldflags = [ "-Wl,--strip-debug" ] + } + if (is_mac) { +@@ -2365,7 +2365,7 @@ + } + } + +-if (!is_android) { ++if (!is_android && !is_bsd) { + # TODO(609855): Make this compile on Android and run on the bots. + test("chrome_app_unittests") { + sources = [ +@@ -2391,7 +2391,7 @@ + } + } + +-if (!is_android && !is_ios && !is_chromecast) { ++if (!is_android && !is_ios && !is_chromecast && !is_bsd) { + test("performance_browser_tests") { + sources = + rebase_path(chrome_tests_gypi_values.performance_browser_tests_sources, Index: head/www/chromium/files/patch-chromecast_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chromecast_BUILD.gn +++ head/www/chromium/files/patch-chromecast_BUILD.gn @@ -0,0 +1,11 @@ +--- chromecast/BUILD.gn.orig 2016-08-03 22:02:15.000000000 +0300 ++++ chromecast/BUILD.gn 2016-09-03 01:38:51.775473000 +0300 +@@ -44,7 +44,7 @@ + "//ui/base:ui_base_unittests", + ] + +- if (is_linux) { ++ if (is_linux || is_bsd) { + tests += [ "//chromecast/crash:cast_crash_unittests" ] + } + Index: head/www/chromium/files/patch-chromecast_browser_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chromecast_browser_BUILD.gn +++ head/www/chromium/files/patch-chromecast_browser_BUILD.gn @@ -0,0 +1,11 @@ +--- chromecast/browser/BUILD.gn.orig 2016-08-03 22:02:15.000000000 +0300 ++++ chromecast/browser/BUILD.gn 2016-09-03 01:39:34.973425000 +0300 +@@ -114,7 +114,7 @@ + "//ui/gl", + ] + +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ + "cast_memory_pressure_monitor.cc", + "cast_memory_pressure_monitor.h", Index: head/www/chromium/files/patch-chromecast_browser_metrics_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chromecast_browser_metrics_BUILD.gn +++ head/www/chromium/files/patch-chromecast_browser_metrics_BUILD.gn @@ -0,0 +1,11 @@ +--- chromecast/browser/metrics/BUILD.gn.orig 2016-08-03 22:02:15.000000000 +0300 ++++ chromecast/browser/metrics/BUILD.gn 2016-09-03 01:39:05.920888000 +0300 +@@ -26,7 +26,7 @@ + "//content/public/common", + ] + +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ + "external_metrics.cc", + "external_metrics.h", Index: head/www/chromium/files/patch-chromecast_crash_BUILD.gn =================================================================== --- head/www/chromium/files/patch-chromecast_crash_BUILD.gn +++ head/www/chromium/files/patch-chromecast_crash_BUILD.gn @@ -0,0 +1,11 @@ +--- chromecast/crash/BUILD.gn.orig 2016-08-03 22:02:15.000000000 +0300 ++++ chromecast/crash/BUILD.gn 2016-09-03 01:38:37.198322000 +0300 +@@ -48,7 +48,7 @@ + ] + } + +-if (is_linux) { ++if (is_linux || is_bsd) { + test("cast_crash_unittests") { + sources = [ + "cast_crashdump_uploader_unittest.cc", Index: head/www/chromium/files/patch-components_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_BUILD.gn +++ head/www/chromium/files/patch-components_BUILD.gn @@ -0,0 +1,13 @@ +--- components/BUILD.gn.orig 2016-08-03 22:02:15.000000000 +0300 ++++ components/BUILD.gn 2016-09-13 13:15:29.852531000 +0300 +@@ -167,8 +167,8 @@ + "//components/autofill/content/renderer:unit_tests", + "//components/cast_certificate:unit_tests", + "//components/certificate_transparency:unit_tests", +- "//components/crash/content/app:unit_tests", +- "//components/crash/core/common:unit_tests", ++ #"//components/crash/content/app:unit_tests", ++ #"//components/crash/core/common:unit_tests", + "//components/data_reduction_proxy/content/browser:unit_tests", + "//components/data_use_measurement/content:unit_tests", + "//components/devtools_http_handler:unit_tests", Index: head/www/chromium/files/patch-components_content__settings_core_browser_website__settings__registry.h =================================================================== --- head/www/chromium/files/patch-components_content__settings_core_browser_website__settings__registry.h +++ head/www/chromium/files/patch-components_content__settings_core_browser_website__settings__registry.h @@ -0,0 +1,15 @@ +--- components/content_settings/core/browser/website_settings_registry.h.orig 2016-10-06 04:02:16.000000000 +0300 ++++ components/content_settings/core/browser/website_settings_registry.h 2016-10-13 13:24:49.647706000 +0300 +@@ -36,10 +36,11 @@ + PLATFORM_MAC = 1 << 3, + PLATFORM_ANDROID = 1 << 4, + PLATFORM_IOS = 1 << 5, ++ PLATFORM_BSD = 1 << 6, + + // Settings only applied to win, mac, linux and chromeos. + DESKTOP = +- PLATFORM_WINDOWS | PLATFORM_LINUX | PLATFORM_CHROMEOS | PLATFORM_MAC, ++ PLATFORM_WINDOWS | PLATFORM_LINUX | PLATFORM_CHROMEOS | PLATFORM_MAC | PLATFORM_BSD, + + // Settings applied to all platforms, including win, mac, linux, chromeos, + // android, ios. Index: head/www/chromium/files/patch-components_content__settings_core_browser_website__settings__registry.cc =================================================================== --- head/www/chromium/files/patch-components_content__settings_core_browser_website__settings__registry.cc +++ head/www/chromium/files/patch-components_content__settings_core_browser_website__settings__registry.cc @@ -0,0 +1,12 @@ +--- components/content_settings/core/browser/website_settings_registry.cc.orig 2016-10-06 04:02:16.000000000 +0300 ++++ components/content_settings/core/browser/website_settings_registry.cc 2016-10-13 13:04:35.828985000 +0300 +@@ -88,6 +88,9 @@ + // doesn't allow the settings to be managed in the same way. See + // crbug.com/642184. + sync_status = WebsiteSettingsInfo::UNSYNCABLE; ++#elif defined(OS_BSD) ++ if (!(platform & PLATFORM_BSD)) ++ return nullptr; + #else + #error "Unsupported platform" + #endif Index: head/www/chromium/files/patch-components_crash_content_app_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_crash_content_app_BUILD.gn +++ head/www/chromium/files/patch-components_crash_content_app_BUILD.gn @@ -0,0 +1,11 @@ +--- components/crash/content/app/BUILD.gn.orig 2016-08-03 22:02:16.000000000 +0300 ++++ components/crash/content/app/BUILD.gn 2016-09-18 01:39:59.921593000 +0300 +@@ -141,7 +141,7 @@ + + #'../breakpad/breakpad.gyp:breakpad_sender', TODO(GYP) + ] +- } else if (is_posix && !is_ios) { ++ } else if (is_posix && !is_ios && !is_bsd) { + deps += [ "//breakpad:client" ] + } + } Index: head/www/chromium/files/patch-components_crash_content_browser_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_crash_content_browser_BUILD.gn +++ head/www/chromium/files/patch-components_crash_content_browser_BUILD.gn @@ -0,0 +1,21 @@ +--- components/crash/content/browser/BUILD.gn.orig 2016-08-03 22:02:16.000000000 +0300 ++++ components/crash/content/browser/BUILD.gn 2016-09-13 13:38:48.133784000 +0300 +@@ -16,7 +16,7 @@ + + deps = [ + "//base", +- "//breakpad:client", ++ #"//breakpad:client", + "//components/crash/content/app", + "//content/public/browser", + "//content/public/common", +@@ -39,7 +39,7 @@ + # This is not in the GYP build but this target includes breakpad client + # headers, so add the dependency here. + if (is_posix && !is_ios) { +- configs += [ "//breakpad:client_config" ] +- public_configs = [ "//breakpad:client_config" ] ++ #configs += [ "//breakpad:client_config" ] ++ #public_configs = [ "//breakpad:client_config" ] + } + } Index: head/www/chromium/files/patch-components_dom__distiller_core_page__features.cc =================================================================== --- head/www/chromium/files/patch-components_dom__distiller_core_page__features.cc +++ head/www/chromium/files/patch-components_dom__distiller_core_page__features.cc @@ -1,15 +0,0 @@ ---- components/dom_distiller/core/page_features.cc.orig 2016-07-22 00:06:53.000000000 -0400 -+++ components/dom_distiller/core/page_features.cc 2016-08-03 11:25:37.908892000 -0400 -@@ -10,7 +10,11 @@ - #include - - #include "base/json/json_reader.h" --#include "third_party/re2/src/re2/re2.h" -+#if defined(OS_FREEBSD) -+# include -+#else -+# include "third_party/re2/src/re2/re2.h" -+#endif // defined(OS_FREEBSD) - #include "url/gurl.h" - - namespace dom_distiller { Index: head/www/chromium/files/patch-components_gcm__driver_gcm__client.h =================================================================== --- head/www/chromium/files/patch-components_gcm__driver_gcm__client.h +++ head/www/chromium/files/patch-components_gcm__driver_gcm__client.h @@ -0,0 +1,10 @@ +--- components/gcm_driver/gcm_client.h.orig 2016-10-06 04:02:16.000000000 +0300 ++++ components/gcm_driver/gcm_client.h 2016-10-13 13:05:38.414560000 +0300 +@@ -80,6 +80,7 @@ + PLATFORM_CROS, + PLATFORM_IOS, + PLATFORM_ANDROID, ++ PLATFORM_BSD, + PLATFORM_UNKNOWN + }; + Index: head/www/chromium/files/patch-components_gcm__driver_gcm__client__impl.cc =================================================================== --- head/www/chromium/files/patch-components_gcm__driver_gcm__client__impl.cc +++ head/www/chromium/files/patch-components_gcm__driver_gcm__client__impl.cc @@ -0,0 +1,12 @@ +--- components/gcm_driver/gcm_client_impl.cc.orig 2016-10-06 04:02:16.000000000 +0300 ++++ components/gcm_driver/gcm_client_impl.cc 2016-10-13 13:07:14.340338000 +0300 +@@ -137,6 +137,9 @@ + case GCMClient::PLATFORM_CROS: + platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_CROS; + break; ++ case GCMClient::PLATFORM_BSD: // TODO what the hell are those? ++ platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX; ++ break; + case GCMClient::PLATFORM_UNKNOWN: + // For unknown platform, return as LINUX. + platform = checkin_proto::ChromeBuildProto_Platform_PLATFORM_LINUX; Index: head/www/chromium/files/patch-components_metrics_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_metrics_BUILD.gn +++ head/www/chromium/files/patch-components_metrics_BUILD.gn @@ -0,0 +1,34 @@ +--- components/metrics/BUILD.gn.orig 2016-10-06 04:02:16.000000000 +0300 ++++ components/metrics/BUILD.gn 2016-10-16 20:52:28.476935000 +0300 +@@ -107,6 +107,13 @@ + if (is_win) { + sources -= [ "machine_id_provider_stub.cc" ] + } ++ ++ if (is_bsd) { ++ sources -= [ ++ "system_memory_stats_recorder_linux.cc" ++ ] ++ } ++ + } + + if (!is_ios) { +@@ -266,7 +273,7 @@ + ] + } + +-if (is_linux) { ++if (is_linux || is_bsd) { + # GYP version: components/metrics.gypi:metrics_serialization + static_library("serialization") { + sources = [ +@@ -321,7 +328,7 @@ + "//ui/gfx/geometry", + ] + +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ "serialization/serialization_utils_unittest.cc" ] + deps += [ ":serialization" ] + } Index: head/www/chromium/files/patch-components_os__crypt_os__crypt.h =================================================================== --- head/www/chromium/files/patch-components_os__crypt_os__crypt.h +++ head/www/chromium/files/patch-components_os__crypt_os__crypt.h @@ -0,0 +1,20 @@ +--- components/os_crypt/os_crypt.h.orig 2016-10-06 04:02:17.000000000 +0300 ++++ components/os_crypt/os_crypt.h 2016-10-13 11:41:26.429931000 +0300 +@@ -13,7 +13,7 @@ + #include "base/strings/string16.h" + #include "build/build_config.h" + +-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) + #include "components/os_crypt/key_storage_linux.h" + #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) + +@@ -23,7 +23,7 @@ + // true for Linux, if a password management tool is available. + class OSCrypt { + public: +-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) ++#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) + // If |store_type| is a known password store, we will attempt to use it. + // In any other case, we default to auto-detecting the store. + // This should not be changed after OSCrypt has been used. Index: head/www/chromium/files/patch-components_plugins_renderer_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_plugins_renderer_BUILD.gn +++ head/www/chromium/files/patch-components_plugins_renderer_BUILD.gn @@ -0,0 +1,17 @@ +--- components/plugins/renderer/BUILD.gn.orig 2016-08-03 22:02:16.000000000 +0300 ++++ components/plugins/renderer/BUILD.gn 2016-09-26 06:14:10.664010000 +0300 +@@ -25,6 +25,7 @@ + } + + deps = [ ++ "//v8", + "//content/public/child", + "//content/public/common", + "//content/public/renderer", +@@ -33,6 +34,5 @@ + "//third_party/WebKit/public:blink", + "//third_party/re2", + "//ui/base", +- "//v8", + ] + } Index: head/www/chromium/files/patch-components_policy_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_policy_BUILD.gn +++ head/www/chromium/files/patch-components_policy_BUILD.gn @@ -0,0 +1,11 @@ +--- components/policy/BUILD.gn.orig 2016-08-03 22:02:16.000000000 +0300 ++++ components/policy/BUILD.gn 2016-09-03 01:58:22.866259000 +0300 +@@ -141,7 +141,7 @@ + if (is_android) { + outputs += policy_templates_android_outputs + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + outputs += policy_templates_linux_outputs + } + if (is_mac) { Index: head/www/chromium/files/patch-components_policy_resources_policy__templates.json =================================================================== --- head/www/chromium/files/patch-components_policy_resources_policy__templates.json +++ head/www/chromium/files/patch-components_policy_resources_policy__templates.json @@ -1,6 +1,15 @@ ---- components/policy/resources/policy_templates.json.orig 2016-05-11 19:02:18 UTC -+++ components/policy/resources/policy_templates.json -@@ -1918,7 +1918,7 @@ +--- components/policy/resources/policy_templates.json.orig 2016-10-06 04:02:17.000000000 +0300 ++++ components/policy/resources/policy_templates.json 2016-10-17 00:01:03.979810000 +0300 +@@ -909,7 +909,7 @@ + 'name': 'RemoteAccessHostMatchUsername', + 'type': 'main', + 'schema': { 'type': 'boolean' }, +- 'supported_on': ['chrome.linux:25-', 'chrome.mac:25-', 'chrome_os:42-'], ++ 'supported_on': ['chrome.linux:25-', 'chrome.freebsd:25-', 'chrome.mac:25-', 'chrome_os:42-'], + 'features': { + 'dynamic_refresh': True, + 'per_profile': False, +@@ -1930,7 +1930,7 @@ 'name': 'GSSAPILibraryName', 'type': 'string', 'schema': { 'type': 'string' }, @@ -9,7 +18,7 @@ 'features': { 'dynamic_refresh': False, 'per_profile': False, -@@ -4581,7 +4581,7 @@ +@@ -4601,7 +4601,7 @@ 'name': 'RequireOnlineRevocationChecksForLocalAnchors', 'type': 'main', 'schema': { 'type': 'boolean' }, @@ -18,7 +27,7 @@ 'features': { 'dynamic_refresh': True, 'per_profile': False, -@@ -5410,7 +5410,7 @@ +@@ -5449,7 +5449,7 @@ 'name': 'BackgroundModeEnabled', 'type': 'main', 'schema': { 'type': 'boolean' }, @@ -27,3 +36,12 @@ 'features': { 'can_be_recommended': True, 'dynamic_refresh': True, +@@ -5974,7 +5974,7 @@ + 'name': 'FullscreenAllowed', + 'type': 'main', + 'schema': { 'type': 'boolean' }, +- 'supported_on': ['chrome.win:31-', 'chrome.linux:31-', 'chrome_os:31-'], ++ 'supported_on': ['chrome.win:31-', 'chrome.linux:31-', 'chrome_os:31-', 'chrome.freebsd:31-'], + 'features': { + 'dynamic_refresh': True, + 'per_profile': True, Index: head/www/chromium/files/patch-components_policy_tools_generate__policy__source.py =================================================================== --- head/www/chromium/files/patch-components_policy_tools_generate__policy__source.py +++ head/www/chromium/files/patch-components_policy_tools_generate__policy__source.py @@ -1,11 +1,11 @@ ---- components/policy/tools/generate_policy_source.py.orig 2016-05-11 19:02:19 UTC -+++ components/policy/tools/generate_policy_source.py -@@ -98,7 +98,7 @@ class PolicyDetails: +--- components/policy/tools/generate_policy_source.py.orig 2016-08-03 22:02:16.000000000 +0300 ++++ components/policy/tools/generate_policy_source.py 2016-09-20 17:13:04.971596000 +0300 +@@ -102,7 +102,7 @@ if platform.startswith('chrome.'): platform_sub = platform[7:] if platform_sub == '*': - self.platforms.extend(['win', 'mac', 'linux']) -+ self.platforms.extend(['win', 'mac', 'linux', 'freebsd']) ++ self.platforms.extend(['win', 'mac', 'linux', 'bsd']) else: self.platforms.append(platform_sub) else: Index: head/www/chromium/files/patch-components_storage__monitor.gypi =================================================================== --- head/www/chromium/files/patch-components_storage__monitor.gypi +++ head/www/chromium/files/patch-components_storage__monitor.gypi @@ -1,29 +0,0 @@ ---- components/storage_monitor.gypi.orig 2016-03-25 13:04:48 UTC -+++ components/storage_monitor.gypi -@@ -50,6 +50,26 @@ - 'storage_monitor/volume_mount_watcher_win.h', - ], - 'conditions': [ -+ ['os_bsd == 1', { -+ 'sources!': [ -+ 'storage_monitor/media_transfer_protocol_device_observer_linux.cc', -+ 'storage_monitor/media_transfer_protocol_device_observer_linux.h', -+ 'storage_monitor/test_media_transfer_protocol_manager_linux.cc', -+ 'storage_monitor/test_media_transfer_protocol_manager_linux.h', -+ 'storage_monitor/mtab_watcher_linux.cc', -+ 'storage_monitor/mtab_watcher_linux.h', -+ 'storage_monitor/storage_monitor_linux.cc', -+ 'storage_monitor/storage_monitor_linux.h', -+ 'storage_monitor/udev_util_linux.cc', -+ 'storage_monitor/udev_util_linux.h', -+ ], -+ }], -+ ['OS == "freebsd"', { -+ 'sources': [ -+ 'storage_monitor/storage_monitor_freebsd.cc', -+ 'storage_monitor/storage_monitor_freebsd.h', -+ ], -+ }], - ['OS == "mac"', { - 'link_settings': { - 'libraries': [ Index: head/www/chromium/files/patch-components_storage__monitor_BUILD.gn =================================================================== --- head/www/chromium/files/patch-components_storage__monitor_BUILD.gn +++ head/www/chromium/files/patch-components_storage__monitor_BUILD.gn @@ -0,0 +1,40 @@ +--- components/storage_monitor/BUILD.gn.orig 2016-08-03 22:02:16.000000000 +0300 ++++ components/storage_monitor/BUILD.gn 2016-09-27 19:34:46.322065000 +0300 +@@ -64,6 +64,23 @@ + ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "media_transfer_protocol_device_observer_linux.cc", ++ "media_transfer_protocol_device_observer_linux.h", ++ "mtab_watcher_linux.cc", ++ "mtab_watcher_linux.h", ++ "storage_monitor_linux.cc", ++ "storage_monitor_linux.h", ++ "udev_util_linux.cc", ++ "udev_util_linux.h", ++ ] ++ sources += [ ++ "storage_monitor_freebsd.cc", ++ "storage_monitor_freebsd.h", ++ ] ++ } ++ + if (use_udev) { + deps += [ "//device/udev_linux" ] + } else if (is_linux) { +@@ -119,6 +136,13 @@ + ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "test_media_transfer_protocol_manager_linux.cc", ++ "test_media_transfer_protocol_manager_linux.h", ++ ] ++ } ++ + if (is_win) { + deps = [ + "//testing/gtest", Index: head/www/chromium/files/patch-components_sync_base_get__session__name__linux.cc =================================================================== --- head/www/chromium/files/patch-components_sync_base_get__session__name__linux.cc +++ head/www/chromium/files/patch-components_sync_base_get__session__name__linux.cc @@ -0,0 +1,22 @@ +--- components/sync/base/get_session_name_linux.cc.orig 2016-10-06 04:02:17.000000000 +0300 ++++ components/sync/base/get_session_name_linux.cc 2016-10-13 13:40:16.075193000 +0300 +@@ -4,7 +4,7 @@ + + #include "components/sync/base/get_session_name_linux.h" + +-#include // for HOST_NAME_MAX ++#include // for _POSIX_HOST_NAME_MAX + #include // for gethostname() + + #include "base/linux_util.h" +@@ -13,8 +13,8 @@ + namespace internal { + + std::string GetHostname() { +- char hostname[HOST_NAME_MAX]; +- if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success. ++ char hostname[_POSIX_HOST_NAME_MAX]; ++ if (gethostname(hostname, _POSIX_HOST_NAME_MAX) == 0) // Success. + return hostname; + return base::GetLinuxDistro(); + } Index: head/www/chromium/files/patch-components_variations_proto_study.proto =================================================================== --- head/www/chromium/files/patch-components_variations_proto_study.proto +++ head/www/chromium/files/patch-components_variations_proto_study.proto @@ -0,0 +1,10 @@ +--- components/variations/proto/study.proto.orig 2016-10-06 04:02:18.000000000 +0300 ++++ components/variations/proto/study.proto 2016-10-13 13:02:20.586397000 +0300 +@@ -189,6 +189,7 @@ + PLATFORM_CHROMEOS = 3; + PLATFORM_ANDROID = 4; + PLATFORM_IOS = 5; ++ PLATFORM_BSD = 6; + } + + // Possible form factors Chrome is running on. Index: head/www/chromium/files/patch-content_app_BUILD.gn =================================================================== --- head/www/chromium/files/patch-content_app_BUILD.gn +++ head/www/chromium/files/patch-content_app_BUILD.gn @@ -0,0 +1,11 @@ +--- content/app/BUILD.gn.orig 2016-10-06 04:02:18.000000000 +0300 ++++ content/app/BUILD.gn 2016-10-13 06:35:58.585406000 +0300 +@@ -66,7 +66,7 @@ + ] + } + +- if (is_linux && enable_plugins) { ++ if ((is_linux || is_bsd) && enable_plugins) { + content_app_deps += [ "//content/ppapi_plugin:ppapi_plugin_sources" ] + } + Index: head/www/chromium/files/patch-content_browser_BUILD.gn =================================================================== --- head/www/chromium/files/patch-content_browser_BUILD.gn +++ head/www/chromium/files/patch-content_browser_BUILD.gn @@ -0,0 +1,58 @@ +--- content/browser/BUILD.gn.orig 2016-10-06 04:02:18.000000000 +0300 ++++ content/browser/BUILD.gn 2016-10-13 10:50:30.206508000 +0300 +@@ -196,7 +196,7 @@ + "//third_party/webrtc/media:rtc_media", + "//third_party/webrtc/modules/desktop_capture:primitives", + ] +- if (is_linux || is_mac || is_win) { ++ if (is_linux || is_bsd || is_mac || is_win) { + sources += [ + "media/capture/desktop_capture_device.cc", + "media/capture/desktop_capture_device.h", +@@ -288,7 +288,7 @@ + } + } + +- if (is_linux && use_aura) { ++ if ((is_linux || is_bsd) && use_aura) { + deps += [ "//build/linux:fontconfig" ] + } + +@@ -368,6 +368,19 @@ + "//chromeos", + "//chromeos:power_manager_proto", + ] ++ } else if (is_bsd) { ++ sources -= [ ++ "zygote_host/zygote_communication_linux.cc", ++ "zygote_host/zygote_communication_linux.h", ++ "zygote_host/zygote_handle_linux.cc", ++ "zygote_host/zygote_host_impl_linux.cc", ++ "zygote_host/zygote_host_impl_linux.h", ++ "../zygote/zygote_linux.cc", ++ "../zygote/zygote_linux.h", ++ "../zygote/zygote_main_linux.cc", ++ "download/file_metadata_linux.cc", ++ "download/file_metadata_linux.h", ++ ] + } + + if (use_aura) { +@@ -450,7 +463,7 @@ + deps += [ "//third_party/flac" ] + } + +- if (is_linux && use_dbus) { ++ if ((is_linux || is_bsd) && use_dbus) { + deps += [ "//dbus" ] + } + +@@ -461,7 +474,7 @@ + ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + deps += [ "//third_party/boringssl" ] + } + Index: head/www/chromium/files/patch-content_browser_browser__main__loop.cc =================================================================== --- head/www/chromium/files/patch-content_browser_browser__main__loop.cc +++ head/www/chromium/files/patch-content_browser_browser__main__loop.cc @@ -1,6 +1,6 @@ ---- content/browser/browser_main_loop.cc.orig 2016-05-11 19:02:20 UTC -+++ content/browser/browser_main_loop.cc -@@ -191,7 +191,7 @@ +--- content/browser/browser_main_loop.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/browser_main_loop.cc 2016-08-18 02:39:59.331387000 +0300 +@@ -203,7 +203,7 @@ namespace content { namespace { @@ -9,7 +9,7 @@ void SetupSandbox(const base::CommandLine& parsed_command_line) { TRACE_EVENT0("startup", "SetupSandbox"); base::FilePath sandbox_binary; -@@ -444,7 +444,7 @@ void BrowserMainLoop::EarlyInitializatio +@@ -467,7 +467,7 @@ TRACE_EVENT0("startup", "BrowserMainLoop::EarlyInitialization"); TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::EarlyInitialization"); @@ -18,3 +18,12 @@ // No thread should be created before this call, as SetupSandbox() // will end-up using fork(). SetupSandbox(parsed_command_line_); +@@ -507,7 +507,7 @@ + // We use quite a few file descriptors for our IPC, and the default limit on + // the Mac is low (256), so bump it up. + base::SetFdLimit(1024); +-#elif defined(OS_LINUX) ++#elif defined(OS_LINUX) || defined(OS_BSD) + // Same for Linux. The default various per distro, but it is 1024 on Fedora. + // Low soft limits combined with liberal use of file descriptors means power + // users can easily hit this limit with many open tabs. Bump up the limit to Index: head/www/chromium/files/patch-content_browser_device__sensors_data__fetcher__shared__memory.h =================================================================== --- head/www/chromium/files/patch-content_browser_device__sensors_data__fetcher__shared__memory.h +++ head/www/chromium/files/patch-content_browser_device__sensors_data__fetcher__shared__memory.h @@ -0,0 +1,11 @@ +--- content/browser/device_sensors/data_fetcher_shared_memory.h.orig 2016-10-06 04:02:18.000000000 +0300 ++++ content/browser/device_sensors/data_fetcher_shared_memory.h 2016-10-14 15:15:34.071484000 +0300 +@@ -45,7 +45,7 @@ + bool Start(ConsumerType consumer_type, void* buffer) override; + bool Stop(ConsumerType consumer_type) override; + +-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) ++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD) + #if !defined(OS_CHROMEOS) + DeviceMotionHardwareBuffer* motion_buffer_ = nullptr; + DeviceOrientationHardwareBuffer* orientation_buffer_ = nullptr; Index: head/www/chromium/files/patch-content_browser_devtools_protocol_color__picker.cc =================================================================== --- head/www/chromium/files/patch-content_browser_devtools_protocol_color__picker.cc +++ head/www/chromium/files/patch-content_browser_devtools_protocol_color__picker.cc @@ -0,0 +1,11 @@ +--- content/browser/devtools/protocol/color_picker.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/devtools/protocol/color_picker.cc 2016-08-18 02:35:16.268652000 +0300 +@@ -151,7 +151,7 @@ + // magnified projection only with centered hotspot. + // Mac Retina requires cursor to be > 120px in order to render smoothly. + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + const float kCursorSize = 63; + const float kDiameter = 63; + const float kHotspotOffset = 32; Index: head/www/chromium/files/patch-content_browser_geolocation_location__arbitrator__impl.cc =================================================================== --- head/www/chromium/files/patch-content_browser_geolocation_location__arbitrator__impl.cc +++ head/www/chromium/files/patch-content_browser_geolocation_location__arbitrator__impl.cc @@ -1,11 +0,0 @@ ---- content/browser/geolocation/location_arbitrator_impl.cc.orig 2016-05-11 19:02:20 UTC -+++ content/browser/geolocation/location_arbitrator_impl.cc -@@ -163,7 +163,7 @@ LocationProvider* LocationArbitratorImpl - } - - LocationProvider* LocationArbitratorImpl::NewSystemLocationProvider() { --#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) -+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) - return NULL; - #else - return content::NewSystemLocationProvider(); Index: head/www/chromium/files/patch-content_browser_geolocation_wifi__data__provider__freebsd.h =================================================================== --- head/www/chromium/files/patch-content_browser_geolocation_wifi__data__provider__freebsd.h +++ head/www/chromium/files/patch-content_browser_geolocation_wifi__data__provider__freebsd.h @@ -1,33 +0,0 @@ ---- content/browser/geolocation/wifi_data_provider_freebsd.h.orig 2016-05-20 17:18:26 UTC -+++ content/browser/geolocation/wifi_data_provider_freebsd.h -@@ -0,0 +1,30 @@ -+// 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 CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_FREEBSD_H_ -+#define CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_FREEBSD_H_ -+ -+#include "base/compiler_specific.h" -+#include "content/browser/geolocation/wifi_data_provider_common.h" -+#include "content/common/content_export.h" -+ -+namespace content { -+ -+class CONTENT_EXPORT WifiDataProviderFreeBSD : public WifiDataProviderCommon { -+ public: -+ WifiDataProviderFreeBSD(); -+ -+ private: -+ virtual ~WifiDataProviderFreeBSD(); -+ -+ // WifiDataProviderCommon -+ virtual WlanApiInterface* NewWlanApi() override; -+ virtual WifiPollingPolicy* NewPollingPolicy() override; -+ -+ DISALLOW_COPY_AND_ASSIGN(WifiDataProviderFreeBSD); -+}; -+ -+} // namespace content -+ -+#endif // CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_FREEBSD_H_ Index: head/www/chromium/files/patch-content_browser_geolocation_wifi__data__provider__freebsd.cc =================================================================== --- head/www/chromium/files/patch-content_browser_geolocation_wifi__data__provider__freebsd.cc +++ head/www/chromium/files/patch-content_browser_geolocation_wifi__data__provider__freebsd.cc @@ -1,204 +0,0 @@ ---- content/browser/geolocation/wifi_data_provider_freebsd.cc.orig 2016-08-04 10:46:30.800769000 -0400 -+++ content/browser/geolocation/wifi_data_provider_freebsd.cc 2016-08-04 21:41:58.417450000 -0400 -@@ -0,0 +1,201 @@ -+// Copyright (c) 2010 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. -+ -+// For FreeBSD we use the getifaddrs(3) to obtain the list of interfaces -+// and then check for those with an 802.11 media type and able to return -+// a list of stations. This is similar to ifconfig(8). -+ -+#include "content/browser/geolocation/wifi_data_provider_freebsd.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "base/strings/utf_string_conversions.h" -+#include "content/browser/geolocation/wifi_data_provider_common.h" -+#include "content/browser/geolocation/wifi_data_provider_manager.h" -+ -+namespace content { -+namespace { -+// The time periods, in milliseconds, between successive polls of the wifi data. -+const int kDefaultPollingInterval = 10000; // 10s -+const int kNoChangePollingInterval = 120000; // 2 mins -+const int kTwoNoChangePollingInterval = 600000; // 10 mins -+const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s -+ -+// Convert a wifi frequency to the corresponding channel. -+// Taken from wifi_data_provider_linux.cc where it says this was -+// adapted from geolocaiton/wifilib.cc in googleclient (internal to google). -+int frquency_to_channel(int frequency_Mhz) { -+ if (frequency_Mhz >= 2412 && frequency_Mhz <= 2472) // Channels 1-13. -+ return (frequency_Mhz - 2407) / 5; -+ if (frequency_Mhz == 2484) -+ return 14; -+ if (frequency_Mhz > 5000 && frequency_Mhz < 6000) // .11a bands. -+ return (frequency_Mhz - 5000) / 5; -+ // Ignore everything else. -+ return AccessPointData().channel; // invalid channel -+} -+ -+// Provides the wifi API binding for FreeBSD. -+class AccessPointDataFreeBSD : public WifiDataProviderCommon::WlanApiInterface { -+public: -+ AccessPointDataFreeBSD(); -+ ~AccessPointDataFreeBSD(); -+ -+ // this does nothing -+ bool Init(); -+ -+ // get the AP data -+ virtual bool GetAccessPointData(WifiData::AccessPointDataSet* data); -+ -+private: -+ DISALLOW_COPY_AND_ASSIGN(AccessPointDataFreeBSD); -+}; -+ -+AccessPointDataFreeBSD::AccessPointDataFreeBSD() { -+} -+ -+AccessPointDataFreeBSD::~AccessPointDataFreeBSD() { -+} -+ -+bool AccessPointDataFreeBSD::Init() { -+ return true; -+} -+ -+bool AccessPointDataFreeBSD::GetAccessPointData(WifiData::AccessPointDataSet* data) { -+ bool res; -+ char *dupn; -+ struct ifaddrs *ifal, *ifa; -+ struct ifreq ifr; -+ struct ifmediareq ifmr; -+ struct ieee80211req i802r; -+ int s; -+ char iscanbuf[32*1024], *vsr; -+ unsigned len; -+ AccessPointData apd; -+ -+ res = false; -+ if (getifaddrs(&ifal) < 0) -+ return res; -+ -+ dupn = NULL; -+ for (ifa = ifal; ifa; ifa = ifa->ifa_next) { -+ memset(&ifr, 0, sizeof(ifr)); -+ -+ if (dupn != NULL && strcmp(dupn, ifa->ifa_name) == 0) -+ continue; -+ dupn = ifa->ifa_name; -+ -+ strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name)); -+ ifr.ifr_addr.sa_family = AF_LOCAL; -+ -+ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) -+ continue; -+ -+ (void) memset(&ifmr, 0, sizeof(ifmr)); -+ (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name)); -+ -+ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { -+ close(s); -+ continue; -+ } -+ if (IFM_TYPE(ifmr.ifm_active) != IFM_IEEE80211) { -+ close(s); -+ continue; -+ } -+ -+ (void) memset(&i802r, 0, sizeof(i802r)); -+ (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name)); -+ i802r.i_type = IEEE80211_IOC_SCAN_RESULTS; -+ i802r.i_data = iscanbuf; -+ i802r.i_len = sizeof(iscanbuf); -+ if (ioctl(s, SIOCG80211, &i802r) < 0) { -+ close(s); -+ continue; -+ } -+ -+ close(s); -+ -+ vsr = (char *) i802r.i_data; -+ len = i802r.i_len; -+ while (len >= sizeof(struct ieee80211req_scan_result)) { -+ struct ieee80211req_scan_result *isr; -+ char *id; -+ int idlen; -+ char ssid[IEEE80211_NWID_LEN+1]; -+ -+ isr = (struct ieee80211req_scan_result *) vsr; -+ -+ if (isr->isr_meshid_len) { -+ id = vsr + isr->isr_ie_off + isr->isr_ssid_len; -+ idlen = isr->isr_meshid_len; -+ } -+ else { -+ id = vsr + isr->isr_ie_off; -+ idlen = isr->isr_ssid_len; -+ } -+ strncpy(ssid, id, idlen); -+ ssid[idlen] = '\0'; -+ apd.ssid = base::UTF8ToUTF16(ssid); -+ apd.mac_address = MacAddressAsString16(isr->isr_bssid); -+ apd.radio_signal_strength = (isr->isr_rssi/2) + isr->isr_noise; -+ apd.signal_to_noise = apd.radio_signal_strength - isr->isr_noise; -+ apd.channel = frquency_to_channel(isr->isr_freq); -+ VLOG(1) << "FreeBSD access point: " -+ << "SSID: " << apd.ssid << ", " -+ << "MAC: " << apd.mac_address << ", " -+ << "Strength: " << apd.radio_signal_strength << ":" -+ << apd.signal_to_noise << ", " -+ << "Channel: " << apd.channel; -+ data->insert(apd); -+ res = true; -+ len -= isr->isr_len; -+ vsr += isr->isr_len; -+ } -+ } -+ -+ freeifaddrs(ifal); -+ -+ return res; -+} -+ -+} // namespace -+ -+// static -+WifiDataProvider* WifiDataProviderManager::DefaultFactoryFunction() { -+ return new WifiDataProviderFreeBSD(); -+} -+ -+WifiDataProviderFreeBSD::WifiDataProviderFreeBSD() { -+} -+ -+WifiDataProviderFreeBSD::~WifiDataProviderFreeBSD() { -+} -+ -+WifiDataProviderCommon::WlanApiInterface* WifiDataProviderFreeBSD::NewWlanApi() { -+ -+ std::unique_ptr wlan_api(new AccessPointDataFreeBSD); -+ if (wlan_api->Init()) -+ return wlan_api.release(); -+ -+ return NULL; -+} -+ -+WifiPollingPolicy* WifiDataProviderFreeBSD::NewPollingPolicy() { -+ return new GenericWifiPollingPolicy; -+} -+ -+} // namespace content Index: head/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.h =================================================================== --- head/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.h +++ head/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.h @@ -0,0 +1,11 @@ +--- content/browser/gpu/gpu_data_manager_impl_private.h.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/gpu/gpu_data_manager_impl_private.h 2016-08-18 02:42:16.971805000 +0300 +@@ -154,7 +154,7 @@ + UnblockOtherDomainFrom3DAPIs); + FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, + UnblockThisDomainFrom3DAPIs); +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, + SetGLStrings); + FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, Index: head/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc =================================================================== --- head/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc +++ head/www/chromium/files/patch-content_browser_gpu_gpu__data__manager__impl__private.cc @@ -1,34 +1,43 @@ ---- content/browser/gpu/gpu_data_manager_impl_private.cc.orig 2016-05-11 19:02:20 UTC -+++ content/browser/gpu/gpu_data_manager_impl_private.cc -@@ -486,8 +486,10 @@ void GpuDataManagerImplPrivate::SetGLStr +--- content/browser/gpu/gpu_data_manager_impl_private.cc.orig 2016-10-06 04:02:18.000000000 +0300 ++++ content/browser/gpu/gpu_data_manager_impl_private.cc 2016-10-14 17:58:04.977933000 +0300 +@@ -363,7 +363,7 @@ + // strings even if all features are blacklisted. If all GPU features are + // disabled, the GPU process will only initialize GL bindings, create a GL + // context, and collect full GPU info. +-#if !defined(OS_LINUX) ++#if !defined(OS_LINUX) || !defined(OS_BSD) + if (reason) { + *reason = "All GPU features are blacklisted."; + } +@@ -486,8 +486,10 @@ gpu_info.gl_renderer = gl_renderer; gpu_info.gl_version = gl_version; -+#if !defined(OS_FREEBSD) ++#if !defined(OS_BSD) gpu::IdentifyActiveGPU(&gpu_info); gpu::CollectDriverInfoGL(&gpu_info); +#endif UpdateGpuInfo(gpu_info); UpdateGpuSwitchingManager(gpu_info); -@@ -529,10 +531,12 @@ void GpuDataManagerImplPrivate::Initiali - // Also declare the driver_vendor to be osmesa to be able to specify - // exceptions based on driver_vendor==osmesa for some blacklist rules. - gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; -+#ifndef __FreeBSD__ - } else { - TRACE_EVENT0("startup", - "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); - gpu::CollectBasicGraphicsInfo(&gpu_info); +@@ -542,10 +544,12 @@ + // Skip collecting the basic driver info if SetGpuInfo() is already called. + if (IsCompleteGpuInfoAvailable()) { + gpu_info = gpu_info_; ++#ifndef OS_BSD + } else { + TRACE_EVENT0("startup", + "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); + gpu::CollectBasicGraphicsInfo(&gpu_info); +#endif + } if (command_line->HasSwitch(switches::kGpuTestingVendorId) && - command_line->HasSwitch(switches::kGpuTestingDeviceId)) { -@@ -631,7 +635,9 @@ void GpuDataManagerImplPrivate::UpdateGp +@@ -657,7 +661,9 @@ return; bool was_info_available = IsCompleteGpuInfoAvailable(); -+#ifndef __FreeBSD__ ++#ifndef OS_BSD gpu::MergeGPUInfo(&gpu_info_, gpu_info); +#endif if (IsCompleteGpuInfoAvailable()) { Index: head/www/chromium/files/patch-content_browser_gpu_gpu__process__host.cc =================================================================== --- head/www/chromium/files/patch-content_browser_gpu_gpu__process__host.cc +++ head/www/chromium/files/patch-content_browser_gpu_gpu__process__host.cc @@ -0,0 +1,11 @@ +--- content/browser/gpu/gpu_process_host.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/gpu/gpu_process_host.cc 2016-08-18 02:45:06.533983000 +0300 +@@ -968,7 +968,7 @@ + base::CommandLine* cmd_line = + new base::CommandLine(base::CommandLine::NO_PROGRAM); + #else +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + int child_flags = gpu_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : + ChildProcessHost::CHILD_NORMAL; + #else Index: head/www/chromium/files/patch-content_browser_indexed__db_indexed__db__backing__store.cc =================================================================== --- head/www/chromium/files/patch-content_browser_indexed__db_indexed__db__backing__store.cc +++ head/www/chromium/files/patch-content_browser_indexed__db_indexed__db__backing__store.cc @@ -1,11 +0,0 @@ ---- content/browser/indexed_db/indexed_db_backing_store.cc.orig 2016-05-11 19:02:20 UTC -+++ content/browser/indexed_db/indexed_db_backing_store.cc -@@ -2433,7 +2433,7 @@ bool IndexedDBBackingStore::WriteBlobFil - // The round-trip can be lossy; round to nearest millisecond. - int64_t delta = - (descriptor.last_modified() - info.last_modified).InMilliseconds(); -- if (std::abs(delta) > 1) -+ if (std::labs(delta) > 1) - return false; - } - if (!base::TouchFile(path, info.last_accessed, info.last_modified)) { Index: head/www/chromium/files/patch-content_browser_media_media__internals.cc =================================================================== --- head/www/chromium/files/patch-content_browser_media_media__internals.cc +++ head/www/chromium/files/patch-content_browser_media_media__internals.cc @@ -0,0 +1,11 @@ +--- content/browser/media/media_internals.cc.orig 2016-10-06 04:02:18.000000000 +0300 ++++ content/browser/media/media_internals.cc 2016-10-13 06:53:50.938946000 +0300 +@@ -724,7 +724,7 @@ + device_dict->SetString("name", descriptor.GetNameAndModel()); + device_dict->Set("formats", format_list); + #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ +- defined(OS_ANDROID) ++ defined(OS_ANDROID) || defined(OS_BSD) + device_dict->SetString("captureApi", descriptor.GetCaptureApiTypeString()); + #endif + video_capture_capabilities_cached_data_.Append(std::move(device_dict)); Index: head/www/chromium/files/patch-content_browser_ppapi__plugin__process__host.cc =================================================================== --- head/www/chromium/files/patch-content_browser_ppapi__plugin__process__host.cc +++ head/www/chromium/files/patch-content_browser_ppapi__plugin__process__host.cc @@ -1,5 +1,5 @@ ---- content/browser/ppapi_plugin_process_host.cc.orig 2016-05-11 19:02:20 UTC -+++ content/browser/ppapi_plugin_process_host.cc +--- content/browser/ppapi_plugin_process_host.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/ppapi_plugin_process_host.cc 2016-08-18 02:36:09.470007000 +0300 @@ -49,7 +49,7 @@ namespace content { @@ -9,7 +9,7 @@ ZygoteHandle g_ppapi_zygote; #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) -@@ -113,7 +113,7 @@ class PpapiPluginSandboxedProcessLaunche +@@ -114,7 +114,7 @@ } #elif defined(OS_POSIX) @@ -18,7 +18,7 @@ ZygoteHandle* GetZygote() override { const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); -@@ -213,7 +213,7 @@ PpapiPluginProcessHost* PpapiPluginProce +@@ -214,7 +214,7 @@ return NULL; } @@ -27,3 +27,12 @@ // static void PpapiPluginProcessHost::EarlyZygoteLaunch() { DCHECK(!g_ppapi_zygote); +@@ -377,7 +377,7 @@ + base::CommandLine::StringType plugin_launcher = + browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + int flags = plugin_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : + ChildProcessHost::CHILD_NORMAL; + #else Index: head/www/chromium/files/patch-content_browser_renderer__host_media_video__capture__device__client.cc =================================================================== --- head/www/chromium/files/patch-content_browser_renderer__host_media_video__capture__device__client.cc +++ head/www/chromium/files/patch-content_browser_renderer__host_media_video__capture__device__client.cc @@ -0,0 +1,11 @@ +--- content/browser/renderer_host/media/video_capture_device_client.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/renderer_host/media/video_capture_device_client.cc 2016-08-18 02:29:10.788160000 +0300 +@@ -181,7 +181,7 @@ + // see http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html. + // Windows RGB24 defines blue at lowest byte, + // see https://msdn.microsoft.com/en-us/library/windows/desktop/dd407253 +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + origin_colorspace = libyuv::FOURCC_RAW; + #elif defined(OS_WIN) + origin_colorspace = libyuv::FOURCC_24BG; Index: head/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc =================================================================== --- head/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc +++ head/www/chromium/files/patch-content_browser_renderer__host_render__process__host__impl.cc @@ -1,6 +1,6 @@ ---- content/browser/renderer_host/render_process_host_impl.cc.orig 2016-05-20 17:18:26 UTC -+++ content/browser/renderer_host/render_process_host_impl.cc -@@ -366,7 +366,7 @@ SiteProcessMap* GetSiteProcessMapForBrow +--- content/browser/renderer_host/render_process_host_impl.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/renderer_host/render_process_host_impl.cc 2016-08-18 02:32:43.439813000 +0300 +@@ -359,7 +359,7 @@ return map; } @@ -9,7 +9,7 @@ // This static member variable holds the zygote communication information for // the renderer. ZygoteHandle g_render_zygote; -@@ -399,7 +399,7 @@ class RendererSandboxedProcessLauncherDe +@@ -392,7 +392,7 @@ } #elif defined(OS_POSIX) @@ -18,7 +18,7 @@ ZygoteHandle* GetZygote() override { const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); -@@ -539,7 +539,7 @@ void RenderProcessHost::SetMaxRendererPr +@@ -514,7 +514,7 @@ g_max_renderer_count_override = count; } @@ -27,3 +27,12 @@ // static void RenderProcessHostImpl::EarlyZygoteLaunch() { DCHECK(!g_render_zygote); +@@ -684,7 +684,7 @@ + renderer_prefix = + browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + int flags = renderer_prefix.empty() ? ChildProcessHost::CHILD_ALLOW_SELF + : ChildProcessHost::CHILD_NORMAL; + #else Index: head/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc =================================================================== --- head/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc +++ head/www/chromium/files/patch-content_browser_renderer__host_render__widget__host__view__aura.cc @@ -1,29 +1,29 @@ ---- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2016-07-22 00:06:54.000000000 -0400 -+++ content/browser/renderer_host/render_widget_host_view_aura.cc 2016-08-03 12:34:00.357612000 -0400 -@@ -105,7 +105,7 @@ +--- content/browser/renderer_host/render_widget_host_view_aura.cc.orig 2016-10-06 04:02:18.000000000 +0300 ++++ content/browser/renderer_host/render_widget_host_view_aura.cc 2016-10-13 07:01:47.728403000 +0300 +@@ -106,7 +106,7 @@ #include "ui/gfx/gdi_util.h" #endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) || defined(OS_BSD) - #include "content/common/input_messages.h" - #include "ui/events/linux/text_edit_command_auralinux.h" - #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" -@@ -2376,7 +2376,7 @@ + #include "ui/base/ime/linux/text_edit_command_auralinux.h" + #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" + #endif +@@ -2479,7 +2479,7 @@ } bool RenderWidgetHostViewAura::NeedsMouseCapture() { -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) ++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) || defined(OS_BSD) return NeedsInputGrab(); #endif return false; -@@ -2608,7 +2608,7 @@ +@@ -2711,7 +2711,7 @@ if (!target_host) return; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) ++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) || defined(OS_BSD) ui::TextEditKeyBindingsDelegateAuraLinux* keybinding_delegate = ui::GetTextEditKeyBindingsDelegate(); std::vector commands; Index: head/www/chromium/files/patch-content_browser_tracing_tracing__controller__impl.cc =================================================================== --- head/www/chromium/files/patch-content_browser_tracing_tracing__controller__impl.cc +++ head/www/chromium/files/patch-content_browser_tracing_tracing__controller__impl.cc @@ -0,0 +1,11 @@ +--- content/browser/tracing/tracing_controller_impl.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/tracing/tracing_controller_impl.cc 2016-08-18 02:46:09.991782000 +0300 +@@ -496,7 +496,7 @@ + return; + } + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // On Linux the browser process dumps process metrics for child process due to + // sandbox. + tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess( Index: head/www/chromium/files/patch-content_browser_utility__process__host__impl.cc =================================================================== --- head/www/chromium/files/patch-content_browser_utility__process__host__impl.cc +++ head/www/chromium/files/patch-content_browser_utility__process__host__impl.cc @@ -1,6 +1,6 @@ ---- content/browser/utility_process_host_impl.cc.orig 2016-05-11 19:02:21 UTC -+++ content/browser/utility_process_host_impl.cc -@@ -37,7 +37,7 @@ +--- content/browser/utility_process_host_impl.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/browser/utility_process_host_impl.cc 2016-08-18 02:26:27.996136000 +0300 +@@ -38,7 +38,7 @@ #include "ipc/ipc_switches.h" #include "ui/base/ui_base_switches.h" @@ -9,7 +9,7 @@ #include "content/public/browser/zygote_handle_linux.h" #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) -@@ -48,7 +48,7 @@ +@@ -49,7 +49,7 @@ namespace content { @@ -18,7 +18,7 @@ namespace { ZygoteHandle g_utility_zygote; } // namespace -@@ -68,7 +68,7 @@ class UtilitySandboxedProcessLauncherDel +@@ -69,7 +69,7 @@ launch_elevated_(launch_elevated) #elif defined(OS_POSIX) env_(env), @@ -27,7 +27,7 @@ no_sandbox_(no_sandbox), #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) ipc_fd_(host->TakeClientFileDescriptor()) -@@ -100,7 +100,7 @@ class UtilitySandboxedProcessLauncherDel +@@ -101,7 +101,7 @@ #elif defined(OS_POSIX) @@ -36,7 +36,7 @@ ZygoteHandle* GetZygote() override { if (no_sandbox_ || !exposed_dir_.empty()) return nullptr; -@@ -122,7 +122,7 @@ class UtilitySandboxedProcessLauncherDel +@@ -123,7 +123,7 @@ bool launch_elevated_; #elif defined(OS_POSIX) base::EnvironmentMap env_; @@ -45,7 +45,16 @@ bool no_sandbox_; #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) base::ScopedFD ipc_fd_; -@@ -238,7 +238,7 @@ void UtilityProcessHostImpl::SetName(con +@@ -151,7 +151,7 @@ + is_batch_mode_(false), + no_sandbox_(false), + run_elevated_(false), +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), + #else + child_flags_(ChildProcessHost::CHILD_NORMAL), +@@ -232,7 +232,7 @@ name_ = name; } Index: head/www/chromium/files/patch-content_common_BUILD.gn =================================================================== --- head/www/chromium/files/patch-content_common_BUILD.gn +++ head/www/chromium/files/patch-content_common_BUILD.gn @@ -0,0 +1,27 @@ +--- content/common/BUILD.gn.orig 2016-08-03 22:02:18.000000000 +0300 ++++ content/common/BUILD.gn 2016-10-09 05:21:51.439131000 +0300 +@@ -179,7 +179,7 @@ + if (use_seccomp_bpf) { + defines += [ "USE_SECCOMP_BPF" ] + } else { +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources -= [ + "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc", + "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h", +@@ -193,6 +193,15 @@ + "sandbox_linux/bpf_utility_policy_linux.h", + "sandbox_linux/sandbox_bpf_base_policy_linux.cc", + "sandbox_linux/sandbox_bpf_base_policy_linux.h", ++ "sandbox_linux/sandbox_seccomp_bpf_linux.cc", ++ "sandbox_linux/sandbox_seccomp_bpf_linux.h", ++ ] ++ } ++ if (is_bsd) { ++ sources -= [ ++ "sandbox_linux/sandbox_linux.cc", ++ "sandbox_linux/sandbox_linux.h", ++ "sandbox_linux/sandbox_init_linux.cc", + ] + } + if (is_android) { Index: head/www/chromium/files/patch-content_content__browser.gypi =================================================================== --- head/www/chromium/files/patch-content_content__browser.gypi +++ head/www/chromium/files/patch-content_content__browser.gypi @@ -1,77 +0,0 @@ ---- content/content_browser.gypi.orig 2016-05-11 19:02:21 UTC -+++ content/content_browser.gypi -@@ -843,6 +843,8 @@ - 'browser/geolocation/wifi_data_provider_common_win.cc', - 'browser/geolocation/wifi_data_provider_common_win.h', - 'browser/geolocation/wifi_data_provider_corewlan_mac.mm', -+ 'browser/geolocation/wifi_data_provider_freebsd.cc', -+ 'browser/geolocation/wifi_data_provider_freebsd.h', - 'browser/geolocation/wifi_data_provider_linux.cc', - 'browser/geolocation/wifi_data_provider_linux.h', - 'browser/geolocation/wifi_data_provider_mac.cc', -@@ -1988,7 +1990,7 @@ - }, - }, - }], -- ['OS=="linux" and chromeos==0 and use_x11==1', { -+ ['(os_bsd==1 or OS=="linux") and chromeos==0 and use_x11==1', { - 'dependencies': [ - '../build/linux/system.gyp:atk', - '../build/linux/system.gyp:gconf', -@@ -2014,7 +2016,7 @@ - 'browser/gamepad/gamepad_platform_data_fetcher_linux.cc', - ], - }], -- ['OS=="linux" and use_aura==1', { -+ ['(os_bsd==1 or OS=="linux") and use_aura==1', { - 'dependencies': [ - '../build/linux/system.gyp:fontconfig', - ], -@@ -2109,8 +2111,24 @@ - ], - }], - ['os_bsd==1', { -- 'sources/': [ -- ['exclude', '^browser/gamepad/gamepad_platform_data_fetcher_linux\\.cc$'], -+ 'sources!': [ -+ 'public/browser/zygote_host_linux.h', -+ 'browser/zygote_host/zygote_communication_linux.cc', -+ 'browser/zygote_host/zygote_communication_linux.h', -+ 'browser/zygote_host/zygote_handle_linux.cc', -+ 'browser/zygote_host/zygote_host_impl_linux.cc', -+ 'browser/zygote_host/zygote_host_impl_linux.h', -+ 'zygote/zygote_linux.cc', -+ 'zygote/zygote_linux.h', -+ 'zygote/zygote_main_linux.cc', -+ 'browser/device_monitor_linux.cc', -+ 'browser/download/file_metadata_linux.cc', -+ 'browser/gamepad/gamepad_platform_data_fetcher_linux.cc', -+ 'browser/geolocation/wifi_data_provider_linux.cc', -+ 'browser/udev_linux.cc', -+ ], -+ 'dependencies': [ -+ '../build/linux/system.gyp:dbus', - ], - }], - ['use_aura==1', { -@@ -2159,10 +2177,7 @@ - 'browser/geolocation/empty_wifi_data_provider.cc', - ], - }], -- ['OS == "linux" and use_dbus==1', { -- 'sources!': [ -- 'browser/geolocation/empty_wifi_data_provider.cc', -- ], -+ ['(OS == "linux" or os_bsd==1) and use_dbus==1', { - 'dependencies': [ - '../build/linux/system.gyp:dbus', - '../dbus/dbus.gyp:dbus', -@@ -2178,7 +2193,7 @@ - 'browser/media/cdm/browser_cdm_manager.h', - ], - }], -- ['OS == "linux"', { -+ ['(os_bsd==1 or OS == "linux")', { - 'dependencies': [ - '../third_party/boringssl/boringssl.gyp:boringssl', - ], Index: head/www/chromium/files/patch-content_content__common.gypi =================================================================== --- head/www/chromium/files/patch-content_content__common.gypi +++ head/www/chromium/files/patch-content_content__common.gypi @@ -1,24 +0,0 @@ ---- content/content_common.gypi.orig 2016-05-11 19:02:21 UTC -+++ content/content_common.gypi -@@ -737,6 +737,21 @@ - 'content.gyp:common_aidl', - ], - }], -+ ['os_bsd==1', { -+ 'sources!': [ -+ 'common/sandbox_linux.cc', -+ 'common/sandbox_linux.h', -+ 'common/sandbox_init_linux.cc', -+ 'common/sandbox_seccomp_bpf_linux.cc', -+ 'common/sandbox_seccomp_bpf_linux.h', -+ 'common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc', -+ 'common/sandbox_linux/bpf_gpu_policy_linux.cc', -+ 'common/sandbox_linux/bpf_ppapi_policy_linux.cc', -+ 'common/sandbox_linux/bpf_renderer_policy_linux.cc', -+ 'common/sandbox_linux/sandbox_bpf_base_policy_linux.cc', -+ 'common/sandbox_linux/sandbox_seccomp_bpf_linux.cc', -+ ], -+ }], - ['use_pango == 1', { - 'dependencies': [ - '../build/linux/system.gyp:pangocairo', Index: head/www/chromium/files/patch-content_content__tests.gypi =================================================================== --- head/www/chromium/files/patch-content_content__tests.gypi +++ head/www/chromium/files/patch-content_content__tests.gypi @@ -1,18 +0,0 @@ ---- content/content_tests.gypi.orig 2016-05-25 15:01:01.000000000 -0400 -+++ content/content_tests.gypi 2016-05-27 10:58:38.919413000 -0400 -@@ -1186,6 +1186,15 @@ - 'renderer/media/video_track_recorder_unittest.cc', - ], - }], -+ ['OS == "freebsd"', { -+ 'sources!': [ -+ 'browser/download/file_metadata_unittest_linux.cc', -+ 'browser/geolocation/wifi_data_provider_linux_unittest.cc', -+ 'browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc', -+ 'browser/renderer_host/media/media_stream_manager_unittest.cc', -+ 'browser/renderer_host/media/media_stream_ui_controller_unittest.cc' -+ ] -+ }], - # Avoid windows due to non-availability of cursor resources in test. - ['OS != "linux"', { - 'sources!': [ Index: head/www/chromium/files/patch-content_gpu_BUILD.gn =================================================================== --- head/www/chromium/files/patch-content_gpu_BUILD.gn +++ head/www/chromium/files/patch-content_gpu_BUILD.gn @@ -0,0 +1,10 @@ +--- content/gpu/BUILD.gn.orig 2016-10-06 04:02:19.000000000 +0300 ++++ content/gpu/BUILD.gn 2016-10-15 10:05:38.417673000 +0300 +@@ -98,6 +98,7 @@ + + if (use_x11) { + deps += [ "//ui/events/platform/x11" ] ++ configs += [ "//build/config/linux:x11" ] + } + + if (use_ozone) { Index: head/www/chromium/files/patch-content_gpu_gpu__child__thread.cc =================================================================== --- head/www/chromium/files/patch-content_gpu_gpu__child__thread.cc +++ head/www/chromium/files/patch-content_gpu_gpu__child__thread.cc @@ -1,14 +1,14 @@ ---- content/gpu/gpu_child_thread.cc.orig 2016-05-11 19:02:21 UTC -+++ content/gpu/gpu_child_thread.cc -@@ -382,6 +382,7 @@ void GpuChildThread::StopWatchdog() { - } +--- content/gpu/gpu_child_thread.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ content/gpu/gpu_child_thread.cc 2016-10-14 15:27:34.081648000 +0300 +@@ -419,6 +419,7 @@ + if (dead_on_arrival_) + return; - void GpuChildThread::OnCollectGraphicsInfo() { -+#if !defined(OS_FREEBSD) ++#if !defined(OS_BSD) #if defined(OS_WIN) // GPU full info collection should only happen on un-sandboxed GPU process // or single process/in-process gpu mode on Windows. -@@ -424,6 +425,7 @@ void GpuChildThread::OnCollectGraphicsIn +@@ -461,6 +462,7 @@ base::MessageLoop::current()->QuitWhenIdle(); } #endif // OS_WIN Index: head/www/chromium/files/patch-content_gpu_gpu__main.cc =================================================================== --- head/www/chromium/files/patch-content_gpu_gpu__main.cc +++ head/www/chromium/files/patch-content_gpu_gpu__main.cc @@ -1,14 +1,14 @@ ---- content/gpu/gpu_main.cc.orig 2016-07-22 00:06:54.000000000 -0400 -+++ content/gpu/gpu_main.cc 2016-08-03 12:37:05.590978000 -0400 +--- content/gpu/gpu_main.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/gpu/gpu_main.cc 2016-08-10 15:59:24.697490000 +0300 @@ -102,7 +102,7 @@ const base::CommandLine& command_line); bool WarmUpSandbox(const base::CommandLine& command_line); - + -#if !defined(OS_MACOSX) -+#if !defined(OS_MACOSX) && !defined(OS_FREEBSD) //XXX(rene) added !FreeBSD ++#if !defined(OS_MACOSX) && !defined(OS_BSD) bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info); #endif - + @@ -192,13 +192,13 @@ // Use a UI message loop because ANGLE and the desktop GL platform can // create child windows to render to. @@ -21,7 +21,7 @@ std::unique_ptr event_source = ui::PlatformEventSource::CreateDefault(); -#elif defined(OS_LINUX) -+#elif (defined(OS_LINUX) || defined(OS_BSD)) ++#elif defined(OS_LINUX) || defined(OS_BSD) base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); #elif defined(OS_MACOSX) // This is necessary for CoreAnimation layers hosted in the GPU process to be @@ -30,16 +30,16 @@ base::TimeTicks before_collect_context_graphics_info = base::TimeTicks::Now(); -#if !defined(OS_MACOSX) -+#if !defined(OS_MACOSX) && !defined(OS_FREEBSD) //XXX(rene) added !FreeBSD ++#if !defined(OS_MACOSX) && !defined(OS_BSD) if (!CollectGraphicsInfo(gpu_info)) dead_on_arrival = true; - + @@ -491,7 +491,7 @@ return true; } - + -#if !defined(OS_MACOSX) -+#if !defined(OS_MACOSX) && !defined(OS_FREEBSD)//XXX(rene) added !FreeBSD ++#if !defined(OS_MACOSX) && !defined(OS_BSD) bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info) { TRACE_EVENT0("gpu,startup", "Collect Graphics Info"); - + Index: head/www/chromium/files/patch-content_public_common_child__process__host.h =================================================================== --- head/www/chromium/files/patch-content_public_common_child__process__host.h +++ head/www/chromium/files/patch-content_public_common_child__process__host.h @@ -0,0 +1,20 @@ +--- ./content/public/common/child_process_host.h.orig 2016-07-20 22:03:24.000000000 +0300 ++++ ./content/public/common/child_process_host.h 2016-08-18 02:52:30.173927000 +0300 +@@ -50,7 +50,7 @@ + // No special behavior requested. + CHILD_NORMAL = 0, + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // Indicates that the child execed after forking may be execced from + // /proc/self/exe rather than using the "real" app path. This prevents + // autoupdate from confusing us if it changes the file out from under us. +@@ -59,7 +59,7 @@ + // gdb). In this case, you'd use GetChildPath to get the real executable + // file name, and then prepend the GDB command to the command line. + CHILD_ALLOW_SELF = 1 << 0, +-#endif // defined(OS_LINUX) ++#endif // defined(OS_LINUX) || defined(OS_BSD) + }; + + // Returns the pathname to be used for a child process. If a subprocess Index: head/www/chromium/files/patch-content_renderer_devtools_v8__sampling__profiler.cc =================================================================== --- head/www/chromium/files/patch-content_renderer_devtools_v8__sampling__profiler.cc +++ head/www/chromium/files/patch-content_renderer_devtools_v8__sampling__profiler.cc @@ -4,7 +4,7 @@ state.pc = reinterpret_cast(mcontext->__ss.REG_64_32(__rip, __eip)); state.sp = reinterpret_cast(mcontext->__ss.REG_64_32(__rsp, __esp)); state.fp = reinterpret_cast(mcontext->__ss.REG_64_32(__rbp, __ebp)); -+#elif defined(OS_FREEBSD) ++#elif defined(OS_BSD) + state.pc = reinterpret_cast(mcontext.REG_64_32(mc_rip, mc_eip)); + state.sp = reinterpret_cast(mcontext.REG_64_32(mc_rsp, mc_esp)); + state.fp = reinterpret_cast(mcontext.REG_64_32(mc_rbp, mc_ebp)); Index: head/www/chromium/files/patch-content_renderer_media_webrtc__audio__renderer.cc =================================================================== --- head/www/chromium/files/patch-content_renderer_media_webrtc__audio__renderer.cc +++ head/www/chromium/files/patch-content_renderer_media_webrtc__audio__renderer.cc @@ -1,11 +0,0 @@ ---- content/renderer/media/webrtc_audio_renderer.cc.orig 2016-06-08 12:04:14.328279000 -0400 -+++ content/renderer/media/webrtc_audio_renderer.cc 2016-06-08 12:04:28.210758000 -0400 -@@ -162,7 +162,7 @@ - // Windows below. - int frames_per_buffer = hardware_buffer_size; - --#if defined(OS_LINUX) || defined(OS_MACOSX) -+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) - // On Linux and MacOS, the low level IO implementations on the browser side - // supports all buffer size the clients want. We use the native peer - // connection buffer size (10ms) to achieve best possible performance. Index: head/www/chromium/files/patch-content_renderer_media_webrtc_processed__local__audio__source.cc =================================================================== --- head/www/chromium/files/patch-content_renderer_media_webrtc_processed__local__audio__source.cc +++ head/www/chromium/files/patch-content_renderer_media_webrtc_processed__local__audio__source.cc @@ -1,11 +1,13 @@ ---- ./content/renderer/media/webrtc/processed_local_audio_source.cc.orig 2016-08-03 12:48:04.721257000 -0400 -+++ ./content/renderer/media/webrtc/processed_local_audio_source.cc 2016-08-03 12:48:34.201210000 -0400 -@@ -269,7 +269,7 @@ +--- content/renderer/media/webrtc/processed_local_audio_source.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/renderer/media/webrtc/processed_local_audio_source.cc 2016-08-01 03:25:27.013281000 +0300 +@@ -269,8 +269,8 @@ bool key_pressed) { #if defined(OS_WIN) || defined(OS_MACOSX) DCHECK_LE(volume, 1.0); -#elif (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_OPENBSD) -+#elif (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) - // We have a special situation on Linux where the microphone volume can be +- // We have a special situation on Linux where the microphone volume can be ++#elif defined(OS_POSIX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID) ++ // We have a special situation on POSIX where the microphone volume can be // "higher than maximum". The input volume slider in the sound preference // allows the user to set a scaling that is higher than 100%. It means that + // even if the reported maximum levels is N, the actual microphone level can Index: head/www/chromium/files/patch-content_renderer_render__thread__impl.cc =================================================================== --- head/www/chromium/files/patch-content_renderer_render__thread__impl.cc +++ head/www/chromium/files/patch-content_renderer_render__thread__impl.cc @@ -1,5 +1,5 @@ ---- content/renderer/render_thread_impl.cc.orig 2016-07-22 00:06:54.000000000 -0400 -+++ content/renderer/render_thread_impl.cc 2016-08-03 14:17:16.736255000 -0400 +--- content/renderer/render_thread_impl.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/renderer/render_thread_impl.cc 2016-08-01 04:09:35.329085000 +0300 @@ -1424,7 +1424,7 @@ const bool enable_video_accelerator = !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); Index: head/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc =================================================================== --- head/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc +++ head/www/chromium/files/patch-content_renderer_renderer__blink__platform__impl.cc @@ -1,56 +1,56 @@ ---- content/renderer/renderer_blink_platform_impl.cc.orig 2016-05-27 22:47:40.255637000 -0400 -+++ content/renderer/renderer_blink_platform_impl.cc 2016-05-28 10:09:25.718992000 -0400 -@@ -116,7 +116,7 @@ +--- content/renderer/renderer_blink_platform_impl.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ content/renderer/renderer_blink_platform_impl.cc 2016-10-13 07:15:18.714150000 +0300 +@@ -114,7 +114,7 @@ #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" -#if !defined(OS_MACOSX) && !defined(OS_ANDROID) -+#if !defined(OS_MACOSX) && !defined(OS_ANDROID) && !defined(OS_FREEBSD) ++#if !defined(OS_MACOSX) && !defined(OS_ANDROID) && !defined(OS_BSD) #include #include -@@ -207,7 +207,7 @@ +@@ -219,7 +219,7 @@ scoped_refptr thread_safe_sender_; }; -#if !defined(OS_ANDROID) && !defined(OS_WIN) -+#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_FREEBSD) ++#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_BSD) class RendererBlinkPlatformImpl::SandboxSupport : public blink::WebSandboxSupport { public: -@@ -253,7 +253,7 @@ - web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), +@@ -266,7 +266,7 @@ renderer_scheduler_(renderer_scheduler), - blink_service_registry_(new BlinkServiceRegistryImpl(service_registry)) { + blink_interface_provider_( + new BlinkInterfaceProviderImpl(remote_interfaces)) { -#if !defined(OS_ANDROID) && !defined(OS_WIN) -+#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_FREEBSD) ++#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_BSD) if (g_sandbox_enabled && sandboxEnabled()) { sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); } else { -@@ -284,7 +284,7 @@ +@@ -297,7 +297,7 @@ } void RendererBlinkPlatformImpl::Shutdown() { -#if !defined(OS_ANDROID) && !defined(OS_WIN) -+#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_FREEBSD) ++#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_BSD) // SandboxSupport contains a map of WebFontFamily objects, which hold // WebCStrings, which become invalidated when blink is shut down. Hence, we // need to clear that map now, just before blink::shutdown() is called. -@@ -334,7 +334,7 @@ +@@ -349,7 +349,7 @@ } blink::WebSandboxSupport* RendererBlinkPlatformImpl::sandboxSupport() { -#if defined(OS_ANDROID) || defined(OS_WIN) -+#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_FREEBSD) ++#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_BSD) // These platforms do not require sandbox support. return NULL; #else -@@ -562,7 +562,7 @@ +@@ -602,7 +602,7 @@ return FontLoader::CGFontRefFromBuffer(font_data, font_data_size, out); } -#elif defined(OS_POSIX) && !defined(OS_ANDROID) -+#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_FREEBSD) ++#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_BSD) void RendererBlinkPlatformImpl::SandboxSupport::getFallbackFontForCharacter( blink::WebUChar32 character, Index: head/www/chromium/files/patch-content_renderer_webscrollbarbehavior__impl__gtkoraura.cc =================================================================== --- head/www/chromium/files/patch-content_renderer_webscrollbarbehavior__impl__gtkoraura.cc +++ head/www/chromium/files/patch-content_renderer_webscrollbarbehavior__impl__gtkoraura.cc @@ -1,15 +1,15 @@ ---- content/renderer/webscrollbarbehavior_impl_gtkoraura.cc.orig 2016-03-25 13:04:49 UTC -+++ content/renderer/webscrollbarbehavior_impl_gtkoraura.cc -@@ -14,7 +14,7 @@ bool WebScrollbarBehaviorImpl::shouldCen - blink::WebScrollbarBehavior::Button mouseButton, +--- content/renderer/webscrollbarbehavior_impl_gtkoraura.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ content/renderer/webscrollbarbehavior_impl_gtkoraura.cc 2016-10-13 07:18:08.506709000 +0300 +@@ -14,7 +14,7 @@ + blink::WebPointerProperties::Button mouseButton, bool shiftKeyPressed, bool altKeyPressed) { -#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) -+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS) - if (mouseButton == blink::WebScrollbarBehavior::ButtonMiddle) ++#if ((defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)) + if (mouseButton == blink::WebPointerProperties::Button::Middle) return true; #endif -@@ -50,7 +50,7 @@ bool WebScrollbarBehaviorImpl::shouldSna +@@ -50,7 +50,7 @@ // On most platforms, we should snap iff the event is outside our calculated // rect. On Linux, however, we should not snap for events off the ends, but // not the sides, of the rect. Index: head/www/chromium/files/patch-content_shell_BUILD.gn =================================================================== --- head/www/chromium/files/patch-content_shell_BUILD.gn +++ head/www/chromium/files/patch-content_shell_BUILD.gn @@ -0,0 +1,38 @@ +--- content/shell/BUILD.gn.orig 2016-08-03 22:02:18.000000000 +0300 ++++ content/shell/BUILD.gn 2016-09-18 01:45:17.587900000 +0300 +@@ -275,7 +275,7 @@ + ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + deps += [ + "//build/linux:fontconfig", + "//ui/gfx:test_support", +@@ -296,7 +296,7 @@ + deps += [ "//content/shell/android:content_shell_jni_headers" ] + } + +- if (is_posix && !is_mac) { ++ if (is_posix && !is_mac && !is_bsd) { + deps += [ + "//components/crash/content/app", + "//components/crash/content/browser", +@@ -338,7 +338,7 @@ + ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + deps += [ "//third_party/freetype2" ] + } + +@@ -496,7 +496,7 @@ + } + } + +- if (is_linux && !is_component_build) { ++ if ((is_linux || is_bsd) && !is_component_build) { + # Set rpath to find our own libfreetype even in a non-component build. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } Index: head/www/chromium/files/patch-content_shell_browser_shell__browser__context.cc =================================================================== --- head/www/chromium/files/patch-content_shell_browser_shell__browser__context.cc +++ head/www/chromium/files/patch-content_shell_browser_shell__browser__context.cc @@ -1,5 +1,5 @@ ---- content/shell/browser/shell_browser_context.cc.orig 2016-07-22 00:06:54.000000000 -0400 -+++ content/shell/browser/shell_browser_context.cc 2016-08-03 15:17:20.501518000 -0400 +--- content/shell/browser/shell_browser_context.cc.orig 2016-07-20 22:03:24.000000000 +0300 ++++ content/shell/browser/shell_browser_context.cc 2016-08-01 04:13:15.131738000 +0300 @@ -24,7 +24,7 @@ #if defined(OS_WIN) Index: head/www/chromium/files/patch-content_test_BUILD.gn =================================================================== --- head/www/chromium/files/patch-content_test_BUILD.gn +++ head/www/chromium/files/patch-content_test_BUILD.gn @@ -0,0 +1,49 @@ +--- content/test/BUILD.gn.orig 2016-10-06 04:02:19.000000000 +0300 ++++ content/test/BUILD.gn 2016-10-27 21:01:00.854720000 +0300 +@@ -377,7 +377,7 @@ + ".", + "//content") + +- if (is_android || is_linux || is_mac || is_win) { ++ if (is_android || is_linux || is_bsd || is_mac || is_win) { + data = [ + "$root_out_dir/content_shell.pak", + "data/", +@@ -615,7 +615,7 @@ + ".", + "//content") + +- if (is_android || is_linux || is_mac || is_win) { ++ if (is_android || is_linux || is_bsd || is_mac || is_win) { + data = [ + "$root_out_dir/content_shell.pak", + "data/", +@@ -738,7 +738,7 @@ + "//ui/shell_dialogs:shell_dialogs", + ] + +- if (is_linux || is_mac || is_win) { ++ if (is_linux || is_bsd || is_mac || is_win) { + sources += + [ "../browser/media/capture/desktop_capture_device_unittest.cc" ] + deps += [ "//third_party/webrtc/modules/desktop_capture" ] +@@ -772,7 +772,7 @@ + "//content") + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (use_dbus) { + deps += [ "//dbus:test_support" ] + } +@@ -855,6 +855,10 @@ + sources -= [ "../common/plugin_list_unittest.cc" ] + } + ++ if (is_bsd) { ++ sources -= [ "../browser/download/file_metadata_unittest_linux.cc"] ++ } ++ + if (use_ozone) { + deps += [ "//ui/ozone" ] + } else { Index: head/www/chromium/files/patch-crypto_nss__util.cc =================================================================== --- head/www/chromium/files/patch-crypto_nss__util.cc +++ head/www/chromium/files/patch-crypto_nss__util.cc @@ -1,7 +1,7 @@ ---- crypto/nss_util.cc.orig 2016-05-11 19:02:22 UTC -+++ crypto/nss_util.cc -@@ -15,7 +15,7 @@ - +--- crypto/nss_util.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ crypto/nss_util.cc 2016-10-13 07:19:30.151634000 +0300 +@@ -20,7 +20,7 @@ + #include "base/threading/thread_task_runner_handle.h" #include "crypto/nss_util_internal.h" -#if defined(OS_OPENBSD) @@ -9,16 +9,7 @@ #include #include #endif -@@ -147,7 +147,7 @@ char* PKCS11PasswordFunc(PK11SlotInfo* s - // detection when database_dir is on NFS. See http://crbug.com/48585. - // - // TODO(wtc): port this function to other USE_NSS_CERTS platforms. It is --// defined only for OS_LINUX and OS_OPENBSD simply because the statfs structure -+// defined only for OS_LINUX and OS_BSD simply because the statfs structure - // is OS-specific. - // - // Because this function sets an environment variable it must be run before we -@@ -158,10 +158,10 @@ void UseLocalCacheOfNSSDatabaseIfNFS(con +@@ -150,10 +150,10 @@ base::FileSystemType fs_type = base::FILE_SYSTEM_UNKNOWN; if (base::GetFileSystemType(database_dir, &fs_type)) db_on_nfs = (fs_type == base::FILE_SYSTEM_NFS); Index: head/www/chromium/files/patch-device_BUILD.gn =================================================================== --- head/www/chromium/files/patch-device_BUILD.gn +++ head/www/chromium/files/patch-device_BUILD.gn @@ -0,0 +1,11 @@ +--- device/BUILD.gn.orig 2016-08-03 22:02:18.000000000 +0300 ++++ device/BUILD.gn 2016-09-03 02:02:55.005651000 +0300 +@@ -162,7 +162,7 @@ + ] + } + +- if ((is_chromeos || is_linux) && use_dbus) { ++ if ((is_chromeos || is_linux || is_bsd) && use_dbus) { + configs += [ "//build/config/linux/dbus" ] + + sources += [ Index: head/www/chromium/files/patch-device_battery_BUILD.gn =================================================================== --- head/www/chromium/files/patch-device_battery_BUILD.gn +++ head/www/chromium/files/patch-device_battery_BUILD.gn @@ -0,0 +1,11 @@ +--- device/battery/BUILD.gn.orig 2016-08-03 22:02:18.000000000 +0300 ++++ device/battery/BUILD.gn 2016-09-03 02:03:11.489591000 +0300 +@@ -47,7 +47,7 @@ + ] + } + +- if (is_linux && !is_chromeos) { ++ if ((is_linux || is_bsd) && !is_chromeos) { + if (use_dbus) { + configs += [ "//build/config/linux/dbus" ] + deps += [ "//dbus" ] Index: head/www/chromium/files/patch-device_geolocation_BUILD.gn =================================================================== --- head/www/chromium/files/patch-device_geolocation_BUILD.gn +++ head/www/chromium/files/patch-device_geolocation_BUILD.gn @@ -0,0 +1,11 @@ +--- device/geolocation/BUILD.gn.orig 2016-10-06 04:02:19.000000000 +0300 ++++ device/geolocation/BUILD.gn 2016-10-13 13:27:05.983826000 +0300 +@@ -93,7 +93,7 @@ + if (is_android) { + sources -= [ "wifi_data_provider_common.cc" ] + } +- if (is_chromeos || (is_linux && !use_dbus)) { ++ if (is_chromeos || (is_linux && !use_dbus) || is_bsd) { + sources -= [ "wifi_data_provider_linux.cc" ] + } + if (is_linux && use_dbus) { Index: head/www/chromium/files/patch-device_geolocation_location__arbitrator__impl.cc =================================================================== --- head/www/chromium/files/patch-device_geolocation_location__arbitrator__impl.cc +++ head/www/chromium/files/patch-device_geolocation_location__arbitrator__impl.cc @@ -0,0 +1,11 @@ +--- device/geolocation/location_arbitrator_impl.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ device/geolocation/location_arbitrator_impl.cc 2016-10-14 20:31:25.130350000 +0300 +@@ -167,7 +167,7 @@ + + std::unique_ptr + LocationArbitratorImpl::NewSystemLocationProvider() { +-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ++#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) + return nullptr; + #else + return device::NewSystemLocationProvider(); Index: head/www/chromium/files/patch-device_hid_BUILD.gn =================================================================== --- head/www/chromium/files/patch-device_hid_BUILD.gn +++ head/www/chromium/files/patch-device_hid_BUILD.gn @@ -0,0 +1,16 @@ +--- device/hid/BUILD.gn.orig 2016-08-03 22:02:18.000000000 +0300 ++++ device/hid/BUILD.gn 2016-09-24 04:03:54.837948000 +0300 +@@ -57,6 +57,13 @@ + deps += [ "//device/udev_linux" ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "hid_connection_linux.cc", ++ "hid_connection_linux.h", ++ ] ++ } ++ + if (is_chromeos) { + deps += [ "//chromeos" ] + } Index: head/www/chromium/files/patch-device_hid_hid.gyp =================================================================== --- head/www/chromium/files/patch-device_hid_hid.gyp +++ head/www/chromium/files/patch-device_hid_hid.gyp @@ -1,21 +0,0 @@ ---- device/hid/hid.gyp.orig 2016-05-11 19:02:22 UTC -+++ device/hid/hid.gyp -@@ -64,6 +64,18 @@ - 'input_service_linux.h', - ], - }], -+ ['os_bsd==1', { -+ 'sources!': [ -+ 'device_monitor_linux.cc', -+ 'device_monitor_linux.h', -+ 'hid_connection_linux.cc', -+ 'hid_connection_linux.h', -+ 'hid_service_linux.cc', -+ 'hid_service_linux.h', -+ 'input_service_linux.cc', -+ 'input_service_linux.h', -+ ], -+ }], - ], - }, - { Index: head/www/chromium/files/patch-device_media__transfer__protocol_media__transfer__protocol__manager.h =================================================================== --- head/www/chromium/files/patch-device_media__transfer__protocol_media__transfer__protocol__manager.h +++ head/www/chromium/files/patch-device_media__transfer__protocol_media__transfer__protocol__manager.h @@ -0,0 +1,11 @@ +--- device/media_transfer_protocol/media_transfer_protocol_manager.h.orig 2016-07-17 14:17:13.836047000 +0300 ++++ device/media_transfer_protocol/media_transfer_protocol_manager.h 2016-07-17 14:16:48.004323000 +0300 +@@ -15,7 +15,7 @@ + #include "base/memory/ref_counted.h" + #include "build/build_config.h" + +-#if !defined(OS_LINUX) ++#if !defined(OS_LINUX) && !defined(OS_FREEBSD) + #error "Only used on Linux and ChromeOS" + #endif + Index: head/www/chromium/files/patch-device_serial_BUILD.gn =================================================================== --- head/www/chromium/files/patch-device_serial_BUILD.gn +++ head/www/chromium/files/patch-device_serial_BUILD.gn @@ -0,0 +1,24 @@ +--- device/serial/BUILD.gn.orig 2016-08-03 22:02:18.000000000 +0300 ++++ device/serial/BUILD.gn 2016-09-24 04:10:00.137337000 +0300 +@@ -6,7 +6,7 @@ + import("//mojo/public/tools/bindings/mojom.gni") + + # Library works only on desktop platforms. +-assert(is_win || is_linux || is_mac) ++assert(is_win || is_linux || is_bsd || is_mac) + + config("platform_support") { + visibility = [ ":serial" ] +@@ -70,6 +70,12 @@ + if (use_udev) { + deps += [ "//device/udev_linux" ] + } ++ if (is_bsd) { ++ sources -= [ ++ "serial_device_enumerator_linux.cc", ++ "serial_device_enumerator_linux.h" ++ ] ++ } + if (is_chromeos) { + deps += [ + "//chromeos", Index: head/www/chromium/files/patch-device_serial_serial.gyp =================================================================== --- head/www/chromium/files/patch-device_serial_serial.gyp +++ head/www/chromium/files/patch-device_serial_serial.gyp @@ -1,15 +0,0 @@ ---- device/serial/serial.gyp.orig 2016-04-08 16:02:09 UTC -+++ device/serial/serial.gyp -@@ -71,6 +71,12 @@ - }, - }, - }], -+ ['os_bsd==1', { -+ 'sources!': [ -+ 'serial_device_enumerator_linux.cc', -+ 'serial_device_enumerator_linux.h', -+ ], -+ }], - ], - 'dependencies': [ - 'device_serial_mojo', Index: head/www/chromium/files/patch-device_usb_usb.gyp =================================================================== --- head/www/chromium/files/patch-device_usb_usb.gyp +++ head/www/chromium/files/patch-device_usb_usb.gyp @@ -1,19 +0,0 @@ ---- device/usb/usb.gyp.orig 2016-05-25 15:01:02.000000000 -0400 -+++ device/usb/usb.gyp 2016-05-30 13:54:50.903083000 -0400 -@@ -117,6 +117,16 @@ - 'usb_service_impl.h', - ] - }], -+ ['OS == "freebsd"', { -+ 'dependencies!': [ -+ '../../third_party/libusb/libusb.gyp:libusb', -+ ], -+ 'link_settings': { -+ 'ldflags': [ -+ '-L/usr/lib -lusb', -+ ], -+ }, -+ }], - ['chromeos==1', { - 'dependencies': [ - '../../chromeos/chromeos.gyp:chromeos', Index: head/www/chromium/files/patch-device_usb_usb__service__impl.cc =================================================================== --- head/www/chromium/files/patch-device_usb_usb__service__impl.cc +++ head/www/chromium/files/patch-device_usb_usb__service__impl.cc @@ -1,6 +1,6 @@ ---- device/usb/usb_service_impl.cc.orig 2016-05-11 19:02:22 UTC -+++ device/usb/usb_service_impl.cc -@@ -24,7 +24,11 @@ +--- device/usb/usb_service_impl.cc.orig 2016-10-06 04:02:19.000000000 +0300 ++++ device/usb/usb_service_impl.cc 2016-10-13 07:29:44.662206000 +0300 +@@ -26,7 +26,11 @@ #include "device/usb/usb_error.h" #include "device/usb/webusb_descriptors.h" #include "net/base/io_buffer.h" @@ -13,7 +13,7 @@ #if defined(OS_WIN) #include -@@ -292,6 +296,7 @@ UsbServiceImpl::UsbServiceImpl( +@@ -213,6 +217,7 @@ } context_ = new UsbContext(platform_context); @@ -21,7 +21,7 @@ rv = libusb_hotplug_register_callback( context_->context(), static_cast(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | -@@ -304,6 +309,8 @@ UsbServiceImpl::UsbServiceImpl( +@@ -225,6 +230,8 @@ } RefreshDevices(); @@ -30,19 +30,18 @@ #if defined(OS_WIN) DeviceMonitorWin* device_monitor = DeviceMonitorWin::GetForAllInterfaces(); if (device_monitor) { -@@ -313,9 +320,11 @@ UsbServiceImpl::UsbServiceImpl( +@@ -234,8 +241,10 @@ } UsbServiceImpl::~UsbServiceImpl() { +#if !defined(OS_FREEBSD) - if (hotplug_enabled_) { + if (hotplug_enabled_) libusb_hotplug_deregister_callback(context_->context(), hotplug_handle_); - } +#endif // !defined(OS_FREEBSD) - for (const auto& map_entry : devices_) { - map_entry.second->OnDisconnect(); - } -@@ -553,6 +562,7 @@ void UsbServiceImpl::RemoveDevice(scoped + for (auto* platform_device : ignored_devices_) + libusb_unref_device(platform_device); + } +@@ -477,6 +486,7 @@ device->OnDisconnect(); } @@ -50,7 +49,7 @@ // static int LIBUSB_CALL UsbServiceImpl::HotplugCallback(libusb_context* context, PlatformUsbDevice device, -@@ -590,6 +600,7 @@ int LIBUSB_CALL UsbServiceImpl::HotplugC +@@ -514,6 +524,7 @@ return 0; } Index: head/www/chromium/files/patch-extensions_browser_BUILD.gn =================================================================== --- head/www/chromium/files/patch-extensions_browser_BUILD.gn +++ head/www/chromium/files/patch-extensions_browser_BUILD.gn @@ -0,0 +1,11 @@ +--- extensions/browser/BUILD.gn.orig 2016-10-06 04:02:19.000000000 +0300 ++++ extensions/browser/BUILD.gn 2016-10-13 07:31:49.246712000 +0300 +@@ -85,7 +85,7 @@ + "//extensions") + sources += nonchromeos_sources + +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (use_dbus) { + deps += [ "//dbus" ] + } Index: head/www/chromium/files/patch-extensions_browser_api_serial_serial__api.cc =================================================================== --- head/www/chromium/files/patch-extensions_browser_api_serial_serial__api.cc +++ head/www/chromium/files/patch-extensions_browser_api_serial_serial__api.cc @@ -1,9 +1,10 @@ ---- extensions/browser/api/serial/serial_api.cc.orig 2016-07-22 00:06:55.000000000 -0400 -+++ extensions/browser/api/serial/serial_api.cc 2016-08-03 15:23:41.022195000 -0400 -@@ -86,11 +86,13 @@ +--- extensions/browser/api/serial/serial_api.cc.orig 2016-08-12 04:05:07.712438000 +0300 ++++ extensions/browser/api/serial/serial_api.cc 2016-08-12 04:06:56.974572000 +0300 +@@ -85,12 +85,13 @@ + void SerialGetDevicesFunction::Work() { DCHECK_CURRENTLY_ON(BrowserThread::FILE); - +- +#if !defined(OS_BSD) std::unique_ptr enumerator = device::SerialDeviceEnumerator::Create(); Index: head/www/chromium/files/patch-gpu_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_BUILD.gn +++ head/www/chromium/files/patch-gpu_BUILD.gn @@ -0,0 +1,11 @@ +--- gpu/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ gpu/BUILD.gn 2016-09-02 23:58:15.934039000 +0300 +@@ -122,7 +122,7 @@ + libs += [ "android" ] + deps += [ "//ui/android:ui_java" ] + } +- if (is_linux && !is_component_build) { ++ if ((is_linux || is_bsd) && !is_component_build) { + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + } Index: head/www/chromium/files/patch-gpu_config_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_config_BUILD.gn +++ head/www/chromium/files/patch-gpu_config_BUILD.gn @@ -0,0 +1,27 @@ +--- gpu/config/BUILD.gn.orig 2016-10-06 04:02:20.000000000 +0300 ++++ gpu/config/BUILD.gn 2016-10-29 18:18:32.848959000 +0300 +@@ -8,7 +8,8 @@ + + declare_args() { + # Use the PCI lib to collect GPU information on Linux. +- use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) && ++ use_libpci = (is_linux || is_bsd) && ++ (!is_chromecast || is_cast_desktop_build) && + (use_x11 || use_ozone) + } + +@@ -97,6 +98,14 @@ + ] + } + } ++ ++ if (is_bsd) { ++ sources -= [ ++ "gpu_info_collector_linux.cc", ++ "gpu_info_collector_linux.h" ++ ] ++ } ++ + if (is_mac) { + libs = [ + "IOKit.framework", Index: head/www/chromium/files/patch-gpu_config_gpu__control__list.cc =================================================================== --- head/www/chromium/files/patch-gpu_config_gpu__control__list.cc +++ head/www/chromium/files/patch-gpu_config_gpu__control__list.cc @@ -1,5 +1,5 @@ ---- gpu/config/gpu_control_list.cc.orig 2016-05-11 19:02:23 UTC -+++ gpu/config/gpu_control_list.cc +--- gpu/config/gpu_control_list.cc.orig 2016-07-20 22:03:25.000000000 +0300 ++++ gpu/config/gpu_control_list.cc 2016-08-11 00:15:11.700069000 +0300 @@ -17,7 +17,11 @@ #include "base/sys_info.h" #include "gpu/config/gpu_info.h" @@ -9,6 +9,24 @@ +#else #include "third_party/re2/src/re2/re2.h" +#endif - + namespace gpu { namespace { +@@ -1137,7 +1141,7 @@ + GpuControlList::GpuControlListEntry::GetDefaultGLType() { + #if defined(OS_CHROMEOS) + return kGLTypeGL; +-#elif defined(OS_LINUX) || defined(OS_OPENBSD) ++#elif defined(OS_LINUX) || defined(OS_BSD) + return kGLTypeGL; + #elif defined(OS_MACOSX) + return kGLTypeGL; +@@ -1575,7 +1579,7 @@ + return kOsWin; + #elif defined(OS_ANDROID) + return kOsAndroid; +-#elif defined(OS_LINUX) || defined(OS_OPENBSD) ++#elif defined(OS_LINUX) || defined(OS_BSD) + return kOsLinux; + #elif defined(OS_MACOSX) + return kOsMacosx; Index: head/www/chromium/files/patch-gpu_gles2__conform__support_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_gles2__conform__support_BUILD.gn +++ head/www/chromium/files/patch-gpu_gles2__conform__support_BUILD.gn @@ -0,0 +1,20 @@ +--- gpu/gles2_conform_support/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ gpu/gles2_conform_support/BUILD.gn 2016-09-02 23:59:14.071065000 +0300 +@@ -62,7 +62,7 @@ + "//gpu/gles2_conform_support/egl", + "//ui/gl", + ] +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ + "native/egl_native_aura.cc", + "native/egl_native_x11.cc", +@@ -132,7 +132,7 @@ + # Must be done this way for warning flags to be ordered correctly. + ":gles2_conform_test_warnings", + ] +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (!is_chromeos) { + deps += [ "//build/config/linux/gtk2" ] + } Index: head/www/chromium/files/patch-gpu_gles2__conform__support_native_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_gles2__conform__support_native_BUILD.gn +++ head/www/chromium/files/patch-gpu_gles2__conform__support_native_BUILD.gn @@ -0,0 +1,11 @@ +--- gpu/gles2_conform_support/native/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ gpu/gles2_conform_support/native/BUILD.gn 2016-09-02 23:58:43.787930000 +0300 +@@ -21,7 +21,7 @@ + "//gpu/gles2_conform_support/egl", + "//ui/gl", + ] +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ + "egl_native_aura.cc", + "egl_native_x11.cc", Index: head/www/chromium/files/patch-gpu_gpu__config.gypi =================================================================== --- head/www/chromium/files/patch-gpu_gpu__config.gypi +++ head/www/chromium/files/patch-gpu_gpu__config.gypi @@ -1,23 +0,0 @@ ---- gpu/gpu_config.gypi.orig 2016-05-11 19:02:23 UTC -+++ gpu/gpu_config.gypi -@@ -71,7 +71,7 @@ - '../build/linux/system.gyp:libpci', - ], - }], -- ['OS=="linux" and use_x11==1', { -+ ['(OS=="linux" or os_bsd==1) and use_x11==1', { - 'dependencies': [ - '../build/linux/system.gyp:x11', - '../build/linux/system.gyp:xext', -@@ -79,5 +79,11 @@ - '../ui/gfx/x/gfx_x11.gyp:gfx_x11', - ], - }], -+ ['os_bsd==1', { -+ 'sources!': [ -+ 'config/gpu_info_collector_linux.cc', -+ 'config/gpu_info_collector_linux.h', -+ ], -+ }] - ], - } Index: head/www/chromium/files/patch-gpu_gpu__ipc__service.gypi =================================================================== --- head/www/chromium/files/patch-gpu_gpu__ipc__service.gypi +++ head/www/chromium/files/patch-gpu_gpu__ipc__service.gypi @@ -1,11 +0,0 @@ ---- gpu/gpu_ipc_service.gypi.orig 2016-05-27 10:20:52.022966000 -0400 -+++ gpu/gpu_ipc_service.gypi 2016-05-27 10:21:13.721757000 -0400 -@@ -82,7 +82,7 @@ - ], - }, - }], -- ['OS=="linux"', { -+ ['OS=="linux" or os_bsd==1', { - 'sources': [ 'ipc/service/image_transport_surface_linux.cc' ], - }], - ['use_x11 == 1 and (target_arch != "arm" or chromeos == 0)', { Index: head/www/chromium/files/patch-gpu_ipc_client_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_ipc_client_BUILD.gn +++ head/www/chromium/files/patch-gpu_ipc_client_BUILD.gn @@ -0,0 +1,10 @@ +--- gpu/ipc/client/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ gpu/ipc/client/BUILD.gn 2016-10-10 14:54:17.518422000 +0300 +@@ -53,6 +53,7 @@ + configs += [ + "//build/config/compiler:no_size_t_to_int_warning", + "//gpu:gpu_implementation", ++ "//build/config/linux:x11", + ] + deps = [ + "//base", Index: head/www/chromium/files/patch-gpu_ipc_service_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_ipc_service_BUILD.gn +++ head/www/chromium/files/patch-gpu_ipc_service_BUILD.gn @@ -0,0 +1,16 @@ +--- gpu/ipc/service/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ gpu/ipc/service/BUILD.gn 2016-10-10 14:57:36.952170000 +0300 +@@ -92,11 +92,12 @@ + ] + libs += [ "android" ] + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ "image_transport_surface_linux.cc" ] + } + if (use_x11) { + sources += [ "x_util.h" ] ++ configs += [ "//build/config/linux:x11" ] + } + if (use_ozone) { + sources += [ Index: head/www/chromium/files/patch-gpu_tools_compositor__model__bench_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_tools_compositor__model__bench_BUILD.gn +++ head/www/chromium/files/patch-gpu_tools_compositor__model__bench_BUILD.gn @@ -0,0 +1,11 @@ +--- gpu/tools/compositor_model_bench/BUILD.gn.orig 2016-10-06 04:02:20.000000000 +0300 ++++ gpu/tools/compositor_model_bench/BUILD.gn 2016-10-13 07:33:53.916483000 +0300 +@@ -4,7 +4,7 @@ + + import("//build/config/ui.gni") + +-if (is_linux && !is_chromeos && current_cpu != "arm" && use_x11) { ++if ((is_linux || is_bsd) && !is_chromeos && current_cpu != "arm" && use_x11) { + # GYP version: //gpu/tools/tools.gyp:compositor_model_bench + executable("compositor_model_bench") { + sources = [ Index: head/www/chromium/files/patch-gpu_vulkan_BUILD.gn =================================================================== --- head/www/chromium/files/patch-gpu_vulkan_BUILD.gn +++ head/www/chromium/files/patch-gpu_vulkan_BUILD.gn @@ -0,0 +1,11 @@ +--- gpu/vulkan/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ gpu/vulkan/BUILD.gn 2016-09-02 23:57:07.910753000 +0300 +@@ -13,7 +13,7 @@ + component("vulkan") { + output_name = "vulkan_wrapper" + +- if (is_linux) { ++ if (is_linux || is_bsd) { + assert(use_x11, "Vulkan only support x11 at this point.") + sources = [ + "vulkan_command_buffer.cc", Index: head/www/chromium/files/patch-ipc_ipc__channel.h =================================================================== --- head/www/chromium/files/patch-ipc_ipc__channel.h +++ head/www/chromium/files/patch-ipc_ipc__channel.h @@ -0,0 +1,11 @@ +--- ipc/ipc_channel.h.orig 2016-08-13 00:25:04.291611000 +0300 ++++ ipc/ipc_channel.h 2016-08-13 00:09:06.758895000 +0300 +@@ -223,7 +223,7 @@ + static std::string GenerateVerifiedChannelID(const std::string& prefix); + #endif + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // Sandboxed processes live in a PID namespace, so when sending the IPC hello + // message from client to server we need to send the PID from the global + // PID namespace. Index: head/www/chromium/files/patch-ipc_ipc__channel__posix.h =================================================================== --- head/www/chromium/files/patch-ipc_ipc__channel__posix.h +++ head/www/chromium/files/patch-ipc_ipc__channel__posix.h @@ -0,0 +1,28 @@ +--- ipc/ipc_channel_posix.h.orig 2016-08-13 00:22:20.959322000 +0300 ++++ ipc/ipc_channel_posix.h 2016-08-13 00:07:29.393338000 +0300 +@@ -63,10 +63,10 @@ + void CloseClientFileDescriptor(); + + static bool IsNamedServerInitialized(const std::string& channel_id); +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + static void SetGlobalPid(int pid); + static int GetGlobalPid(); +-#endif // OS_LINUX ++#endif // OS_LINUX || defined(OS_BSD) + + private: + bool CreatePipe(const IPC::ChannelHandle& channel_handle); +@@ -209,10 +209,10 @@ + // True if we are responsible for unlinking the unix domain socket file. + bool must_unlink_; + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // If non-zero, overrides the process ID sent in the hello message. + static int global_pid_; +-#endif // OS_LINUX ++#endif // OS_LINUX || defined(OS_BSD) + + DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); + }; Index: head/www/chromium/files/patch-ipc_ipc__channel__posix.cc =================================================================== --- head/www/chromium/files/patch-ipc_ipc__channel__posix.cc +++ head/www/chromium/files/patch-ipc_ipc__channel__posix.cc @@ -0,0 +1,64 @@ +--- ipc/ipc_channel_posix.cc.orig 2016-07-20 22:03:25.000000000 +0300 ++++ ipc/ipc_channel_posix.cc 2016-08-13 00:06:40.205716000 +0300 +@@ -183,9 +183,9 @@ + + //------------------------------------------------------------------------------ + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + int ChannelPosix::global_pid_ = 0; +-#endif // OS_LINUX ++#endif // OS_LINUX || defined(OS_BSD) + + ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle, + Mode mode, +@@ -613,7 +613,7 @@ + return base::PathExists(base::FilePath(channel_id)); + } + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // static + void ChannelPosix::SetGlobalPid(int pid) { + global_pid_ = pid; +@@ -622,7 +622,7 @@ + int ChannelPosix::GetGlobalPid() { + return global_pid_; + } +-#endif // OS_LINUX ++#endif // OS_LINUX || defined(OS_BSD) + + // Called by libevent when we can read from the pipe without blocking. + void ChannelPosix::OnFileCanReadWithoutBlocking(int fd) { +@@ -813,12 +813,12 @@ + return -1; + #else + int pid = base::GetCurrentProcId(); +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // Our process may be in a sandbox with a separate PID namespace. + if (global_pid_) { + pid = global_pid_; + } +-#endif // defined(OS_LINUX) ++#endif // defined(OS_LINUX) || defined(OS_BSD) + return pid; + #endif // defined(OS_NACL_NONSFI) + } +@@ -1135,7 +1135,7 @@ + return ChannelPosix::IsNamedServerInitialized(channel_id); + } + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // static + void Channel::SetGlobalPid(int pid) { + ChannelPosix::SetGlobalPid(pid); +@@ -1143,6 +1143,6 @@ + int Channel::GetGlobalPid() { + return ChannelPosix::GetGlobalPid(); + } +-#endif // OS_LINUX ++#endif // OS_LINUX || defined(OS_BSD) + + } // namespace IPC Index: head/www/chromium/files/patch-media_audio_BUILD.gn =================================================================== --- head/www/chromium/files/patch-media_audio_BUILD.gn +++ head/www/chromium/files/patch-media_audio_BUILD.gn @@ -0,0 +1,25 @@ +--- media/audio/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ media/audio/BUILD.gn 2016-09-25 15:11:18.731892000 +0300 +@@ -202,7 +202,7 @@ + deps += [ "//media/base/android:media_jni_headers" ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ "linux/audio_manager_linux.cc" ] + } + +@@ -251,10 +251,12 @@ + configs += [ ":libpulse" ] + } else { + # TODO(ajwong): Technically, this dl should go in the action. +- libs += [ "dl" ] + deps += [ ":pulse_generate_stubs" ] + sources += get_target_outputs(":pulse_generate_stubs") + } ++ if (is_linux) { ++ libs += [ "dl" ] ++ } + } + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] Index: head/www/chromium/files/patch-media_audio_audio__manager.cc =================================================================== --- head/www/chromium/files/patch-media_audio_audio__manager.cc +++ head/www/chromium/files/patch-media_audio_audio__manager.cc @@ -1,5 +1,5 @@ ---- media/audio/audio_manager.cc.orig 2016-07-22 00:06:55.000000000 -0400 -+++ media/audio/audio_manager.cc 2016-08-03 15:25:47.683860000 -0400 +--- media/audio/audio_manager.cc.orig 2016-07-20 22:03:25.000000000 +0300 ++++ media/audio/audio_manager.cc 2016-08-01 04:22:25.372043000 +0300 @@ -92,7 +92,7 @@ } #endif Index: head/www/chromium/files/patch-media_base_BUILD.gn =================================================================== --- head/www/chromium/files/patch-media_base_BUILD.gn +++ head/www/chromium/files/patch-media_base_BUILD.gn @@ -0,0 +1,20 @@ +--- media/base/BUILD.gn.orig 2016-08-03 22:02:19.000000000 +0300 ++++ media/base/BUILD.gn 2016-09-03 01:53:50.754526000 +0300 +@@ -281,7 +281,7 @@ + allow_circular_includes_from += [ "//media/base/android" ] + } + +- if (is_linux && use_x11) { ++ if ((is_linux || is_bsd) && use_x11) { + configs += [ + "//build/config/linux:x11", + "//build/config/linux:xext", +@@ -317,7 +317,7 @@ + deps += [ ":media_yasm" ] + } + +- if (is_linux || is_win) { ++ if (is_linux || is_bsd || is_win) { + sources += [ + "keyboard_event_counter.cc", + "keyboard_event_counter.h", Index: head/www/chromium/files/patch-media_base_audio__splicer.cc =================================================================== --- head/www/chromium/files/patch-media_base_audio__splicer.cc +++ head/www/chromium/files/patch-media_base_audio__splicer.cc @@ -1,20 +0,0 @@ ---- media/base/audio_splicer.cc.orig 2016-05-11 19:02:23 UTC -+++ media/base/audio_splicer.cc -@@ -167,7 +167,7 @@ bool AudioStreamSanitizer::AddInput(cons - output_timestamp_helper_.GetTimestamp(); - const base::TimeDelta delta = timestamp - expected_timestamp; - -- if (std::abs(delta.InMilliseconds()) > -+ if (std::labs(delta.InMilliseconds()) > - AudioSplicer::kMaxTimeDeltaInMilliseconds) { - MEDIA_LOG(ERROR, media_log_) - << "Audio splicing failed: coded frame timestamp differs from " -@@ -183,7 +183,7 @@ bool AudioStreamSanitizer::AddInput(cons - if (delta != base::TimeDelta()) - frames_to_fill = output_timestamp_helper_.GetFramesToTarget(timestamp); - -- if (frames_to_fill == 0 || std::abs(frames_to_fill) < kMinGapSize) { -+ if (frames_to_fill == 0 || std::labs(frames_to_fill) < kMinGapSize) { - AddOutputBuffer(input); - return true; - } Index: head/www/chromium/files/patch-media_capture_BUILD.gn =================================================================== --- head/www/chromium/files/patch-media_capture_BUILD.gn +++ head/www/chromium/files/patch-media_capture_BUILD.gn @@ -0,0 +1,19 @@ +--- media/capture/BUILD.gn.orig 2016-08-03 22:02:20.000000000 +0300 ++++ media/capture/BUILD.gn 2016-10-10 16:10:21.736539000 +0300 +@@ -114,6 +114,16 @@ + ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "video/linux/video_capture_device_linux.cc", ++ "video/linux/video_capture_device_linux.h", ++ "video/linux/video_capture_device_factory_linux.cc", ++ "video/linux/video_capture_device_factory_linux.h", ++ "video/linux/v4l2_capture_delegate.cc", ++ ] ++ } ++ + if (is_win) { + public_deps += [ "//media/base/win" ] + libs = [ Index: head/www/chromium/files/patch-media_capture_video_fake__video__capture__device__factory.cc =================================================================== --- head/www/chromium/files/patch-media_capture_video_fake__video__capture__device__factory.cc +++ head/www/chromium/files/patch-media_capture_video_fake__video__capture__device__factory.cc @@ -1,11 +1,11 @@ ---- media/capture/video/fake_video_capture_device_factory.cc.orig 2016-05-11 19:02:23 UTC -+++ media/capture/video/fake_video_capture_device_factory.cc -@@ -49,7 +49,7 @@ void FakeVideoCaptureDeviceFactory::GetD +--- media/capture/video/fake_video_capture_device_factory.cc.orig 2016-10-06 04:02:21.000000000 +0300 ++++ media/capture/video/fake_video_capture_device_factory.cc 2016-10-13 07:39:17.908794000 +0300 +@@ -49,7 +49,7 @@ for (int n = 0; n < number_of_devices_; ++n) { - VideoCaptureDevice::Name name(base::StringPrintf("fake_device_%d", n), - base::StringPrintf("/dev/video%d", n) + device_descriptors->emplace_back(base::StringPrintf("fake_device_%d", n), + base::StringPrintf("/dev/video%d", n), -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_BSD) - , - VideoCaptureDevice::Name::V4L2_SINGLE_PLANE + VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE #elif defined(OS_MACOSX) + VideoCaptureApi::MACOSX_AVFOUNDATION Index: head/www/chromium/files/patch-media_capture_video_file__video__capture__device__factory.cc =================================================================== --- head/www/chromium/files/patch-media_capture_video_file__video__capture__device__factory.cc +++ head/www/chromium/files/patch-media_capture_video_file__video__capture__device__factory.cc @@ -1,11 +1,11 @@ ---- media/capture/video/file_video_capture_device_factory.cc.orig 2016-05-11 19:02:23 UTC -+++ media/capture/video/file_video_capture_device_factory.cc -@@ -50,7 +50,7 @@ void FileVideoCaptureDeviceFactory::GetD - device_names->push_back(VideoCaptureDevice::Name( +--- media/capture/video/file_video_capture_device_factory.cc.orig 2016-10-06 04:02:21.000000000 +0300 ++++ media/capture/video/file_video_capture_device_factory.cc 2016-10-13 07:41:41.678945000 +0300 +@@ -49,7 +49,7 @@ + #elif defined(OS_MACOSX) command_line_file_path.value(), kFileVideoCaptureDeviceName, - VideoCaptureDevice::Name::AVFOUNDATION)); + VideoCaptureApi::MACOSX_AVFOUNDATION -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_BSD) - device_names->push_back(VideoCaptureDevice::Name( command_line_file_path.value(), kFileVideoCaptureDeviceName, - VideoCaptureDevice::Name::V4L2_SINGLE_PLANE)); + VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE + #else Index: head/www/chromium/files/patch-media_capture_video_linux_video__capture__device__linux.cc =================================================================== --- head/www/chromium/files/patch-media_capture_video_linux_video__capture__device__linux.cc +++ head/www/chromium/files/patch-media_capture_video_linux_video__capture__device__linux.cc @@ -1,22 +1,22 @@ ---- media/capture/video/linux/video_capture_device_linux.cc.orig 2016-07-22 00:06:55.000000000 -0400 -+++ media/capture/video/linux/video_capture_device_linux.cc 2016-08-04 15:59:29.808311000 -0400 -@@ -44,6 +44,7 @@ - return true; - } +--- media/capture/video/linux/video_capture_device_linux.cc.orig 2016-10-06 04:02:21.000000000 +0300 ++++ media/capture/video/linux/video_capture_device_linux.cc 2016-10-13 09:50:59.750346000 +0300 +@@ -21,6 +21,7 @@ + + namespace media { +#if !defined(OS_FREEBSD) // Translates Video4Linux pixel formats to Chromium pixel formats. // static VideoPixelFormat VideoCaptureDeviceLinux::V4l2FourCcToChromiumPixelFormat( -@@ -57,6 +58,7 @@ +@@ -34,6 +35,7 @@ bool favour_mjpeg) { return V4L2CaptureDelegate::GetListOfUsableFourCcs(favour_mjpeg); } +#endif // !defined(OS_FREEBSD) - const std::string VideoCaptureDevice::Name::GetModel() const { - // |unique_id| is of the form "/dev/video2". |file_name| is "video2". -@@ -90,6 +92,7 @@ + VideoCaptureDeviceLinux::VideoCaptureDeviceLinux( + const VideoCaptureDeviceDescriptor& device_descriptor) +@@ -47,6 +49,7 @@ v4l2_thread_.Stop(); } @@ -24,7 +24,7 @@ void VideoCaptureDeviceLinux::AllocateAndStart( const VideoCaptureParams& params, std::unique_ptr client) { -@@ -113,7 +116,13 @@ +@@ -70,7 +73,13 @@ params.requested_format.frame_size.height(), params.requested_format.frame_rate, base::Passed(&client))); } @@ -38,7 +38,7 @@ void VideoCaptureDeviceLinux::StopAndDeAllocate() { if (!v4l2_thread_.IsRunning()) return; // Wrong state. -@@ -124,7 +133,11 @@ +@@ -81,7 +90,11 @@ capture_impl_ = NULL; } @@ -49,8 +49,8 @@ +#if !defined(OS_FREEBSD) void VideoCaptureDeviceLinux::SetRotation(int rotation) { if (v4l2_thread_.IsRunning()) { - v4l2_thread_.message_loop()->PostTask( -@@ -132,6 +145,9 @@ + v4l2_thread_.task_runner()->PostTask( +@@ -89,6 +102,9 @@ base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation)); } } Index: head/www/chromium/files/patch-media_capture_video_video__capture__device.h =================================================================== --- head/www/chromium/files/patch-media_capture_video_video__capture__device.h +++ head/www/chromium/files/patch-media_capture_video_video__capture__device.h @@ -1,38 +0,0 @@ ---- media/capture/video/video_capture_device.h.orig 2016-05-11 19:02:23 UTC -+++ media/capture/video/video_capture_device.h -@@ -51,7 +51,7 @@ class MEDIA_EXPORT VideoCaptureDevice { - Name(); - Name(const std::string& name, const std::string& id); - --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) - // Linux/CrOS targets Capture Api type: it can only be set on construction. - enum CaptureApiType { - V4L2_SINGLE_PLANE, -@@ -82,7 +82,7 @@ class MEDIA_EXPORT VideoCaptureDevice { - #endif - - #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ -- defined(OS_ANDROID) -+ defined(OS_ANDROID) || defined(OS_BSD) - Name(const std::string& name, - const std::string& id, - const CaptureApiType api_type); -@@ -119,7 +119,7 @@ class MEDIA_EXPORT VideoCaptureDevice { - bool operator<(const Name& other) const { return unique_id_ < other.id(); } - - #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ -- defined(OS_ANDROID) -+ defined(OS_ANDROID) || defined(OS_BSD) - CaptureApiType capture_api_type() const { - return capture_api_class_.capture_api_type(); - } -@@ -143,7 +143,7 @@ class MEDIA_EXPORT VideoCaptureDevice { - std::string device_name_; - std::string unique_id_; - #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ -- defined(OS_ANDROID) -+ defined(OS_ANDROID) || defined(OS_BSD) - // This class wraps the CaptureApiType to give it a by default value if not - // initialized. - class CaptureApiClass { Index: head/www/chromium/files/patch-media_capture_video_video__capture__device.cc =================================================================== --- head/www/chromium/files/patch-media_capture_video_video__capture__device.cc +++ head/www/chromium/files/patch-media_capture_video_video__capture__device.cc @@ -1,31 +0,0 @@ ---- media/capture/video/video_capture_device.cc.orig 2016-05-11 19:02:23 UTC -+++ media/capture/video/video_capture_device.cc -@@ -13,6 +13,10 @@ - - namespace media { - -+const std::string VideoCaptureDevice::Name::GetModel() const { -+ return ""; -+} -+ - // TODO(msu.koo): http://crbug.com/532272, remove checking the switch in favour - // of deferring GetModel() call to the actual VideoCaptureDevice object. - const std::string VideoCaptureDevice::Name::GetNameAndModel() const { -@@ -35,7 +39,7 @@ VideoCaptureDevice::Name::Name(const std - : device_name_(name), unique_id_(id) { - } - --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) - VideoCaptureDevice::Name::Name(const std::string& name, - const std::string& id, - const CaptureApiType api_type) -@@ -82,7 +86,7 @@ VideoCaptureDevice::Name::Name(const std - VideoCaptureDevice::Name::~Name() { - } - --#if defined(OS_LINUX) -+#if defined(OS_LINUX) || defined(OS_BSD) - const char* VideoCaptureDevice::Name::GetCaptureApiTypeString() const { - switch (capture_api_type()) { - case V4L2_SINGLE_PLANE: Index: head/www/chromium/files/patch-media_capture_video_video__capture__device__factory.cc =================================================================== --- head/www/chromium/files/patch-media_capture_video_video__capture__device__factory.cc +++ head/www/chromium/files/patch-media_capture_video_video__capture__device__factory.cc @@ -1,12 +1,12 @@ ---- media/capture/video/video_capture_device_factory.cc.orig 2016-07-22 00:06:55.000000000 -0400 -+++ media/capture/video/video_capture_device_factory.cc 2016-08-04 16:01:12.907434000 -0400 +--- media/capture/video/video_capture_device_factory.cc.orig 2016-08-13 01:27:17.328942000 +0300 ++++ media/capture/video/video_capture_device_factory.cc 2016-08-13 01:16:43.725148000 +0300 @@ -18,6 +18,10 @@ std::unique_ptr VideoCaptureDeviceFactory::CreateFactory( scoped_refptr ui_task_runner) { +#if defined(OS_BSD) -+ return std::unique_ptr(new -+ media::FakeVideoCaptureDeviceFactory()); ++ return std::unique_ptr( ++ new media::FakeVideoCaptureDeviceFactory()); +#else const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -17,5 +17,14 @@ } +#endif } - + VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() { +@@ -56,7 +61,7 @@ + callback.Run(std::move(device_names)); + } + +-#if !defined(OS_MACOSX) && !defined(OS_LINUX) && !defined(OS_ANDROID) && \ ++#if !defined(OS_MACOSX) && !defined(OS_LINUX) && !defined(OS_BSD) && !defined(OS_ANDROID) && \ + !defined(OS_WIN) + // static + VideoCaptureDeviceFactory* Index: head/www/chromium/files/patch-media_cast_BUILD.gn =================================================================== --- head/www/chromium/files/patch-media_cast_BUILD.gn +++ head/www/chromium/files/patch-media_cast_BUILD.gn @@ -0,0 +1,29 @@ +--- media/cast/BUILD.gn.orig 2016-08-03 22:02:20.000000000 +0300 ++++ media/cast/BUILD.gn 2016-09-03 01:55:19.016112000 +0300 +@@ -385,7 +385,7 @@ + } + } + +-if (is_win || is_mac || (is_linux && !is_chromeos)) { ++if (is_win || is_mac || (is_linux && !is_chromeos) || is_bsd) { + # This is a target for the collection of cast development tools. They are + # not built/linked into the Chromium browser. + group("testing_tools") { +@@ -430,7 +430,7 @@ + "//build/win:default_exe_manifest", + ] + +- if (is_linux && !is_chromeos && use_x11) { ++ if ((is_linux || is_bsd) && !is_chromeos && use_x11) { + sources += [ + "test/linux_output_window.cc", + "test/linux_output_window.h", +@@ -525,7 +525,7 @@ + } + } + +-if (is_linux && !is_chromeos) { ++if ((is_linux || is_bsd) && !is_chromeos) { + test("tap_proxy") { + sources = [ + "test/utility/tap_proxy.cc", Index: head/www/chromium/files/patch-media_cdm_ppapi_ppapi__cdm__adapter.gni =================================================================== --- head/www/chromium/files/patch-media_cdm_ppapi_ppapi__cdm__adapter.gni +++ head/www/chromium/files/patch-media_cdm_ppapi_ppapi__cdm__adapter.gni @@ -0,0 +1,20 @@ +--- media/cdm/ppapi/ppapi_cdm_adapter.gni.orig 2016-08-03 22:02:20.000000000 +0300 ++++ media/cdm/ppapi/ppapi_cdm_adapter.gni 2016-09-03 01:55:54.607135000 +0300 +@@ -7,7 +7,7 @@ + # depend on media/media_cdm_adapter.gyp:cdmadapter which would in turn modify + # your target with direct_dependent_settings. + template("ppapi_cdm_adapter") { +- if (is_mac || is_linux) { ++ if (is_mac || is_linux || is_bsd) { + _target_type = "loadable_module" + } else { + _target_type = "shared_library" +@@ -59,7 +59,7 @@ + libs += [ "rt" ] + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + # CDM adapter depends on a CDM in component and non-component builds. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } Index: head/www/chromium/files/patch-media_filters_decrypting__audio__decoder.cc =================================================================== --- head/www/chromium/files/patch-media_filters_decrypting__audio__decoder.cc +++ head/www/chromium/files/patch-media_filters_decrypting__audio__decoder.cc @@ -1,11 +0,0 @@ ---- media/filters/decrypting_audio_decoder.cc.orig 2016-05-11 19:02:24 UTC -+++ media/filters/decrypting_audio_decoder.cc -@@ -29,7 +29,7 @@ static inline bool IsOutOfSync(const bas - // Out of sync of 100ms would be pretty noticeable and we should keep any - // drift below that. - const int64_t kOutOfSyncThresholdInMilliseconds = 100; -- return std::abs(timestamp_1.InMilliseconds() - timestamp_2.InMilliseconds()) > -+ return std::labs(timestamp_1.InMilliseconds() - timestamp_2.InMilliseconds()) > - kOutOfSyncThresholdInMilliseconds; - } - Index: head/www/chromium/files/patch-media_media.gyp =================================================================== --- head/www/chromium/files/patch-media_media.gyp +++ head/www/chromium/files/patch-media_media.gyp @@ -1,26 +0,0 @@ ---- media/media.gyp.orig 2016-05-11 19:02:24 UTC -+++ media/media.gyp -@@ -745,7 +745,13 @@ - ['exclude', '_alsa\\.(h|cc)$'], - ], - }], -- ['OS=="linux"', { -+ ['OS=="freebsd"', { -+ 'sources!': [ -+ 'capture/video/linux/v4l2_capture_delegate.cc', -+ 'capture/video/linux/video_capture_device_factory_linux.cc', -+ ], -+ }], -+ ['OS=="linux" or os_bsd==1', { - 'conditions': [ - ['use_x11==1', { - 'dependencies': [ -@@ -1095,7 +1101,7 @@ - 'base/simd/filter_yuv_sse2.cc', - ], - }], -- ['OS!="linux" and OS!="win"', { -+ ['OS!="linux" and OS!="win" and os_bsd!=1', { - 'sources!': [ - 'base/keyboard_event_counter.cc', - 'base/keyboard_event_counter.h', Index: head/www/chromium/files/patch-mojo_BUILD.gn =================================================================== --- head/www/chromium/files/patch-mojo_BUILD.gn +++ head/www/chromium/files/patch-mojo_BUILD.gn @@ -0,0 +1,11 @@ +--- mojo/BUILD.gn.orig 2016-10-06 04:02:21.000000000 +0300 ++++ mojo/BUILD.gn 2016-10-13 07:50:28.562419000 +0300 +@@ -12,7 +12,7 @@ + "//mojo/common", + ] + +- if (!(is_linux && current_cpu == "x86")) { ++ if (!((is_linux || is_bsd) && current_cpu == "x86")) { + # TODO(GYP): Figure out if this needs to be supported. Right now + # it won't work on x86 official builds because it needs stuff in the + # sysroot that doesn't exist. Index: head/www/chromium/files/patch-mojo_edk_test_BUILD.gn =================================================================== --- head/www/chromium/files/patch-mojo_edk_test_BUILD.gn +++ head/www/chromium/files/patch-mojo_edk_test_BUILD.gn @@ -0,0 +1,20 @@ +--- mojo/edk/test/BUILD.gn.orig 2016-08-03 22:02:20.000000000 +0300 ++++ mojo/edk/test/BUILD.gn 2016-09-02 23:44:49.826221000 +0300 +@@ -43,7 +43,7 @@ + "//testing/gtest", + ] + +- if (is_linux && !is_component_build) { ++ if ((is_linux || is_bsd) && !is_component_build) { + public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + } +@@ -63,7 +63,7 @@ + "run_all_perftests.cc", + ] + +- if (is_linux && !is_component_build) { ++ if ((is_linux || is_bsd) && !is_component_build) { + public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + } Index: head/www/chromium/files/patch-native__client__sdk_src_BUILD.gn =================================================================== --- head/www/chromium/files/patch-native__client__sdk_src_BUILD.gn +++ head/www/chromium/files/patch-native__client__sdk_src_BUILD.gn @@ -0,0 +1,20 @@ +--- native_client_sdk/src/BUILD.gn.orig 2016-08-03 22:02:20.000000000 +0300 ++++ native_client_sdk/src/BUILD.gn 2016-09-02 23:46:03.429042000 +0300 +@@ -7,7 +7,7 @@ + declare_args() { + # Set to true if cross compiling trusted (e.g. building sel_ldr_arm on x86) + # binaries is supported. +- enable_cross_trusted = is_linux ++ enable_cross_trusted = is_linux || is_bsd + + # Build the nacl SDK untrusted components. This is disabled by default since + # not all NaCl untrusted compilers are in goma (e.g arm-nacl-glibc) +@@ -28,7 +28,7 @@ + "//native_client/src/trusted/service_runtime:sel_ldr", + "//native_client/src/trusted/validator/driver:ncval_new", + ] +- if (is_linux) { ++ if (is_linux || is_bsd) { + deps += [ "//native_client/src/nonsfi/loader:nonsfi_loader" ] + } + } Index: head/www/chromium/files/patch-native__client_build_common.gypi =================================================================== --- head/www/chromium/files/patch-native__client_build_common.gypi +++ head/www/chromium/files/patch-native__client_build_common.gypi @@ -1,11 +0,0 @@ ---- native_client/build/common.gypi.orig 2016-05-11 19:03:08 UTC -+++ native_client/build/common.gypi -@@ -58,7 +58,7 @@ - ], - }, - 'conditions': [ -- ['OS=="linux" or OS=="android"', { -+ ['OS=="linux" or OS=="android" or OS=="freebsd"', { - 'target_defaults': { - 'defines': [ - '_POSIX_C_SOURCE=199506', Index: head/www/chromium/files/patch-native__client_src_shared_platform_platform.gyp =================================================================== --- head/www/chromium/files/patch-native__client_src_shared_platform_platform.gyp +++ head/www/chromium/files/patch-native__client_src_shared_platform_platform.gyp @@ -1,11 +0,0 @@ ---- native_client/src/shared/platform/platform.gyp.orig 2016-05-11 19:03:08 UTC -+++ native_client/src/shared/platform/platform.gyp -@@ -36,7 +36,7 @@ - 'refcount_base.cc', - ], - 'conditions': [ -- ['OS=="linux" or OS=="android"', { -+ ['OS=="linux" or OS=="android" or OS=="freebsd"', { - 'platform_sources': [ - 'linux/nacl_clock.c', - 'linux/nacl_host_dir.c', Index: head/www/chromium/files/patch-net_BUILD.gn =================================================================== --- head/www/chromium/files/patch-net_BUILD.gn +++ head/www/chromium/files/patch-net_BUILD.gn @@ -0,0 +1,86 @@ +--- net/BUILD.gn.orig 2016-10-06 04:02:22.000000000 +0300 ++++ net/BUILD.gn 2016-10-18 00:25:21.260605000 +0300 +@@ -175,6 +175,11 @@ + ] + if (is_android) { + sources -= [ "base/openssl_private_key_store_android.cc" ] ++ } else if (is_bsd) { ++ sources -= [ ++ "base/address_tracker_linux.cc", ++ "base/address_tracker_linux.h", ++ ] + } + } else { + if (is_android) { +@@ -298,6 +303,13 @@ + sources -= [ "disk_cache/blockfile/file_posix.cc" ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "base/network_change_notifier_linux.cc", ++ "base/network_change_notifier_linux.h", ++ ] ++ } ++ + if (is_ios || is_mac) { + sources += gypi_values.net_base_mac_ios_sources + } +@@ -1025,7 +1037,7 @@ + } + } + +-if (is_linux || is_mac) { ++if (is_linux || is_bsd || is_mac) { + executable("cachetool") { + testonly = true + sources = [ +@@ -1054,7 +1066,7 @@ + } + } + +-if (is_linux) { ++if (is_linux || is_bsd) { + static_library("epoll_server") { + sources = [ + "tools/epoll_server/epoll_server.cc", +@@ -1160,7 +1172,7 @@ + } + } + +-if (is_android || is_linux) { ++if (is_android || is_linux || is_bsd) { + executable("disk_cache_memory_test") { + testonly = true + sources = [ +@@ -1353,7 +1365,7 @@ + "third_party/nist-pkits/", + ] + +- if (is_linux || is_mac || is_win) { ++ if (is_linux || is_bsd || is_mac || is_win) { + deps += [ + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", +@@ -1376,7 +1388,7 @@ + if (is_desktop_linux) { + deps += [ ":epoll_quic_tools" ] + } +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += gypi_values.net_linux_test_sources + deps += [ + ":epoll_quic_tools", +@@ -1392,6 +1404,12 @@ + sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ] + } + ++ if (is_bsd) { ++ sources -= [ ++ "base/address_tracker_linux_unittest.cc", ++ ] ++ } ++ + if (v8_use_external_startup_data) { + deps += [ "//gin" ] + } Index: head/www/chromium/files/patch-net_base_address__tracker__linux.h =================================================================== --- head/www/chromium/files/patch-net_base_address__tracker__linux.h +++ head/www/chromium/files/patch-net_base_address__tracker__linux.h @@ -1,5 +1,5 @@ ---- net/base/address_tracker_linux.h.orig 2016-07-22 00:06:56.000000000 -0400 -+++ net/base/address_tracker_linux.h 2016-08-04 16:22:00.122898000 -0400 +--- net/base/address_tracker_linux.h.orig 2016-05-25 15:01:03.000000000 -0400 ++++ net/base/address_tracker_linux.h 2016-05-27 11:17:51.228810000 -0400 @@ -6,10 +6,12 @@ #define NET_BASE_ADDRESS_TRACKER_LINUX_H_ Index: head/www/chromium/files/patch-net_base_address__tracker__linux.cc =================================================================== --- head/www/chromium/files/patch-net_base_address__tracker__linux.cc +++ head/www/chromium/files/patch-net_base_address__tracker__linux.cc @@ -1,94 +0,0 @@ ---- net/base/address_tracker_linux.cc.orig 2016-05-25 15:01:03.000000000 -0400 -+++ net/base/address_tracker_linux.cc 2016-05-27 11:16:09.919235000 -0400 -@@ -5,7 +5,9 @@ - #include "net/base/address_tracker_linux.h" - - #include -+#if !defined(OS_FREEBSD) - #include -+#endif - #include - #include - -@@ -39,6 +41,7 @@ - bool GetAddress(const struct nlmsghdr* header, - IPAddress* out, - bool* really_deprecated) { -+#if !defined(OS_FREEBSD) - if (really_deprecated) - *really_deprecated = false; - const struct ifaddrmsg* msg = -@@ -91,6 +94,9 @@ - return false; - *out = IPAddress(address, address_length); - return true; -+#else -+ return false; -+#endif - } - - } // namespace -@@ -148,6 +154,7 @@ - } - - void AddressTrackerLinux::Init() { -+#if !defined(OS_FREEBSD) - netlink_fd_ = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); - if (netlink_fd_ < 0) { - PLOG(ERROR) << "Could not create NETLINK socket"; -@@ -235,6 +242,10 @@ - return; - } - } -+#else -+ AbortAndForceOnline(); -+ return; -+#endif - } - - void AddressTrackerLinux::AbortAndForceOnline() { -@@ -281,6 +292,7 @@ - void AddressTrackerLinux::ReadMessages(bool* address_changed, - bool* link_changed, - bool* tunnel_changed) { -+#if !defined(OS_FREEBSD) - *address_changed = false; - *link_changed = false; - *tunnel_changed = false; -@@ -307,6 +319,7 @@ - } - if (*link_changed || *address_changed) - UpdateCurrentConnectionType(); -+#endif - } - - void AddressTrackerLinux::HandleMessage(char* buffer, -@@ -314,6 +327,7 @@ - bool* address_changed, - bool* link_changed, - bool* tunnel_changed) { -+#if !defined(OS_FREEBSD) - DCHECK(buffer); - for (struct nlmsghdr* header = reinterpret_cast(buffer); - NLMSG_OK(header, length); -@@ -410,6 +424,7 @@ - break; - } - } -+#endif - } - - void AddressTrackerLinux::OnFileCanReadWithoutBlocking(int fd) { -@@ -436,8 +451,12 @@ - - bool AddressTrackerLinux::IsTunnelInterface(int interface_index) const { - // Linux kernel drivers/net/tun.c uses "tun" name prefix. -+#if !defined(OS_FREEBSD) - char buf[IFNAMSIZ] = {0}; - return strncmp(get_interface_name_(interface_index, buf), "tun", 3) == 0; -+#else -+ return false; -+#endif - } - - void AddressTrackerLinux::UpdateCurrentConnectionType() { Index: head/www/chromium/files/patch-net_base_network__change__notifier.h =================================================================== --- head/www/chromium/files/patch-net_base_network__change__notifier.h +++ head/www/chromium/files/patch-net_base_network__change__notifier.h @@ -0,0 +1,29 @@ +--- net/base/network_change_notifier.h.orig 2016-08-03 22:02:21.000000000 +0300 ++++ net/base/network_change_notifier.h 2016-09-26 03:54:03.417293000 +0300 +@@ -26,7 +26,7 @@ + typedef std::vector NetworkInterfaceList; + class URLRequest; + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + namespace internal { + class AddressTrackerLinux; + } +@@ -329,7 +329,7 @@ + // a large HOSTS file. + static void GetDnsConfig(DnsConfig* config); + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // Returns the AddressTrackerLinux if present. + static const internal::AddressTrackerLinux* GetAddressTracker(); + #endif +@@ -485,7 +485,7 @@ + const NetworkChangeCalculatorParams& params = + NetworkChangeCalculatorParams()); + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // Returns the AddressTrackerLinux if present. + // TODO(szym): Retrieve AddressMap from NetworkState. http://crbug.com/144212 + virtual const internal::AddressTrackerLinux* Index: head/www/chromium/files/patch-net_base_network__change__notifier.cc =================================================================== --- head/www/chromium/files/patch-net_base_network__change__notifier.cc +++ head/www/chromium/files/patch-net_base_network__change__notifier.cc @@ -1,6 +1,6 @@ ---- net/base/network_change_notifier.cc.orig 2016-05-11 19:02:24 UTC -+++ net/base/network_change_notifier.cc -@@ -532,7 +532,6 @@ NetworkChangeNotifier* NetworkChangeNoti +--- net/base/network_change_notifier.cc.orig 2016-10-06 04:02:22.000000000 +0300 ++++ net/base/network_change_notifier.cc 2016-10-14 20:28:12.376281000 +0300 +@@ -533,7 +533,6 @@ #elif defined(OS_MACOSX) return new NetworkChangeNotifierMac(); #else @@ -8,3 +8,21 @@ return NULL; #endif } +@@ -753,7 +752,7 @@ + #endif + } + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + // static + const internal::AddressTrackerLinux* + NetworkChangeNotifier::GetAddressTracker() { +@@ -978,7 +977,7 @@ + network_change_calculator_->Init(); + } + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) || defined(OS_BSD) + const internal::AddressTrackerLinux* + NetworkChangeNotifier::GetAddressTrackerInternal() const { + return NULL; Index: head/www/chromium/files/patch-net_dns_dns__session.cc =================================================================== --- head/www/chromium/files/patch-net_dns_dns__session.cc +++ head/www/chromium/files/patch-net_dns_dns__session.cc @@ -1,11 +0,0 @@ ---- net/dns/dns_session.cc.orig 2016-05-11 19:02:24 UTC -+++ net/dns/dns_session.cc -@@ -190,7 +190,7 @@ void DnsSession::RecordRTT(unsigned serv - base::TimeDelta current_error = rtt - estimate; - estimate += current_error / 8; // * alpha - base::TimeDelta abs_error = base::TimeDelta::FromInternalValue( -- std::abs(current_error.ToInternalValue())); -+ std::labs(current_error.ToInternalValue())); - deviation += (abs_error - deviation) / 4; // * delta - - // Histogram-based method. Index: head/www/chromium/files/patch-net_net.gyp =================================================================== --- head/www/chromium/files/patch-net_net.gyp +++ head/www/chromium/files/patch-net_net.gyp @@ -1,23 +0,0 @@ ---- net/net.gyp.orig 2016-05-11 19:02:24 UTC -+++ net/net.gyp -@@ -163,7 +163,7 @@ - '<@(net_test_sources)', - ], - 'conditions': [ -- ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { -+ ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and os_bsd != 1', { - 'dependencies': [ - 'epoll_quic_tools', - 'epoll_server', -@@ -678,6 +678,11 @@ - 'url_request/test_url_request_interceptor.h', - ], - }], -+ [ 'os_bsd == 1', { -+ 'sources!': [ -+ 'base/address_tracker_linux_unittest.cc', -+ ], -+ }], - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [4267, ], Index: head/www/chromium/files/patch-net_net.gypi =================================================================== --- head/www/chromium/files/patch-net_net.gypi +++ head/www/chromium/files/patch-net_net.gypi @@ -1,22 +0,0 @@ ---- net/net.gypi.orig 2016-05-11 19:02:24 UTC -+++ net/net.gypi -@@ -439,8 +439,8 @@ - 'android/network_library.h', - 'android/traffic_stats.cc', - 'android/traffic_stats.h', -- 'base/address_tracker_linux.cc', -- 'base/address_tracker_linux.h', -+# 'base/address_tracker_linux.cc', -+# 'base/address_tracker_linux.h', - 'base/backoff_entry.cc', - 'base/backoff_entry.h', - 'base/backoff_entry_serializer.cc', -@@ -1310,7 +1310,7 @@ - 'android/traffic_stats_unittest.cc', - 'base/address_family_unittest.cc', - 'base/address_list_unittest.cc', -- 'base/address_tracker_linux_unittest.cc', -+# 'base/address_tracker_linux_unittest.cc', - 'base/backoff_entry_serializer_unittest.cc', - 'base/backoff_entry_unittest.cc', - 'base/chunked_upload_data_stream_unittest.cc', Index: head/www/chromium/files/patch-net_net__common.gypi =================================================================== --- head/www/chromium/files/patch-net_net__common.gypi +++ head/www/chromium/files/patch-net_net__common.gypi @@ -1,14 +0,0 @@ ---- net/net_common.gypi.orig 2016-05-11 19:02:24 UTC -+++ net/net_common.gypi -@@ -242,9 +242,10 @@ - 'conditions': [ - ['os_bsd==1', { - 'sources!': [ -+ 'base/address_tracker_linux.cc', - 'base/network_change_notifier_linux.cc', - 'base/network_change_notifier_netlink_linux.cc', -- 'proxy/proxy_config_service_linux.cc', -+# 'proxy/proxy_config_service_linux.cc', - ], - },{ - 'dependencies': [ Index: head/www/chromium/files/patch-net_proxy_proxy__config__service__linux.cc =================================================================== --- head/www/chromium/files/patch-net_proxy_proxy__config__service__linux.cc +++ head/www/chromium/files/patch-net_proxy_proxy__config__service__linux.cc @@ -1,5 +1,5 @@ ---- net/proxy/proxy_config_service_linux.cc.orig 2016-05-11 19:02:24 UTC -+++ net/proxy/proxy_config_service_linux.cc +--- net/proxy/proxy_config_service_linux.cc.orig 2016-10-06 04:02:23.000000000 +0300 ++++ net/proxy/proxy_config_service_linux.cc 2016-10-13 08:05:04.653281000 +0300 @@ -11,7 +11,14 @@ #include #include @@ -15,37 +15,37 @@ #include #include -@@ -859,6 +866,7 @@ class SettingGetterImplKDE : public Prox +@@ -863,6 +870,7 @@ public: explicit SettingGetterImplKDE(base::Environment* env_var_getter) : inotify_fd_(-1), + config_fd_(-1), - notify_delegate_(NULL), + notify_delegate_(nullptr), debounce_timer_(new base::OneShotTimer()), indirect_manual_(false), -@@ -933,9 +941,10 @@ class SettingGetterImplKDE : public Prox +@@ -937,9 +945,10 @@ // and pending tasks may then be deleted without being run. // Here in the KDE version, we can safely close the file descriptor // anyway. (Not that it really matters; the process is exiting.) - if (inotify_fd_ >= 0) + if (inotify_fd_ >= 0 || config_fd_ >= 0) ShutDown(); - DCHECK(inotify_fd_ < 0); -+ DCHECK(config_fd_ < 0); + DCHECK_LT(inotify_fd_, 0); ++ DCHECK_LT(config_fd_, 0); } bool Init(const scoped_refptr& glib_task_runner, -@@ -944,9 +953,17 @@ class SettingGetterImplKDE : public Prox +@@ -948,9 +957,17 @@ // This has to be called on the UI thread (http://crbug.com/69057). base::ThreadRestrictions::ScopedAllowIO allow_io; - DCHECK(inotify_fd_ < 0); -+#if defined(OS_FREEBSD) + DCHECK_LT(inotify_fd_, 0); ++#if defined(OS_BSD) + inotify_fd_ = kqueue(); +#else inotify_fd_ = inotify_init(); +#endif if (inotify_fd_ < 0) { -+#if defined(OS_FREEBSD) ++#if defined(OS_BSD) + PLOG(ERROR) << "kqueue failed"; +#else PLOG(ERROR) << "inotify_init failed"; @@ -53,7 +53,7 @@ return false; } if (!base::SetNonBlocking(inotify_fd_)) { -@@ -970,22 +987,40 @@ class SettingGetterImplKDE : public Prox +@@ -974,22 +991,40 @@ close(inotify_fd_); inotify_fd_ = -1; } @@ -66,15 +66,15 @@ bool SetUpNotifications( ProxyConfigServiceLinux::Delegate* delegate) override { - DCHECK(inotify_fd_ >= 0); -+ DCHECK(config_fd_ >= 0); + DCHECK_GE(inotify_fd_, 0); ++ DCHECK_GE(config_fd_, 0); DCHECK(file_task_runner_->BelongsToCurrentThread()); // We can't just watch the kioslaverc file directly, since KDE will write // a new copy of it and then rename it whenever settings are changed and // inotify watches inodes (so we'll be watching the old deleted file after // the first change, and it will never change again). So, we watch the // directory instead. We then act only on changes to the kioslaverc entry. -+#if defined(OS_FREEBSD) ++#if defined(OS_BSD) + config_fd_ = HANDLE_EINTR(open(kde_config_dir_.value().c_str(), O_RDONLY)); + + if (config_fd_ == -1) @@ -94,11 +94,11 @@ notify_delegate_ = delegate; if (!base::MessageLoopForIO::current()->WatchFileDescriptor( inotify_fd_, true, base::MessageLoopForIO::WATCH_READ, -@@ -1006,7 +1041,19 @@ class SettingGetterImplKDE : public Prox +@@ -1010,7 +1045,19 @@ void OnFileCanReadWithoutBlocking(int fd) override { DCHECK_EQ(fd, inotify_fd_); DCHECK(file_task_runner_->BelongsToCurrentThread()); -+#if defined(OS_FREEBSD) ++#if defined(OS_BSD) + struct kevent ev; + int rv = kevent(inotify_fd_, NULL, 0, &ev, 1, NULL); + @@ -114,20 +114,20 @@ } void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); } -@@ -1279,8 +1326,11 @@ class SettingGetterImplKDE : public Prox +@@ -1283,8 +1330,11 @@ void OnChangeNotification() { DCHECK_GE(inotify_fd_, 0); DCHECK(file_task_runner_->BelongsToCurrentThread()); - char event_buf[(sizeof(inotify_event) + NAME_MAX + 1) * 4]; bool kioslaverc_touched = false; -+#if defined(OS_FREEBSD) ++#if defined(OS_BSD) + kioslaverc_touched = true; +#else + char event_buf[(sizeof(inotify_event) + NAME_MAX + 1) * 4]; ssize_t r; while ((r = read(inotify_fd_, event_buf, sizeof(event_buf))) > 0) { // inotify returns variable-length structures, which is why we have -@@ -1317,6 +1367,7 @@ class SettingGetterImplKDE : public Prox +@@ -1321,6 +1371,7 @@ inotify_fd_ = -1; } } @@ -135,11 +135,11 @@ if (kioslaverc_touched) { // We don't use Reset() because the timer may not yet be running. // (In that case Stop() is a no-op.) -@@ -1332,6 +1383,7 @@ class SettingGetterImplKDE : public Prox +@@ -1336,6 +1387,7 @@ std::vector > strings_map_type; int inotify_fd_; + int config_fd_; base::MessagePumpLibevent::FileDescriptorWatcher inotify_watcher_; ProxyConfigServiceLinux::Delegate* notify_delegate_; - scoped_ptr debounce_timer_; + std::unique_ptr debounce_timer_; Index: head/www/chromium/files/patch-net_proxy_proxy__service.cc =================================================================== --- head/www/chromium/files/patch-net_proxy_proxy__service.cc +++ head/www/chromium/files/patch-net_proxy_proxy__service.cc @@ -1,5 +1,5 @@ ---- net/proxy/proxy_service.cc.orig 2016-07-22 00:06:56.000000000 -0400 -+++ net/proxy/proxy_service.cc 2016-08-03 15:29:21.017256000 -0400 +--- net/proxy/proxy_service.cc.orig 2016-07-20 22:03:27.000000000 +0300 ++++ net/proxy/proxy_service.cc 2016-08-01 04:25:47.866569000 +0300 @@ -48,7 +48,7 @@ #elif defined(OS_MACOSX) #include "net/proxy/proxy_config_service_mac.h" @@ -14,7 +14,7 @@ << "be used only for examples."; return base::WrapUnique(new UnsetProxyConfigService); -#elif defined(OS_LINUX) -+#elif defined(OS_LINUX) || defined(OS_FREEBSD) ++#elif defined(OS_LINUX) || defined(OS_BSD) std::unique_ptr linux_config_service( new ProxyConfigServiceLinux()); - + Index: head/www/chromium/files/patch-net_quic_congestion__control_rtt__stats.cc =================================================================== --- head/www/chromium/files/patch-net_quic_congestion__control_rtt__stats.cc +++ head/www/chromium/files/patch-net_quic_congestion__control_rtt__stats.cc @@ -1,29 +0,0 @@ ---- net/quic/congestion_control/rtt_stats.cc.orig 2016-05-11 19:02:24 UTC -+++ net/quic/congestion_control/rtt_stats.cc -@@ -4,7 +4,7 @@ - - #include "net/quic/congestion_control/rtt_stats.h" - --#include // std::abs -+#include // std::labs - - using std::max; - -@@ -41,7 +41,7 @@ void RttStats::ExpireSmoothedMetrics() { - mean_deviation_ = - max(mean_deviation_, - QuicTime::Delta::FromMicroseconds( -- std::abs(smoothed_rtt_.Subtract(latest_rtt_).ToMicroseconds()))); -+ std::labs(smoothed_rtt_.Subtract(latest_rtt_).ToMicroseconds()))); - smoothed_rtt_ = max(smoothed_rtt_, latest_rtt_); - } - -@@ -81,7 +81,7 @@ void RttStats::UpdateRtt(QuicTime::Delta - } else { - mean_deviation_ = QuicTime::Delta::FromMicroseconds(static_cast( - kOneMinusBeta * mean_deviation_.ToMicroseconds() + -- kBeta * std::abs(smoothed_rtt_.Subtract(rtt_sample).ToMicroseconds()))); -+ kBeta * std::labs(smoothed_rtt_.Subtract(rtt_sample).ToMicroseconds()))); - smoothed_rtt_ = - smoothed_rtt_.Multiply(kOneMinusAlpha).Add(rtt_sample.Multiply(kAlpha)); - DVLOG(1) << " smoothed_rtt(us):" << smoothed_rtt_.ToMicroseconds() Index: head/www/chromium/files/patch-ppapi_tests_extensions_BUILD.gn =================================================================== --- head/www/chromium/files/patch-ppapi_tests_extensions_BUILD.gn +++ head/www/chromium/files/patch-ppapi_tests_extensions_BUILD.gn @@ -0,0 +1,11 @@ +--- ppapi/tests/extensions/BUILD.gn.orig 2016-10-06 04:02:23.000000000 +0300 ++++ ppapi/tests/extensions/BUILD.gn 2016-10-13 08:10:32.687869000 +0300 +@@ -20,7 +20,7 @@ + ":ppapi_tests_extensions_popup($newlib)", + ":ppapi_tests_extensions_socket_permissions($newlib)", + ] +- if ((target_cpu == "x86" || target_cpu == "x64") && is_linux && ++ if ((target_cpu == "x86" || target_cpu == "x64") && (is_linux || is_bsd) && + enable_nacl_nonsfi) { + nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi" + data_deps += [ ":ppapi_tests_extensions_packaged_app($nonsfi)" ] Index: head/www/chromium/files/patch-printing_BUILD.gn =================================================================== --- head/www/chromium/files/patch-printing_BUILD.gn +++ head/www/chromium/files/patch-printing_BUILD.gn @@ -0,0 +1,20 @@ +--- printing/BUILD.gn.orig 2016-10-06 04:02:23.000000000 +0300 ++++ printing/BUILD.gn 2016-10-13 08:13:38.178051000 +0300 +@@ -125,7 +125,7 @@ + if (use_cups) { + configs += [ ":cups" ] + +- if (is_linux) { ++ if (is_linux || is_bsd) { + # rebase_path does not accept an empty string + if (use_sysroot) { + cups_sysroot = rebase_path(sysroot) +@@ -202,7 +202,7 @@ + "printing_context_no_system_dialog.cc", + "printing_context_no_system_dialog.h", + ] +- } else if (is_linux) { # Non-ChromeOS Linux. ++ } else if (is_linux || is_bsd) { # Non-ChromeOS Linux/BSD. + sources += [ + "printed_document_linux.cc", + "printing_context_linux.cc", Index: head/www/chromium/files/patch-printing_backend_print__backend__cups.cc =================================================================== --- head/www/chromium/files/patch-printing_backend_print__backend__cups.cc +++ head/www/chromium/files/patch-printing_backend_print__backend__cups.cc @@ -1,10 +0,0 @@ ---- printing/backend/print_backend_cups.cc.orig 2016-08-03 19:02:22 UTC -+++ printing/backend/print_backend_cups.cc -@@ -4,6 +4,7 @@ - - #include "printing/backend/print_backend.h" - -+#include - #include - #include - #include Index: head/www/chromium/files/patch-printing_cups__config__helper.py =================================================================== --- head/www/chromium/files/patch-printing_cups__config__helper.py +++ head/www/chromium/files/patch-printing_cups__config__helper.py @@ -0,0 +1,11 @@ +--- printing/cups_config_helper.py.orig 2016-08-03 22:02:22.000000000 +0300 ++++ printing/cups_config_helper.py 2016-09-02 22:48:48.706284000 +0300 +@@ -65,7 +65,7 @@ + mode = sys.argv[1] + if len(sys.argv) > 2 and sys.argv[2]: + sysroot = sys.argv[2] +- cups_config = os.path.join(sysroot, 'usr', 'bin', 'cups-config') ++ cups_config = os.path.join(sysroot, 'bin', 'cups-config') + if not os.path.exists(cups_config): + print 'cups-config not found: %s' % cups_config + return 1 Index: head/www/chromium/files/patch-printing_printing.gyp =================================================================== --- head/www/chromium/files/patch-printing_printing.gyp +++ head/www/chromium/files/patch-printing_printing.gyp @@ -1,11 +0,0 @@ ---- printing/printing.gyp.orig 2016-04-08 16:02:10 UTC -+++ printing/printing.gyp -@@ -187,7 +187,7 @@ - 'backend/print_backend_chromeos.cc', - ], - }], -- ['OS=="linux" and chromeos==0', { -+ ['(OS=="linux" or os_bsd == 1) and chromeos==0', { - 'sources': [ - 'printing_context_linux.cc', - 'printing_context_linux.h', Index: head/www/chromium/files/patch-remoting_host_BUILD.gn =================================================================== --- head/www/chromium/files/patch-remoting_host_BUILD.gn +++ head/www/chromium/files/patch-remoting_host_BUILD.gn @@ -0,0 +1,47 @@ +--- remoting/host/BUILD.gn.orig 2016-10-06 04:02:23.000000000 +0300 ++++ remoting/host/BUILD.gn 2016-10-13 08:18:22.564549000 +0300 +@@ -420,7 +420,7 @@ + deps += [ "//components/policy:generated" ] + } + +- if (is_linux && !is_chromeos) { ++ if ((is_linux || is_bsd) && !is_chromeos) { + libs += [ "pam" ] + } + +@@ -439,7 +439,7 @@ + "input_injector_x11.cc", + "local_input_monitor_x11.cc", + ] +- if (is_linux) { ++ if (is_linux || is_bsd) { + # These will already be filtered out on non-Linux. + sources -= [ + "linux/unicode_to_keysym.cc", +@@ -648,7 +648,7 @@ + "win/worker_process_launcher_unittest.cc", + ] + +- if (!use_x11 && is_linux) { ++ if (!use_x11 && (is_linux || is_bsd)) { + sources -= [ "linux/unicode_to_keysym_unittest.cc" ] + } + if (use_ozone || is_chromeos) { +@@ -1217,7 +1217,7 @@ + if (is_desktop_linux) { + deps += [ "//build/config/linux/gtk2" ] + } +- if ((is_linux && !is_chromeos) || is_mac) { ++ if ((is_linux && !is_chromeos) || is_mac || is_bsd) { + libs = [ "pam" ] + } + +@@ -1359,7 +1359,7 @@ + } + } + +- if (is_linux) { ++ if (is_linux || is_bsd) { + copy("remoting_me2me_host_copy_script") { + sources = [ + "linux/linux_me2me_host.py", Index: head/www/chromium/files/patch-remoting_remoting__host.gypi =================================================================== --- head/www/chromium/files/patch-remoting_remoting__host.gypi +++ head/www/chromium/files/patch-remoting_remoting__host.gypi @@ -1,29 +0,0 @@ ---- remoting/remoting_host.gypi.orig 2016-05-11 19:02:25 UTC -+++ remoting/remoting_host.gypi -@@ -18,7 +18,7 @@ - 'remoting_host_win.gypi', - ], - }], -- ['OS=="linux"', { -+ ['OS=="linux" or os_bsd==1', { - 'includes': [ - 'remoting_host_linux.gypi', - ], -@@ -57,7 +57,7 @@ - '<@(remoting_host_sources)', - ], - 'conditions': [ -- ['OS=="linux"', { -+ ['OS=="linux" or os_bsd==1', { - 'conditions': [ - ['use_x11==1', { - 'dependencies': [ -@@ -652,7 +652,7 @@ - 'host/it2me/it2me_native_messaging_host_main.h', - ], - 'conditions': [ -- ['OS=="linux" and chromeos==0 and use_ozone==0', { -+ ['(OS=="linux" or os_bsd==1) and chromeos==0 and use_ozone==0', { - 'dependencies': [ - # Always use GTK on Linux, even for Aura builds. - '../build/linux/system.gyp:gtk2', Index: head/www/chromium/files/patch-sdch_BUILD.gn =================================================================== --- head/www/chromium/files/patch-sdch_BUILD.gn +++ head/www/chromium/files/patch-sdch_BUILD.gn @@ -0,0 +1,20 @@ +--- sdch/BUILD.gn.orig 2016-08-03 22:02:22.000000000 +0300 ++++ sdch/BUILD.gn 2016-09-13 17:24:52.015350000 +0300 +@@ -11,7 +11,7 @@ + # from a config and can't be on the target directly. + config("sdch_warnings") { + cflags = [] +- if (is_linux) { ++ if (is_linux || is_bsd) { + # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11: + cflags += [ "-Wno-deprecated-declarations" ] + } +@@ -61,7 +61,7 @@ + "//third_party/zlib", + ] + +- if (is_linux || is_android) { ++ if (is_linux || is_bsd || is_android) { + include_dirs = [ "linux" ] + } else if (is_ios) { + include_dirs = [ "ios" ] Index: head/www/chromium/files/patch-services_shell_public_cpp_lib_initialize__base__and__icu.cc =================================================================== --- head/www/chromium/files/patch-services_shell_public_cpp_lib_initialize__base__and__icu.cc +++ head/www/chromium/files/patch-services_shell_public_cpp_lib_initialize__base__and__icu.cc @@ -1,18 +0,0 @@ ---- services/shell/public/cpp/lib/initialize_base_and_icu.cc.orig 2016-08-05 14:07:55.178818000 -0400 -+++ services/shell/public/cpp/lib/initialize_base_and_icu.cc 2016-08-05 14:08:22.862094000 -0400 -@@ -35,6 +35,7 @@ - base::SysInfo::MaxSharedMemorySize(); - #endif - -+#if !defined(__FreeBSD__) - #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE - // Initialize core ICU. We must perform the full initialization before we - // initialize icu::TimeZone subsystem because otherwise ICU gets in a state -@@ -42,6 +43,7 @@ - // cause crashes. - CHECK(base::i18n::InitializeICUFromRawMemory(icu_data)); - #endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE -+#endif - - #if !defined(OS_ANDROID) - // ICU DateFormat class (used in base/time_format.cc) needs to get the Index: head/www/chromium/files/patch-services_shell_runner_init.cc =================================================================== --- head/www/chromium/files/patch-services_shell_runner_init.cc +++ head/www/chromium/files/patch-services_shell_runner_init.cc @@ -1,18 +0,0 @@ ---- services/shell/runner/init.cc.orig 2016-08-05 14:09:25.990401000 -0400 -+++ services/shell/runner/init.cc 2016-08-05 14:09:42.644514000 -0400 -@@ -77,6 +77,7 @@ - void CallLibraryEarlyInitialization(base::NativeLibrary app_library) { - // Do whatever warming that the mojo application wants. - -+#if !defined(__FreeBSD__) - #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE - typedef void (*LibraryEarlyInitFunction)(const uint8_t*); - LibraryEarlyInitFunction init_function = -@@ -90,6 +91,7 @@ - init_function(icu_data); - } - #endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE -+#endif - - // TODO(erg): All chromium binaries load base. We might want to make a - // general system for other people. Index: head/www/chromium/files/patch-services_shell_standalone_context.cc =================================================================== --- head/www/chromium/files/patch-services_shell_standalone_context.cc +++ head/www/chromium/files/patch-services_shell_standalone_context.cc @@ -0,0 +1,11 @@ +--- services/shell/standalone/context.cc.orig 2016-10-06 04:02:24.000000000 +0300 ++++ services/shell/standalone/context.cc 2016-10-23 13:44:14.656275000 +0300 +@@ -198,7 +198,7 @@ + tracing_remote_interfaces->GetInterface( + tracing::mojom::StartupPerformanceDataCollector::Name_, + mojo::GetProxy(&collector).PassMessagePipe()); +-#if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) ++#if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) + // CurrentProcessInfo::CreationTime is only defined on some platforms. + const base::Time creation_time = base::CurrentProcessInfo::CreationTime(); + collector->SetShellProcessCreationTime(creation_time.ToInternalValue()); Index: head/www/chromium/files/patch-services_ui_ws_BUILD.gn =================================================================== --- head/www/chromium/files/patch-services_ui_ws_BUILD.gn +++ head/www/chromium/files/patch-services_ui_ws_BUILD.gn @@ -0,0 +1,14 @@ +--- services/ui/ws/BUILD.gn.orig 2016-10-06 04:02:24.000000000 +0300 ++++ services/ui/ws/BUILD.gn 2016-10-19 11:13:25.102806000 +0300 +@@ -103,6 +103,11 @@ + "window_tree_host_factory.h", + ] + ++ # Work around base r261801 ++ if (is_bsd) { ++ defines = ["_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1"] ++ } ++ + deps = [ + # TODO(sad): Temporary, until the GPU process is split out of ws. + "//services/ui/gpu", Index: head/www/chromium/files/patch-skia_BUILD.gn =================================================================== --- head/www/chromium/files/patch-skia_BUILD.gn +++ head/www/chromium/files/patch-skia_BUILD.gn @@ -0,0 +1,46 @@ +--- skia/BUILD.gn.orig 2016-08-03 22:02:22.000000000 +0300 ++++ skia/BUILD.gn 2016-10-09 06:26:37.625935000 +0300 +@@ -213,7 +213,7 @@ + } + + # Settings for text blitting, chosen to approximate the system browser. +- if (is_linux) { ++ if (is_linux || is_bsd) { + defines += [ + "SK_GAMMA_EXPONENT=1.2", + "SK_GAMMA_CONTRAST=0.2", +@@ -405,7 +405,7 @@ + sources -= [ "//third_party/skia/src/ports/SkFontHost_mac.cpp" ] + } + +- if (!is_linux) { ++ if (!is_linux && !is_bsd) { + sources -= [ + "//third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp", + "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp", +@@ -416,14 +416,14 @@ + + # Add the files for the SkFontMgr_Android. This is used to emulate android + # fonts on linux. See content/zygote/zygote_main_linux.cc +- if (is_linux) { ++ if (is_linux || is_bsd) { + sources += [ + "//third_party/skia/src/ports/SkFontMgr_android.cpp", + "//third_party/skia/src/ports/SkFontMgr_android_parser.cpp", + ] + } + +- if (!is_linux && !is_android) { ++ if (!is_linux && !is_bsd && !is_android) { + sources -= [ + "//third_party/skia/src/ports/SkFontHost_FreeType.cpp", + "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp", +@@ -463,7 +463,7 @@ + "//third_party/zlib", + ] + +- if (is_linux) { ++ if (is_linux || is_bsd) { + if (use_pango) { + configs += [ "//build/config/linux/pangocairo" ] + } Index: head/www/chromium/files/patch-skia_skia__chrome.gypi =================================================================== --- head/www/chromium/files/patch-skia_skia__chrome.gypi +++ head/www/chromium/files/patch-skia_skia__chrome.gypi @@ -1,14 +0,0 @@ ---- skia/skia_chrome.gypi.orig 2016-04-08 16:02:10 UTC -+++ skia/skia_chrome.gypi -@@ -61,6 +61,11 @@ - 'ext/platform_canvas.cc', - ], - }], -+ [ 'use_cairo == 1', { -+ 'dependencies': [ -+ '../build/linux/system.gyp:pangocairo', -+ ], -+ }], - [ 'OS == "android" and ' - 'enable_basic_printing==0 and enable_print_preview==0', { - 'sources!': [ Index: head/www/chromium/files/patch-skia_skia__common.gypi =================================================================== --- head/www/chromium/files/patch-skia_skia__common.gypi +++ head/www/chromium/files/patch-skia_skia__common.gypi @@ -1,11 +0,0 @@ ---- skia/skia_common.gypi.orig 2016-05-11 19:02:26 UTC -+++ skia/skia_common.gypi -@@ -65,7 +65,7 @@ - }], - - #Settings for text blitting, chosen to approximate the system browser. -- [ 'OS == "linux"', { -+ [ 'OS == "linux" or os_bsd == 1', { - 'defines': [ - 'SK_GAMMA_EXPONENT=1.2', - 'SK_GAMMA_CONTRAST=0.2', Index: head/www/chromium/files/patch-sync_util_get__session__name.cc =================================================================== --- head/www/chromium/files/patch-sync_util_get__session__name.cc +++ head/www/chromium/files/patch-sync_util_get__session__name.cc @@ -1,20 +0,0 @@ ---- sync/util/get_session_name.cc.orig 2016-03-25 13:04:51 UTC -+++ sync/util/get_session_name.cc -@@ -15,7 +15,7 @@ - - #if defined(OS_CHROMEOS) - #include "chromeos/system/devicetype.h" --#elif defined(OS_LINUX) -+#elif (defined(OS_LINUX) || defined(OS_BSD)) - #include "sync/util/get_session_name_linux.h" - #elif defined(OS_IOS) - #include "sync/util/get_session_name_ios.h" -@@ -51,7 +51,7 @@ std::string GetSessionNameSynchronously( - session_name = "Chromebook"; - break; - } --#elif defined(OS_LINUX) -+#elif defined(OS_LINUX) || defined(OS_BSD) - session_name = internal::GetHostname(); - #elif defined(OS_IOS) - session_name = internal::GetComputerName(); Index: head/www/chromium/files/patch-sync_util_get__session__name__linux.cc =================================================================== --- head/www/chromium/files/patch-sync_util_get__session__name__linux.cc +++ head/www/chromium/files/patch-sync_util_get__session__name__linux.cc @@ -1,14 +0,0 @@ ---- sync/util/get_session_name_linux.cc.orig 2016-03-25 13:04:51 UTC -+++ sync/util/get_session_name_linux.cc -@@ -13,8 +13,9 @@ namespace syncer { - namespace internal { - - std::string GetHostname() { -- char hostname[HOST_NAME_MAX]; -- if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success. -+ int len = sysconf(_SC_HOST_NAME_MAX); -+ char hostname[len]; -+ if (gethostname(hostname, len) == 0) // Success. - return hostname; - return base::GetLinuxDistro(); - } Index: head/www/chromium/files/patch-third__party_WebKit_Source_core_BUILD.gn =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_core_BUILD.gn +++ head/www/chromium/files/patch-third__party_WebKit_Source_core_BUILD.gn @@ -0,0 +1,11 @@ +--- third_party/WebKit/Source/core/BUILD.gn.orig 2016-08-03 22:02:34.000000000 +0300 ++++ third_party/WebKit/Source/core/BUILD.gn 2016-09-29 17:55:09.476348000 +0300 +@@ -249,7 +249,7 @@ + ] + } + +- if (!is_linux) { ++ if (!(is_linux || is_bsd)) { + sources -= [ + "layout/LayoutThemeLinux.cpp", + "layout/LayoutThemeLinux.h", Index: head/www/chromium/files/patch-third__party_WebKit_Source_core_core.gyp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_core_core.gyp +++ head/www/chromium/files/patch-third__party_WebKit_Source_core_core.gyp @@ -1,20 +0,0 @@ ---- third_party/WebKit/Source/core/core.gyp.orig 2016-05-11 19:02:30 UTC -+++ third_party/WebKit/Source/core/core.gyp -@@ -367,7 +367,7 @@ - 'layout/LayoutThemeMac.mm', - ], - }], -- ['OS != "linux"', { -+ ['OS != "linux" and os_bsd != 1', { - 'sources!': [ - 'layout/LayoutThemeLinux.cpp', - 'layout/LayoutThemeLinux.h', -@@ -644,7 +644,7 @@ - 'layout/LayoutThemeMac.mm', - ], - }], -- ['OS != "linux"', { -+ ['OS != "linux" and OS != "openbsd" and OS != "freebsd"', { - 'sources!': [ - 'layout/LayoutThemeLinux.cpp', - 'layout/LayoutThemeLinux.h', Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_blink__platform.gyp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_blink__platform.gyp +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_blink__platform.gyp @@ -1,42 +0,0 @@ ---- third_party/WebKit/Source/platform/blink_platform.gyp.orig 2016-05-25 15:01:11.000000000 -0400 -+++ third_party/WebKit/Source/platform/blink_platform.gyp 2016-05-27 12:20:28.640442000 -0400 -@@ -38,6 +38,9 @@ - 'targets': [{ - 'target_name': 'blink_common', - 'type': '<(component)', -+ 'include_dirs': [ -+ '<(prefix_dir)/include', -+ ], - 'variables': { 'enable_wexit_time_destructors': 1 }, - 'dependencies': [ - '../config.gyp:config', -@@ -222,7 +225,7 @@ - ['include', 'graphics/cpu/x86/WebGLImageConversionSSE\\.h$'], - ], - }], -- ['OS=="linux" or OS=="android"', { -+ ['OS=="linux" or OS=="android" or os_bsd==1', { - 'sources/': [ - ['include', 'fonts/linux/FontPlatformDataLinux\\.cpp$'], - ] -@@ -301,7 +304,7 @@ - ['exclude', 'scroll/ScrollbarThemeMac'], - ], - }], -- ['OS != "linux" and OS != "mac" and OS != "win"', { -+ ['OS != "linux" and OS != "mac" and OS != "win" and os_bsd != 1', { - 'sources/': [ - ['exclude', 'VDMX[^/]+\\.(cpp|h)$'], - ], -@@ -347,6 +350,11 @@ - ['exclude', 'scroll/ScrollbarThemeAura\\.(cpp|h)'], - ], - }], -+ ['use_system_icu==1', { -+ 'defines': [ -+ 'USING_SYSTEM_ICU', -+ ], -+ }], - ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', { - 'include_dirs': [ - '<(DEPTH)/third_party/ffmpeg', Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_FontPlatformData.h =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_FontPlatformData.h +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_FontPlatformData.h @@ -1,14 +1,14 @@ ---- third_party/WebKit/Source/platform/fonts/FontPlatformData.h.orig 2016-08-04 11:21:45.907982000 -0400 -+++ third_party/WebKit/Source/platform/fonts/FontPlatformData.h 2016-08-04 11:22:32.571069000 -0400 +--- third_party/WebKit/Source/platform/fonts/FontPlatformData.h.orig 2016-08-05 04:20:03.099630000 +0300 ++++ third_party/WebKit/Source/platform/fonts/FontPlatformData.h 2016-08-05 04:18:22.356719000 +0300 @@ -46,9 +46,9 @@ #include "wtf/text/CString.h" #include "wtf/text/StringImpl.h" -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) #include "platform/fonts/linux/FontRenderStyle.h" -#endif // OS(LINUX) || OS(ANDROID) -+#endif // OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#endif // OS(LINUX) || OS(ANDROID) || OS(BSD) #if OS(MACOSX) OBJC_CLASS NSFont; @@ -17,7 +17,7 @@ PassRefPtr openTypeTable(SkFontTableTag) const; -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) // The returned styles are all actual styles without FontRenderStyle::NoPreference. const FontRenderStyle& getFontRenderStyle() const { return m_style; } #endif @@ -26,7 +26,7 @@ FontOrientation m_orientation; private: -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) FontRenderStyle m_style; #endif Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_FontPlatformData.cpp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_FontPlatformData.cpp +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_FontPlatformData.cpp @@ -1,11 +1,11 @@ ---- third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp.orig 2016-08-04 11:20:01.382167000 -0400 -+++ third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp 2016-08-04 11:21:00.605035000 -0400 +--- third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp.orig 2016-07-20 22:03:41.000000000 +0300 ++++ third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp 2016-08-12 10:17:15.872857000 +0300 @@ -93,7 +93,7 @@ , m_syntheticBold(source.m_syntheticBold) , m_syntheticItalic(source.m_syntheticItalic) , m_orientation(source.m_orientation) -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) , m_style(source.m_style) #endif , m_harfBuzzFace(nullptr) @@ -14,7 +14,7 @@ , m_syntheticItalic(src.m_syntheticItalic) , m_orientation(src.m_orientation) -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) , m_style(FontRenderStyle::querySystem(m_family, m_textSize, m_typeface->style())) #endif , m_harfBuzzFace(nullptr) @@ -23,7 +23,7 @@ , m_syntheticItalic(syntheticItalic) , m_orientation(orientation) -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) , m_style(FontRenderStyle::querySystem(m_family, m_textSize, m_typeface->style())) #endif , m_isHashTableDeletedValue(false) @@ -32,16 +32,16 @@ m_harfBuzzFace = nullptr; m_orientation = other.m_orientation; -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) m_style = other.m_style; #endif - + @@ -216,7 +216,7 @@ && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue && m_syntheticBold == a.m_syntheticBold && m_syntheticItalic == a.m_syntheticItalic -#if OS(LINUX) || OS(ANDROID) -+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) && m_style == a.m_style #endif && m_orientation == a.m_orientation; Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_SimpleFontData.cpp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_SimpleFontData.cpp +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_SimpleFontData.cpp @@ -0,0 +1,29 @@ +--- third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp.orig 2016-07-20 22:03:41.000000000 +0300 ++++ third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp 2016-08-12 10:20:18.427009000 +0300 +@@ -49,7 +49,7 @@ + const float smallCapsFontSizeMultiplier = 0.7f; + const float emphasisMarkFontSizeMultiplier = 0.5f; + +-#if OS(LINUX) || OS(ANDROID) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) + // This is the largest VDMX table which we'll try to load and parse. + static const size_t maxVDMXTableSize = 1024 * 1024; // 1 MB + #endif +@@ -102,7 +102,7 @@ + int vdmxAscent = 0, vdmxDescent = 0; + bool isVDMXValid = false; + +-#if OS(LINUX) || OS(ANDROID) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) + // Manually digging up VDMX metrics is only applicable when bytecode hinting using FreeType. + // With DirectWrite or CoreText, no bytecode hinting is ever done. + // This code should be pushed into FreeType (hinted font metrics). +@@ -135,7 +135,7 @@ + } else { + ascent = SkScalarRoundToInt(-metrics.fAscent); + descent = SkScalarRoundToInt(metrics.fDescent); +-#if OS(LINUX) || OS(ANDROID) ++#if OS(LINUX) || OS(ANDROID) || OS(BSD) + // When subpixel positioning is enabled, if the descent is rounded down, the descent part + // of the glyph may be truncated when displayed in a 'overflow: hidden' container. + // To avoid that, borrow 1 unit from the ascent when possible. Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_skia_FontCacheSkia.cpp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_skia_FontCacheSkia.cpp +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_fonts_skia_FontCacheSkia.cpp @@ -1,11 +1,11 @@ ---- third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp.orig 2016-07-22 00:07:09.000000000 -0400 -+++ third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp 2016-08-03 15:39:36.482884000 -0400 +--- third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp.orig 2016-07-20 22:03:41.000000000 +0300 ++++ third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp 2016-08-01 04:30:26.468814000 +0300 @@ -60,7 +60,7 @@ namespace blink { -#if OS(ANDROID) || OS(LINUX) -+#if OS(ANDROID) || OS(LINUX) || OS(FREEBSD) ++#if OS(ANDROID) || OS(LINUX) || OS(BSD) // Android special locale for retrieving the color emoji font // based on the proposed changes in UTR #51 for introducing // an Emoji script code: @@ -14,7 +14,7 @@ #endif -#if OS(LINUX) || OS(WIN) -+#if OS(LINUX) || OS(WIN) || OS(FREEBSD) ++#if OS(LINUX) || OS(WIN) || OS(BSD) // On linux if the fontManager has been overridden then we should be calling the embedder // provided font Manager rather than calling SkTypeface::CreateFromName which may redirect the // call to the default font Manager. Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_image-decoders_png_PNGImageDecoder.cpp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_image-decoders_png_PNGImageDecoder.cpp +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_image-decoders_png_PNGImageDecoder.cpp @@ -1,11 +0,0 @@ ---- third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp.orig 2016-05-27 18:46:06.992656000 -0400 -+++ third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp 2016-05-27 18:46:37.983471000 -0400 -@@ -234,7 +234,7 @@ - #endif - png_uint_32 profileLength = 0; - if (png_get_iCCP(png, info, &profileName, &compressionType, &profile, &profileLength)) { -- setColorProfileAndTransform(profile, profileLength, imageHasAlpha, false /* useSRGB */); -+ setColorProfileAndTransform(reinterpret_cast(profile), profileLength, imageHasAlpha, false /* useSRGB */); - } - } - #endif // PNG_iCCP_SUPPORTED Index: head/www/chromium/files/patch-third__party_WebKit_Source_platform_text_CharacterPropertyDataGenerator.cpp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_platform_text_CharacterPropertyDataGenerator.cpp +++ head/www/chromium/files/patch-third__party_WebKit_Source_platform_text_CharacterPropertyDataGenerator.cpp @@ -1,17 +0,0 @@ ---- third_party/WebKit/Source/platform/text/CharacterPropertyDataGenerator.cpp.orig 2016-05-27 12:26:56.689563000 -0400 -+++ third_party/WebKit/Source/platform/text/CharacterPropertyDataGenerator.cpp 2016-05-27 12:27:22.119336000 -0400 -@@ -11,12 +11,12 @@ - #include - #include - #include --#if !defined(USING_SYSTEM_ICU) -+#if !defined(__FreeBSD__) - #define MUTEX_H // Prevent compile failure of utrie2.h on Windows - #include - #endif - --#if defined(USING_SYSTEM_ICU) -+#if defined(__FreeBSD__) - static void generate(FILE*) - { - } Index: head/www/chromium/files/patch-third__party_WebKit_Source_web_PopupMenuImpl.cpp =================================================================== --- head/www/chromium/files/patch-third__party_WebKit_Source_web_PopupMenuImpl.cpp +++ head/www/chromium/files/patch-third__party_WebKit_Source_web_PopupMenuImpl.cpp @@ -0,0 +1,11 @@ +--- third_party/WebKit/Source/web/PopupMenuImpl.cpp.orig 2016-07-20 22:03:42.000000000 +0300 ++++ third_party/WebKit/Source/web/PopupMenuImpl.cpp 2016-08-12 10:26:08.695632000 +0300 +@@ -155,7 +155,7 @@ + , m_buffer(buffer) + { + DCHECK(m_buffer); +-#if OS(LINUX) ++#if OS(LINUX) || OS(BSD) + // On other platforms, the