[arch-commits] Commit in chromium/repos/extra-x86_64 (12 files)

Evangelos Foutras foutrelis at archlinux.org
Tue May 29 21:13:18 UTC 2018


    Date: Tuesday, May 29, 2018 @ 21:13:17
  Author: foutrelis
Revision: 325129

archrelease: copy trunk to extra-x86_64

Added:
  chromium/repos/extra-x86_64/PKGBUILD
    (from rev 325128, chromium/trunk/PKGBUILD)
  chromium/repos/extra-x86_64/chromium-ffmpeg-r1.patch
    (from rev 325128, chromium/trunk/chromium-ffmpeg-r1.patch)
  chromium/repos/extra-x86_64/chromium-skia-harmony.patch
    (from rev 325128, chromium/trunk/chromium-skia-harmony.patch)
  chromium/repos/extra-x86_64/chromium-widevine-r2.patch
    (from rev 325128, chromium/trunk/chromium-widevine-r2.patch)
  chromium/repos/extra-x86_64/chromium.install
    (from rev 325128, chromium/trunk/chromium.install)
  chromium/repos/extra-x86_64/remove-dependency-on-ffmpeg-internals-for-start-time.patch
    (from rev 325128, chromium/trunk/remove-dependency-on-ffmpeg-internals-for-start-time.patch)
Deleted:
  chromium/repos/extra-x86_64/PKGBUILD
  chromium/repos/extra-x86_64/chromium-skia-harmony.patch
  chromium/repos/extra-x86_64/chromium-widevine.patch
  chromium/repos/extra-x86_64/chromium.install
  chromium/repos/extra-x86_64/fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch
  chromium/repos/extra-x86_64/fix-frame-buttons-rendering-too-large-when-using-OSX.patch

------------------------------------------------------------+
 PKGBUILD                                                   |  467 +++++------
 chromium-ffmpeg-r1.patch                                   |   22 
 chromium-skia-harmony.patch                                |  154 +--
 chromium-widevine-r2.patch                                 |   39 
 chromium-widevine.patch                                    |   10 
 chromium.install                                           |   32 
 fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch   |   53 -
 fix-frame-buttons-rendering-too-large-when-using-OSX.patch |   60 -
 remove-dependency-on-ffmpeg-internals-for-start-time.patch |  260 ++++++
 9 files changed, 639 insertions(+), 458 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2018-05-29 21:13:08 UTC (rev 325128)
+++ PKGBUILD	2018-05-29 21:13:17 UTC (rev 325129)
@@ -1,242 +0,0 @@
-# $Id$
-# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
-# Contributor: Pierre Schmitz <pierre at archlinux.de>
-# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
-# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
-
-pkgname=chromium
-pkgver=66.0.3359.181
-pkgrel=1
-_launcher_ver=6
-pkgdesc="A web browser built for speed, simplicity, and security"
-arch=('x86_64')
-url="https://www.chromium.org/Home"
-license=('BSD')
-depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
-         'ttf-font' 'systemd' 'dbus' 'libpulse' 'pciutils' 'json-glib'
-         'desktop-file-utils' 'hicolor-icon-theme')
-makedepends=('python' 'python2' 'gperf' 'yasm' 'mesa' 'ninja' 'nodejs' 'git'
-             'clang' 'lld')
-optdepends=('pepper-flash: support for Flash content'
-            'kdialog: needed for file dialogs in KDE'
-            'gnome-keyring: for storing passwords in GNOME keyring'
-            'kwallet: for storing passwords in KWallet')
-install=chromium.install
-source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
-        chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
-        chromium-$pkgver.txt::https://chromium.googlesource.com/chromium/src/+/$pkgver?format=TEXT
-        fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch
-        fix-frame-buttons-rendering-too-large-when-using-OSX.patch
-        chromium-skia-harmony.patch
-        chromium-widevine.patch)
-sha256sums=('37e6673741b365a25a837217b08f77b24b4f5fc4ad88c8581be6a5dae9a9e919'
-            '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1'
-            '221d0f17951e88d4d315f3160919380237b88587c4b295d619229a05b79927f1'
-            'e3fb73b43bb8c69ff517e66b2cac73d6e759fd240003eb35598df9af442422fe'
-            'bd5e0e61df3f89172590801aea7c8ac75162c10c7fe83e262e96a14388d1633a'
-            'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3'
-            'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808')
-
-# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
-# Keys are the names in the above script; values are the dependencies in Arch
-declare -gA _system_libs=(
-  #[ffmpeg]=ffmpeg            # https://crbug.com/731766
-  [flac]=flac
-  [fontconfig]=fontconfig
-  [freetype]=freetype2
-  [harfbuzz-ng]=harfbuzz
-  [icu]=icu
-  [libdrm]=
-  [libjpeg]=libjpeg
-  #[libpng]=libpng            # https://crbug.com/752403#c10
-  #[libvpx]=libvpx
-  [libwebp]=libwebp
-  #[libxml]=libxml2           # https://crbug.com/736026
-  [libxslt]=libxslt
-  [opus]=opus
-  [re2]=re2
-  [snappy]=snappy
-  [yasm]=
-  [zlib]=minizip
-)
-_unwanted_bundled_libs=(
-  ${!_system_libs[@]}
-  ${_system_libs[libjpeg]+libjpeg_turbo}
-)
-depends+=(${_system_libs[@]})
-
-# Google API keys (see https://www.chromium.org/developers/how-tos/api-keys)
-# Note: These are for Arch Linux use ONLY. For your own distribution, please
-# get your own set of keys.
-_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
-_google_default_client_id=413772536636.apps.googleusercontent.com
-_google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4
-
-prepare() {
-  cd "$srcdir/$pkgname-$pkgver"
-
-  # https://crbug.com/710701
-  local _chrome_build_hash=$(base64 -d ../chromium-$pkgver.txt |
-    grep -Po '^parent \K[0-9a-f]{40}$')
-  if [[ -z $_chrome_build_hash ]]; then
-    error "Unable to find Chrome build hash."
-    return 1
-  fi
-  echo "LASTCHANGE=$_chrome_build_hash-" >build/util/LASTCHANGE
-
-  # Allow building against system libraries in official builds
-  sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
-    tools/generate_shim_headers/generate_shim_headers.py
-
-  # Enable support for the Widevine CDM plugin
-  # libwidevinecdm.so is not included, but can be copied over from Chrome
-  # (Version string doesn't seem to matter so let's go with "Pinkie Pie")
-  sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch |
-    patch -Np1
-
-  # Work around broken screen sharing in Google Meet
-  # https://crbug.com/829916#c16
-  sed -i 's/"Chromium/"Chrome/' chrome/common/chrome_content_client_constants.cc
-
-  # https://crbug.com/822820
-  patch -Np1 -i ../fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch
-
-  # https://crbug.com/821881
-  patch -Np1 -i ../fix-frame-buttons-rendering-too-large-when-using-OSX.patch
-
-  # https://crbug.com/skia/6663#c10
-  patch -Np4 -i ../chromium-skia-harmony.patch
-
-  # Force script incompatible with Python 3 to use /usr/bin/python2
-  sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py
-
-  mkdir -p third_party/node/linux/node-linux-x64/bin
-  ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
-
-  # Remove bundled libraries for which we will use the system copies; this
-  # *should* do what the remove_bundled_libraries.py script does, with the
-  # added benefit of not having to list all the remaining libraries
-  local _lib
-  for _lib in ${_unwanted_bundled_libs[@]}; do
-    find -type f -path "*third_party/$_lib/*" \
-      \! -path "*third_party/$_lib/chromium/*" \
-      \! -path "*third_party/$_lib/google/*" \
-      \! -path './base/third_party/icu/*' \
-      \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
-      \! -path './third_party/yasm/run_yasm.py' \
-      \! -regex '.*\.\(gn\|gni\|isolate\)' \
-      -delete
-  done
-
-  python2 build/linux/unbundle/replace_gn_files.py \
-    --system-libraries "${!_system_libs[@]}"
-}
-
-build() {
-  make -C chromium-launcher-$_launcher_ver
-
-  cd "$srcdir/$pkgname-$pkgver"
-
-  if check_buildoption ccache y; then
-    # Avoid falling back to preprocessor mode when sources contain time macros
-    export CCACHE_SLOPPINESS=time_macros
-  fi
-
-  export CC=clang
-  export CXX=clang++
-  export AR=ar
-  export NM=nm
-
-  local _flags=(
-    'custom_toolchain="//build/toolchain/linux/unbundle:default"'
-    'host_toolchain="//build/toolchain/linux/unbundle:default"'
-    'clang_use_chrome_plugins=false'
-    'is_official_build=true' # implies is_cfi=true on x86_64
-    'is_debug=false'
-    'treat_warnings_as_errors=false'
-    'fieldtrial_testing_like_official_build=true'
-    'remove_webcore_debug_symbols=true'
-    'ffmpeg_branding="Chrome"'
-    'proprietary_codecs=true'
-    'link_pulseaudio=true'
-    'use_gnome_keyring=false'
-    'use_sysroot=false'
-    'linux_use_bundled_binutils=false'
-    'use_custom_libcxx=false'
-    'enable_hangout_services_extension=true'
-    'enable_widevine=true'
-    'enable_nacl=false'
-    'enable_swiftshader=false'
-    "google_api_key=\"${_google_api_key}\""
-    "google_default_client_id=\"${_google_default_client_id}\""
-    "google_default_client_secret=\"${_google_default_client_secret}\""
-  )
-
-  # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
-  CFLAGS+='   -Wno-builtin-macro-redefined'
-  CXXFLAGS+=' -Wno-builtin-macro-redefined'
-  CPPFLAGS+=' -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__='
-
-  if check_option strip y; then
-    _flags+=('symbol_level=0')
-
-    # Mimic exclude_unwind_tables=true
-    CFLAGS+='   -fno-unwind-tables -fno-asynchronous-unwind-tables'
-    CXXFLAGS+=' -fno-unwind-tables -fno-asynchronous-unwind-tables'
-    CPPFLAGS+=' -DNO_UNWIND_TABLES'
-  fi
-
-  python2 tools/gn/bootstrap/bootstrap.py -s --no-clean
-  out/Release/gn gen out/Release --args="${_flags[*]}" \
-    --script-executable=/usr/bin/python2
-
-  ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter
-}
-
-package() {
-  cd chromium-launcher-$_launcher_ver
-  make PREFIX=/usr DESTDIR="$pkgdir" install
-  install -Dm644 LICENSE \
-    "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher"
-
-  cd "$srcdir/$pkgname-$pkgver"
-
-  install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium"
-  install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox"
-  ln -s /usr/lib/chromium/chromedriver "$pkgdir/usr/bin/chromedriver"
-
-  install -Dm644 chrome/installer/linux/common/desktop.template \
-    "$pkgdir/usr/share/applications/chromium.desktop"
-  install -Dm644 chrome/app/resources/manpage.1.in \
-    "$pkgdir/usr/share/man/man1/chromium.1"
-  sed -i \
-    -e "s/@@MENUNAME@@/Chromium/g" \
-    -e "s/@@PACKAGE@@/chromium/g" \
-    -e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
-    "$pkgdir/usr/share/applications/chromium.desktop" \
-    "$pkgdir/usr/share/man/man1/chromium.1"
-
-  cp \
-    out/Release/{chrome_{100,200}_percent,resources}.pak \
-    out/Release/{*.bin,chromedriver,libwidevinecdmadapter.so} \
-    "$pkgdir/usr/lib/chromium/"
-  install -Dm644 -t "$pkgdir/usr/lib/chromium/locales" out/Release/locales/*.pak
-
-  if [[ -z ${_system_libs[icu]+set} ]]; then
-    cp out/Release/icudtl.dat "$pkgdir/usr/lib/chromium/"
-  fi
-
-  for size in 22 24 48 64 128 256; do
-    install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
-      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
-  done
-
-  for size in 16 32; do
-    install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
-      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
-  done
-
-  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
-}
-
-# vim:set ts=2 sw=2 et:

Copied: chromium/repos/extra-x86_64/PKGBUILD (from rev 325128, chromium/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2018-05-29 21:13:17 UTC (rev 325129)
@@ -0,0 +1,225 @@
+# $Id$
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Pierre Schmitz <pierre at archlinux.de>
+# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
+# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
+
+pkgname=chromium
+pkgver=67.0.3396.56
+pkgrel=1
+_launcher_ver=6
+pkgdesc="A web browser built for speed, simplicity, and security"
+arch=('x86_64')
+url="https://www.chromium.org/Home"
+license=('BSD')
+depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
+         'ttf-font' 'systemd' 'dbus' 'libpulse' 'pciutils' 'json-glib'
+         'desktop-file-utils' 'hicolor-icon-theme')
+makedepends=('python' 'python2' 'gperf' 'yasm' 'mesa' 'ninja' 'nodejs' 'git'
+             'clang' 'lld')
+optdepends=('pepper-flash: support for Flash content'
+            'kdialog: needed for file dialogs in KDE'
+            'gnome-keyring: for storing passwords in GNOME keyring'
+            'kwallet: for storing passwords in KWallet')
+install=chromium.install
+source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
+        chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
+        remove-dependency-on-ffmpeg-internals-for-start-time.patch
+        chromium-ffmpeg-r1.patch
+        chromium-widevine-r2.patch
+        chromium-skia-harmony.patch)
+sha256sums=('bae1f4b66d9fb219d5217c2f7db661ebf17e995bccd4b2b5f119c90af4c49123'
+            '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1'
+            '2cc80f5ed8a9b42495a0f3ab3c1bae026b9081972269a1b6d407331d33f7d257'
+            'aa885330bc4180b78d915f9dfdfc3210038a0acab7b16735ea9828ab6a633bde'
+            '02c69bb3954087db599def7f5b6d65cf8f7cf2ed81dfbdaa4bb7b51863b4df15'
+            'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3')
+
+# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
+# Keys are the names in the above script; values are the dependencies in Arch
+declare -gA _system_libs=(
+  [ffmpeg]=ffmpeg
+  [flac]=flac
+  [fontconfig]=fontconfig
+  [freetype]=freetype2
+  [harfbuzz-ng]=harfbuzz
+  [icu]=icu
+  [libdrm]=
+  [libjpeg]=libjpeg
+  #[libpng]=libpng            # https://crbug.com/752403#c10
+  #[libvpx]=libvpx            # needs unreleased libvpx
+  [libwebp]=libwebp
+  #[libxml]=libxml2           # https://crbug.com/736026
+  [libxslt]=libxslt
+  [opus]=opus
+  [re2]=re2
+  [snappy]=snappy
+  [yasm]=
+  [zlib]=minizip
+)
+_unwanted_bundled_libs=(
+  ${!_system_libs[@]}
+  ${_system_libs[libjpeg]+libjpeg_turbo}
+)
+depends+=(${_system_libs[@]})
+
+# Google API keys (see https://www.chromium.org/developers/how-tos/api-keys)
+# Note: These are for Arch Linux use ONLY. For your own distribution, please
+# get your own set of keys.
+_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
+_google_default_client_id=413772536636.apps.googleusercontent.com
+_google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4
+
+prepare() {
+  cd "$srcdir/$pkgname-$pkgver"
+
+  # Allow building against system libraries in official builds
+  sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+    tools/generate_shim_headers/generate_shim_headers.py
+
+  # https://crbug.com/731766
+  patch -Np1 -i ../remove-dependency-on-ffmpeg-internals-for-start-time.patch
+
+  # https://crbug.com/skia/6663#c10
+  patch -Np4 -i ../chromium-skia-harmony.patch
+
+  # Fixes from Gentoo
+  patch -Np1 -i ../chromium-ffmpeg-r1.patch
+  patch -Np1 -i ../chromium-widevine-r2.patch
+
+  # Remove compiler flags not supported by our system clang
+  sed -i \
+    -e '/"-Wno-ignored-pragma-optimize"/d' \
+    build/config/compiler/BUILD.gn
+
+  # Force script incompatible with Python 3 to use /usr/bin/python2
+  sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py
+
+  mkdir -p third_party/node/linux/node-linux-x64/bin
+  ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+  # Remove bundled libraries for which we will use the system copies; this
+  # *should* do what the remove_bundled_libraries.py script does, with the
+  # added benefit of not having to list all the remaining libraries
+  local _lib
+  for _lib in ${_unwanted_bundled_libs[@]}; do
+    find "third_party/$_lib" -type f \
+      \! -path "third_party/$_lib/chromium/*" \
+      \! -path "third_party/$_lib/google/*" \
+      \! -path 'third_party/yasm/run_yasm.py' \
+      \! -regex '.*\.\(gn\|gni\|isolate\)' \
+      -delete
+  done
+
+  python2 build/linux/unbundle/replace_gn_files.py \
+    --system-libraries "${!_system_libs[@]}"
+}
+
+build() {
+  make -C chromium-launcher-$_launcher_ver
+
+  cd "$srcdir/$pkgname-$pkgver"
+
+  if check_buildoption ccache y; then
+    # Avoid falling back to preprocessor mode when sources contain time macros
+    export CCACHE_SLOPPINESS=time_macros
+  fi
+
+  export CC=clang
+  export CXX=clang++
+  export AR=ar
+  export NM=nm
+
+  local _flags=(
+    'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+    'host_toolchain="//build/toolchain/linux/unbundle:default"'
+    'clang_use_chrome_plugins=false'
+    'is_official_build=true' # implies is_cfi=true on x86_64
+    'is_debug=false'
+    'treat_warnings_as_errors=false'
+    'fieldtrial_testing_like_official_build=true'
+    'remove_webcore_debug_symbols=true'
+    'ffmpeg_branding="Chrome"'
+    'proprietary_codecs=true'
+    'link_pulseaudio=true'
+    'use_gnome_keyring=false'
+    'use_sysroot=false'
+    'linux_use_bundled_binutils=false'
+    'use_custom_libcxx=false'
+    'enable_hangout_services_extension=true'
+    'enable_widevine=true'
+    'enable_nacl=false'
+    'enable_swiftshader=false'
+    "google_api_key=\"${_google_api_key}\""
+    "google_default_client_id=\"${_google_default_client_id}\""
+    "google_default_client_secret=\"${_google_default_client_secret}\""
+  )
+
+  # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
+  CFLAGS+='   -Wno-builtin-macro-redefined'
+  CXXFLAGS+=' -Wno-builtin-macro-redefined'
+  CPPFLAGS+=' -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__='
+
+  if check_option strip y; then
+    _flags+=('symbol_level=0')
+
+    # Mimic exclude_unwind_tables=true
+    CFLAGS+='   -fno-unwind-tables -fno-asynchronous-unwind-tables'
+    CXXFLAGS+=' -fno-unwind-tables -fno-asynchronous-unwind-tables'
+    CPPFLAGS+=' -DNO_UNWIND_TABLES'
+  fi
+
+  python2 tools/gn/bootstrap/bootstrap.py -s --no-clean
+  out/Release/gn gen out/Release --args="${_flags[*]}" \
+    --script-executable=/usr/bin/python2
+
+  ninja -C out/Release chrome chrome_sandbox chromedriver
+}
+
+package() {
+  cd chromium-launcher-$_launcher_ver
+  make PREFIX=/usr DESTDIR="$pkgdir" install
+  install -Dm644 LICENSE \
+    "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher"
+
+  cd "$srcdir/$pkgname-$pkgver"
+
+  install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium"
+  install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox"
+  ln -s /usr/lib/chromium/chromedriver "$pkgdir/usr/bin/chromedriver"
+
+  install -Dm644 chrome/installer/linux/common/desktop.template \
+    "$pkgdir/usr/share/applications/chromium.desktop"
+  install -Dm644 chrome/app/resources/manpage.1.in \
+    "$pkgdir/usr/share/man/man1/chromium.1"
+  sed -i \
+    -e "s/@@MENUNAME@@/Chromium/g" \
+    -e "s/@@PACKAGE@@/chromium/g" \
+    -e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
+    "$pkgdir/usr/share/applications/chromium.desktop" \
+    "$pkgdir/usr/share/man/man1/chromium.1"
+
+  cp \
+    out/Release/{chrome_{100,200}_percent,resources}.pak \
+    out/Release/{*.bin,chromedriver} \
+    "$pkgdir/usr/lib/chromium/"
+  install -Dm644 -t "$pkgdir/usr/lib/chromium/locales" out/Release/locales/*.pak
+
+  if [[ -z ${_system_libs[icu]+set} ]]; then
+    cp out/Release/icudtl.dat "$pkgdir/usr/lib/chromium/"
+  fi
+
+  for size in 22 24 48 64 128 256; do
+    install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
+      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+  done
+
+  for size in 16 32; do
+    install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
+      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+  done
+
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: chromium/repos/extra-x86_64/chromium-ffmpeg-r1.patch (from rev 325128, chromium/trunk/chromium-ffmpeg-r1.patch)
===================================================================
--- chromium-ffmpeg-r1.patch	                        (rev 0)
+++ chromium-ffmpeg-r1.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -0,0 +1,22 @@
+--- a/build/linux/unbundle/ffmpeg.gn
++++ b/build/linux/unbundle/ffmpeg.gn
+@@ -14,8 +14,8 @@ pkg_config("system_ffmpeg") {
+   ]
+ }
+ 
+-buildflag_header("ffmpeg_buildflags") {
+-  header = "ffmpeg_buildflags.h"
++buildflag_header("ffmpeg_features") {
++  header = "ffmpeg_features.h"
+   flags = [ "USE_SYSTEM_FFMPEG=true" ]
+ }
+ 
+@@ -30,7 +30,7 @@ shim_headers("ffmpeg_shim") {
+ 
+ source_set("ffmpeg") {
+   deps = [
+-    ":ffmpeg_buildflags",
++    ":ffmpeg_features",
+     ":ffmpeg_shim",
+   ]
+   public_configs = [ ":system_ffmpeg" ]

Deleted: chromium-skia-harmony.patch
===================================================================
--- chromium-skia-harmony.patch	2018-05-29 21:13:08 UTC (rev 325128)
+++ chromium-skia-harmony.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -1,77 +0,0 @@
---- qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig	2017-10-10 17:42:06.956950985 +0200
-+++ qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp	2017-10-10 17:46:05.824187787 +0200
-@@ -99,8 +99,6 @@
-     FreeTypeLibrary()
-         : fGetVarDesignCoordinates(nullptr)
-         , fLibrary(nullptr)
--        , fIsLCDSupported(false)
--        , fLCDExtra(0)
-     {
-         if (FT_New_Library(&gFTMemory, &fLibrary)) {
-             return;
-@@ -147,12 +145,7 @@
-         }
- #endif
- 
--        // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
--        // The default has changed over time, so this doesn't mean the same thing to all users.
--        if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
--            fIsLCDSupported = true;
--            fLCDExtra = 2; //Using a filter adds one full pixel to each side.
--        }
-+        FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT);
-     }
-     ~FreeTypeLibrary() {
-         if (fLibrary) {
-@@ -161,8 +153,6 @@
-     }
- 
-     FT_Library library() { return fLibrary; }
--    bool isLCDSupported() { return fIsLCDSupported; }
--    int lcdExtra() { return fLCDExtra; }
- 
-     // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
-     // Prior to this there was no way to get the coordinates out of the FT_Face.
-@@ -173,8 +163,6 @@
- 
- private:
-     FT_Library fLibrary;
--    bool fIsLCDSupported;
--    int fLCDExtra;
- 
-     // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
-     // The following platforms provide FreeType of at least 2.4.0.
-@@ -704,17 +692,6 @@
-         rec->fTextSize = SkIntToScalar(1 << 14);
-     }
- 
--    if (isLCD(*rec)) {
--        // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
--        SkAutoMutexAcquire ama(gFTMutex);
--        ref_ft_library();
--        if (!gFTLibrary->isLCDSupported()) {
--            // If the runtime Freetype library doesn't support LCD, disable it here.
--            rec->fMaskFormat = SkMask::kA8_Format;
--        }
--        unref_ft_library();
--    }
--
-     SkPaint::Hinting h = rec->getHinting();
-     if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
-         // collapse full->normal hinting if we're not doing LCD
-@@ -1115,11 +1092,11 @@
- void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
-     if (isLCD(fRec)) {
-         if (fLCDIsVert) {
--            glyph->fHeight += gFTLibrary->lcdExtra();
--            glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
-+            glyph->fHeight += 2;
-+            glyph->fTop -= 1;
-         } else {
--            glyph->fWidth += gFTLibrary->lcdExtra();
--            glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
-+            glyph->fWidth += 2;
-+            glyph->fLeft -= 1;
-         }
-     }
- }

Copied: chromium/repos/extra-x86_64/chromium-skia-harmony.patch (from rev 325128, chromium/trunk/chromium-skia-harmony.patch)
===================================================================
--- chromium-skia-harmony.patch	                        (rev 0)
+++ chromium-skia-harmony.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -0,0 +1,77 @@
+--- qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig	2017-10-10 17:42:06.956950985 +0200
++++ qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp	2017-10-10 17:46:05.824187787 +0200
+@@ -99,8 +99,6 @@
+     FreeTypeLibrary()
+         : fGetVarDesignCoordinates(nullptr)
+         , fLibrary(nullptr)
+-        , fIsLCDSupported(false)
+-        , fLCDExtra(0)
+     {
+         if (FT_New_Library(&gFTMemory, &fLibrary)) {
+             return;
+@@ -147,12 +145,7 @@
+         }
+ #endif
+ 
+-        // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
+-        // The default has changed over time, so this doesn't mean the same thing to all users.
+-        if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
+-            fIsLCDSupported = true;
+-            fLCDExtra = 2; //Using a filter adds one full pixel to each side.
+-        }
++        FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT);
+     }
+     ~FreeTypeLibrary() {
+         if (fLibrary) {
+@@ -161,8 +153,6 @@
+     }
+ 
+     FT_Library library() { return fLibrary; }
+-    bool isLCDSupported() { return fIsLCDSupported; }
+-    int lcdExtra() { return fLCDExtra; }
+ 
+     // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
+     // Prior to this there was no way to get the coordinates out of the FT_Face.
+@@ -173,8 +163,6 @@
+ 
+ private:
+     FT_Library fLibrary;
+-    bool fIsLCDSupported;
+-    int fLCDExtra;
+ 
+     // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
+     // The following platforms provide FreeType of at least 2.4.0.
+@@ -704,17 +692,6 @@
+         rec->fTextSize = SkIntToScalar(1 << 14);
+     }
+ 
+-    if (isLCD(*rec)) {
+-        // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
+-        SkAutoMutexAcquire ama(gFTMutex);
+-        ref_ft_library();
+-        if (!gFTLibrary->isLCDSupported()) {
+-            // If the runtime Freetype library doesn't support LCD, disable it here.
+-            rec->fMaskFormat = SkMask::kA8_Format;
+-        }
+-        unref_ft_library();
+-    }
+-
+     SkPaint::Hinting h = rec->getHinting();
+     if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
+         // collapse full->normal hinting if we're not doing LCD
+@@ -1115,11 +1092,11 @@
+ void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
+     if (isLCD(fRec)) {
+         if (fLCDIsVert) {
+-            glyph->fHeight += gFTLibrary->lcdExtra();
+-            glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
++            glyph->fHeight += 2;
++            glyph->fTop -= 1;
+         } else {
+-            glyph->fWidth += gFTLibrary->lcdExtra();
+-            glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
++            glyph->fWidth += 2;
++            glyph->fLeft -= 1;
+         }
+     }
+ }

Copied: chromium/repos/extra-x86_64/chromium-widevine-r2.patch (from rev 325128, chromium/trunk/chromium-widevine-r2.patch)
===================================================================
--- chromium-widevine-r2.patch	                        (rev 0)
+++ chromium-widevine-r2.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -0,0 +1,39 @@
+Minimal patch to get chromium to compile with widevine support.
+
+Exactly the same as -r1, but we now need to patch
+ninja to pretty please not terminate our build.
+
+caveat emptor: it's in no way clear that building chromium this
+way is safer, from a security perspective, than whatever Google
+Chrome does.
+
+Upstream appears to be cooking up a code-signing trust-chain
+which may protect users against malicious cdm blobs; I doubt
+we benefit from these using this kludge.  Ideally, someone
+would look into this more carefully than I have ... tbh as
+soon as I got my "stories" back, I pretty much lost interest :)
+
+-gmt
+
+--
+--- a/third_party/widevine/cdm/stub/widevine_cdm_version.h
++++ b/third_party/widevine/cdm/stub/widevine_cdm_version.h
+@@ -10,6 +10,7 @@
+
+ #include "third_party/widevine/cdm/widevine_cdm_common.h"
+
++#define WIDEVINE_CDM_VERSION_STRING "unknown"
+ #define WIDEVINE_CDM_AVAILABLE
+
+ #endif  // WIDEVINE_CDM_VERSION_H_
+--- a/third_party/widevine/cdm/BUILD.gn
++++ b/third_party/widevine/cdm/BUILD.gn
+@@ -11,7 +11,7 @@ import("//third_party/widevine/cdm/widev
+ # Internal Cast builds set enable_widevine=true to bring in Widevine support.
+ # TODO(xhwang): Support component updated CDM on other platforms and remove this
+ # assert.
+-assert(!enable_widevine || is_win || is_mac || is_chromecast,
++assert(!enable_widevine || is_win || is_mac || is_chromecast || is_linux,
+        "Component updated CDM only supported on Windows and Mac for now.")
+
+ widevine_arch = current_cpu

Deleted: chromium-widevine.patch
===================================================================
--- chromium-widevine.patch	2018-05-29 21:13:08 UTC (rev 325128)
+++ chromium-widevine.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -1,10 +0,0 @@
-diff -upr chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h
---- chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h	2016-01-14 01:05:17.000000000 +0200
-+++ chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h	2016-01-21 19:18:51.287978456 +0200
-@@ -12,4 +12,6 @@
- 
- #define WIDEVINE_CDM_AVAILABLE
- 
-+#define WIDEVINE_CDM_VERSION_STRING "@WIDEVINE_VERSION@"
-+
- #endif  // WIDEVINE_CDM_VERSION_H_

Deleted: chromium.install
===================================================================
--- chromium.install	2018-05-29 21:13:08 UTC (rev 325128)
+++ chromium.install	2018-05-29 21:13:17 UTC (rev 325129)
@@ -1,16 +0,0 @@
-post_upgrade() {
-  if (($(vercmp $2 42.0.2311.90-1) < 0)); then
-    echo ':: This Chromium package no longer supports custom flags passed via the'
-    echo '   /etc/chromium/default file (or any other files under /etc/chromium/).'
-    echo
-    echo '   The new /usr/bin/chromium launcher script will automatically detect'
-    echo '   Pepper Flash (if installed) and pass the correct flags to Chromium.'
-    echo
-    echo '   If you need to pass extra command-line arguments to Chromium, you'
-    echo '   can put them in a "chromium-flags.conf" file under $HOME/.config/'
-    echo '   (or $XDG_CONFIG_HOME). Arguments are split on whitespace and shell'
-    echo '   quoting rules apply but no further parsing is performed.'
-  fi
-}
-
-# vim:set ts=2 sw=2 et:

Copied: chromium/repos/extra-x86_64/chromium.install (from rev 325128, chromium/trunk/chromium.install)
===================================================================
--- chromium.install	                        (rev 0)
+++ chromium.install	2018-05-29 21:13:17 UTC (rev 325129)
@@ -0,0 +1,16 @@
+post_upgrade() {
+  if (($(vercmp $2 42.0.2311.90-1) < 0)); then
+    echo ':: This Chromium package no longer supports custom flags passed via the'
+    echo '   /etc/chromium/default file (or any other files under /etc/chromium/).'
+    echo
+    echo '   The new /usr/bin/chromium launcher script will automatically detect'
+    echo '   Pepper Flash (if installed) and pass the correct flags to Chromium.'
+    echo
+    echo '   If you need to pass extra command-line arguments to Chromium, you'
+    echo '   can put them in a "chromium-flags.conf" file under $HOME/.config/'
+    echo '   (or $XDG_CONFIG_HOME). Arguments are split on whitespace and shell'
+    echo '   quoting rules apply but no further parsing is performed.'
+  fi
+}
+
+# vim:set ts=2 sw=2 et:

Deleted: fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch
===================================================================
--- fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch	2018-05-29 21:13:08 UTC (rev 325128)
+++ fix-crash-in-is_cfi-true-builds-with-unbundled-ICU.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -1,53 +0,0 @@
-From f15e8b573ada0fcd643ae393484214b1c7c940f8 Mon Sep 17 00:00:00 2001
-From: Evangelos Foutras <evangelos at foutrelis.com>
-Date: Sat, 24 Mar 2018 00:04:33 +0000
-Subject: [PATCH] Fix crash in is_cfi=true builds with unbundled ICU
-
-Ensure ICU symbols have public visibility and are thus excluded from CFI
-checks and whole-program optimization. The former caused a startup crash
-and the latter has the potential to break virtual calls in weird ways.
-
-BUG=822820
-
-Change-Id: Ia809eefcb9e93b3c612f2381d394db83bbc67120
-Reviewed-on: https://chromium-review.googlesource.com/978008
-Reviewed-by: Peter Collingbourne <pcc at chromium.org>
-Reviewed-by: Thomas Anderson <thomasanderson at chromium.org>
-Commit-Queue: Thomas Anderson <thomasanderson at chromium.org>
-Cr-Commit-Position: refs/heads/master@{#545638}
----
- build/linux/unbundle/icu.gn | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
-index 5bdd91555df7..4450e409dba5 100644
---- a/build/linux/unbundle/icu.gn
-+++ b/build/linux/unbundle/icu.gn
-@@ -17,6 +17,24 @@ config("icu_config") {
-     "USING_SYSTEM_ICU=1",
-     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
-     "UCHAR_TYPE=uint16_t",
-+
-+    # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
-+    # on classes through the U_COMMON_API and U_I18N_API macros (among others).
-+    # When linking against the system ICU library, we want its symbols to have
-+    # public LTO visibility. This disables CFI checks for the ICU classes and
-+    # allows whole-program optimization to be applied to the rest of Chromium.
-+    #
-+    # Both U_COMMON_API and U_I18N_API macros would be defined to U_EXPORT only
-+    # when U_COMBINED_IMPLEMENTATION is defined (see unicode/utypes.h). Because
-+    # we override the default system UCHAR_TYPE (char16_t), it is not possible
-+    # to use U_COMBINED_IMPLEMENTATION at this moment, meaning the U_COMMON_API
-+    # and U_I18N_API macros are set to U_IMPORT which is an empty definition.
-+    #
-+    # Until building with UCHAR_TYPE=char16_t is supported, one way to apply
-+    # public visibility (and thus public LTO visibility) to all ICU classes is
-+    # to define U_IMPORT to have the same value as U_EXPORT. For more details,
-+    # please see: https://crbug.com/822820
-+    "U_IMPORT=U_EXPORT",
-   ]
- }
- 
--- 
-2.16.3
-

Deleted: fix-frame-buttons-rendering-too-large-when-using-OSX.patch
===================================================================
--- fix-frame-buttons-rendering-too-large-when-using-OSX.patch	2018-05-29 21:13:08 UTC (rev 325128)
+++ fix-frame-buttons-rendering-too-large-when-using-OSX.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -1,60 +0,0 @@
-From 7ef426c221d11b53b6de507b398e35e8d7b3cc94 Mon Sep 17 00:00:00 2001
-From: Tom Anderson <thomasanderson at chromium.org>
-Date: Wed, 4 Apr 2018 01:23:26 +0000
-Subject: [PATCH] Fix frame buttons rendering too large when using
- OSX-Arc-White GTK theme
-
-The check for GTK 3.20 was incorrect as the issue it was trying to fix
-was still occurring on GTK 3.20+ systems.  This CL adds the correct,
-but more complex, check.
-
-Verified on these configurations:
-{GTK 3.18, GTK 3.22} X
-{Breeze, Adwaita, OSX-Arc-White, Greybird} X
-{scale=1, scale=2} X
-{fullscreen, restored}
-
-BUG=821881
-R=thestig
-
-Change-Id: I05afa35c1452a46a1abf4c39191a13657bfd8e2c
-Reviewed-on: https://chromium-review.googlesource.com/990717
-Reviewed-by: Lei Zhang <thestig at chromium.org>
-Commit-Queue: Thomas Anderson <thomasanderson at chromium.org>
-Cr-Commit-Position: refs/heads/master@{#547921}
----
- chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc | 18 +++++++++++++++++-
- 1 file changed, 17 insertions(+), 1 deletion(-)
-
-diff --git a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc
-index 31a8087bca11..6a09faec5dd2 100644
---- a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc
-+++ b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc
-@@ -213,7 +213,23 @@ class NavButtonImageSource : public gfx::ImageSkiaSource {
-     // is not scaled for the (unexpected) smaller button size, and the button's
-     // edges appear cut off.  To fix this, manually set the background to scale
-     // to the button size when it would have clipped.
--    if (GtkVersionCheck(3, 20)) {
-+    //
-+    // GTK's "contain" is unlike CSS's "contain".  In CSS, the image would only
-+    // be downsized when it would have clipped.  In GTK, the image is always
-+    // scaled to fit the drawing region (preserving aspect ratio).  Only add
-+    // "contain" if clipping would occur.
-+    cairo_pattern_t* cr_pattern = nullptr;
-+    cairo_surface_t* cr_surface = nullptr;
-+    gtk_style_context_get(button_context, button_state,
-+                          GTK_STYLE_PROPERTY_BACKGROUND_IMAGE, &cr_pattern,
-+                          nullptr);
-+    if (cr_pattern &&
-+        cairo_pattern_get_surface(cr_pattern, &cr_surface) ==
-+            CAIRO_STATUS_SUCCESS &&
-+        cr_surface &&
-+        cairo_surface_get_type(cr_surface) == CAIRO_SURFACE_TYPE_IMAGE &&
-+        (cairo_image_surface_get_width(cr_surface) > button_size_.width() ||
-+         cairo_image_surface_get_height(cr_surface) > button_size_.height())) {
-       ApplyCssToContext(button_context,
-                         ".titlebutton { background-size: contain; }");
-     }
--- 
-2.16.2
-

Copied: chromium/repos/extra-x86_64/remove-dependency-on-ffmpeg-internals-for-start-time.patch (from rev 325128, chromium/trunk/remove-dependency-on-ffmpeg-internals-for-start-time.patch)
===================================================================
--- remove-dependency-on-ffmpeg-internals-for-start-time.patch	                        (rev 0)
+++ remove-dependency-on-ffmpeg-internals-for-start-time.patch	2018-05-29 21:13:17 UTC (rev 325129)
@@ -0,0 +1,260 @@
+From f9535bd6d61d7e0b2cb452e6976a914d4ee62a2b Mon Sep 17 00:00:00 2001
+From: Dale Curtis <dalecurtis at chromium.org>
+Date: Thu, 17 May 2018 23:44:41 +0000
+Subject: [PATCH] Remove dependency on ffmpeg internals for start time
+ calculations.
+
+Some theora clips still have issues, but using first_dts where
+we know it's the same as the first pts resolves the lingering
+issues. It also looks like we don't need to use pts_buffer now.
+
+This does the following small fixes:
+- MEDIA_LOG(DEBUG) -> MEDIA_LOG(ERROR) for negative ts error.
+- Enables previous disabled test in more limited state.
+- Adds kNoFFmpegTimestamp so static_cast<int64_t>(AV_NOPTS_VALUE)
+is no longer necessary everywhere. A followup patch set will use
+this is more places.
+- Removes pts_buffer and packet_buffer inspection.
+
+BUG=731766
+TEST=all tests pass.
+
+Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
+Change-Id: I5aadf67a3b5ea2d2a8dd19bbddd7b107208094c5
+Reviewed-on: https://chromium-review.googlesource.com/1064538
+Commit-Queue: Dale Curtis <dalecurtis at chromium.org>
+Reviewed-by: Frank Liberato <liberato at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#559737}
+---
+ media/ffmpeg/ffmpeg_common.h             |  5 +-
+ media/filters/ffmpeg_demuxer.cc          | 88 +++++++-----------------
+ media/filters/ffmpeg_demuxer_unittest.cc | 24 +++----
+ 3 files changed, 37 insertions(+), 80 deletions(-)
+
+diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
+index ec33068fb84f..f641d6bcf92e 100644
+--- a/media/ffmpeg/ffmpeg_common.h
++++ b/media/ffmpeg/ffmpeg_common.h
+@@ -28,9 +28,6 @@ extern "C" {
+ MSVC_PUSH_DISABLE_WARNING(4244);
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+-#if !BUILDFLAG(USE_SYSTEM_FFMPEG)
+-#include <libavformat/internal.h>
+-#endif  // !BUILDFLAG(USE_SYSTEM_FFMPEG)
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
+ #include <libavutil/imgutils.h>
+@@ -42,6 +39,8 @@ MSVC_POP_WARNING();
+ 
+ namespace media {
+ 
++constexpr int64_t kNoFFmpegTimestamp = static_cast<int64_t>(AV_NOPTS_VALUE);
++
+ class AudioDecoderConfig;
+ class EncryptionScheme;
+ class VideoDecoderConfig;
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index 49ca01c4dc0b..7402ce16ab5e 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -85,29 +85,26 @@ static base::TimeDelta FramesToTimeDelta(int frames, double sample_rate) {
+       frames * base::Time::kMicrosecondsPerSecond / sample_rate);
+ }
+ 
+-static base::TimeDelta ExtractStartTime(AVStream* stream,
+-                                        base::TimeDelta start_time_estimate) {
+-  DCHECK(start_time_estimate != kNoTimestamp);
+-  if (stream->start_time == static_cast<int64_t>(AV_NOPTS_VALUE)) {
+-    return start_time_estimate == kInfiniteDuration ? base::TimeDelta()
+-                                                    : start_time_estimate;
++static base::TimeDelta ExtractStartTime(AVStream* stream) {
++  // The default start time is zero.
++  base::TimeDelta start_time;
++
++  // First try to use  the |start_time| value as is.
++  if (stream->start_time != kNoFFmpegTimestamp)
++    start_time = ConvertFromTimeBase(stream->time_base, stream->start_time);
++
++  // Next try to use the first DTS value, for codecs where we know PTS == DTS
++  // (excludes all H26x codecs). The start time must be returned in PTS.
++  if (stream->first_dts != kNoFFmpegTimestamp &&
++      stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
++      stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
++      stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
++    const base::TimeDelta first_pts =
++        ConvertFromTimeBase(stream->time_base, stream->first_dts);
++    if (first_pts < start_time)
++      start_time = first_pts;
+   }
+ 
+-  // First try the lower of the estimate and the |start_time| value.
+-  base::TimeDelta start_time =
+-      std::min(ConvertFromTimeBase(stream->time_base, stream->start_time),
+-               start_time_estimate);
+-
+-  // Next see if the first buffered pts value is usable.
+-  if (stream->pts_buffer[0] != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+-    const base::TimeDelta buffered_pts =
+-        ConvertFromTimeBase(stream->time_base, stream->pts_buffer[0]);
+-    if (buffered_pts < start_time)
+-      start_time = buffered_pts;
+-  }
+-
+-  // NOTE: Do not use AVStream->first_dts since |start_time| should be a
+-  // presentation timestamp.
+   return start_time;
+ }
+ 
+@@ -513,7 +510,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+     buffer->set_duration(kNoTimestamp);
+   }
+ 
+-  // Note: If pts is AV_NOPTS_VALUE, stream_timestamp will be kNoTimestamp.
++  // Note: If pts is kNoFFmpegTimestamp, stream_timestamp will be kNoTimestamp.
+   const base::TimeDelta stream_timestamp =
+       ConvertStreamTimestamp(stream_->time_base, packet->pts);
+ 
+@@ -556,8 +553,8 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+   // code paths below; otherwise they should be treated as a parse error.
+   if ((!fixup_chained_ogg_ || last_packet_timestamp_ == kNoTimestamp) &&
+       buffer->timestamp() < base::TimeDelta()) {
+-    MEDIA_LOG(DEBUG, media_log_)
+-        << "FFmpegDemuxer: unfixable negative timestamp";
++    MEDIA_LOG(ERROR, media_log_)
++        << "FFmpegDemuxer: unfixable negative timestamp.";
+     demuxer_->NotifyDemuxerError(DEMUXER_ERROR_COULD_NOT_PARSE);
+     return;
+   }
+@@ -863,7 +860,7 @@ std::string FFmpegDemuxerStream::GetMetadata(const char* key) const {
+ base::TimeDelta FFmpegDemuxerStream::ConvertStreamTimestamp(
+     const AVRational& time_base,
+     int64_t timestamp) {
+-  if (timestamp == static_cast<int64_t>(AV_NOPTS_VALUE))
++  if (timestamp == kNoFFmpegTimestamp)
+     return kNoTimestamp;
+ 
+   return ConvertFromTimeBase(time_base, timestamp);
+@@ -1256,42 +1253,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
+   AVFormatContext* format_context = glue_->format_context();
+   streams_.resize(format_context->nb_streams);
+ 
+-  // Estimate the start time for each stream by looking through the packets
+-  // buffered during avformat_find_stream_info().  These values will be
+-  // considered later when determining the actual stream start time.
+-  //
+-  // These packets haven't been completely processed yet, so only look through
+-  // these values if the AVFormatContext has a valid start time.
+-  //
+-  // If no estimate is found, the stream entry will be kInfiniteDuration.
+-  std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
+-                                                    kInfiniteDuration);
+-#if !BUILDFLAG(USE_SYSTEM_FFMPEG)
+-  const AVFormatInternal* internal = format_context->internal;
+-  if (internal && internal->packet_buffer &&
+-      format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+-    struct AVPacketList* packet_buffer = internal->packet_buffer;
+-    while (packet_buffer != internal->packet_buffer_end) {
+-      DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index),
+-                start_time_estimates.size());
+-      const AVStream* stream =
+-          format_context->streams[packet_buffer->pkt.stream_index];
+-      if (packet_buffer->pkt.pts != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+-        const base::TimeDelta packet_pts =
+-            ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts);
+-        // We ignore kNoTimestamp here since -int64_t::min() is possible; see
+-        // https://crbug.com/700501. Technically this is a valid value, but in
+-        // practice shouldn't occur, so just ignore it when estimating.
+-        if (packet_pts != kNoTimestamp && packet_pts != kInfiniteDuration &&
+-            packet_pts < start_time_estimates[stream->index]) {
+-          start_time_estimates[stream->index] = packet_pts;
+-        }
+-      }
+-      packet_buffer = packet_buffer->next;
+-    }
+-  }
+-#endif  // !BUILDFLAG(USE_SYSTEM_FFMPEG)
+-
+   std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
+ 
+   DCHECK(track_id_to_demux_stream_map_.empty());
+@@ -1440,8 +1401,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
+ 
+     max_duration = std::max(max_duration, streams_[i]->duration());
+ 
+-    base::TimeDelta start_time =
+-        ExtractStartTime(stream, start_time_estimates[i]);
++    base::TimeDelta start_time = ExtractStartTime(stream);
+ 
+     // Note: This value is used for seeking, so we must take the true value and
+     // not the one possibly clamped to zero below.
+@@ -1479,7 +1439,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
+   if (text_enabled_)
+     AddTextStreams();
+ 
+-  if (format_context->duration != static_cast<int64_t>(AV_NOPTS_VALUE)) {
++  if (format_context->duration != kNoFFmpegTimestamp) {
+     // If there is a duration value in the container use that to find the
+     // maximum between it and the duration from A/V streams.
+     const AVRational av_time_base = {1, AV_TIME_BASE};
+diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
+index 71dbed07b376..b09816a3ba3a 100644
+--- a/media/filters/ffmpeg_demuxer_unittest.cc
++++ b/media/filters/ffmpeg_demuxer_unittest.cc
+@@ -696,12 +696,9 @@ TEST_F(FFmpegDemuxerTest, Read_InvalidNegativeTimestamp) {
+   ReadUntilEndOfStream(GetStream(DemuxerStream::AUDIO));
+ }
+ 
+-// TODO(dalecurtis): Test is disabled since FFmpeg does not currently guarantee
+-// the order of demuxed packets in OGG containers.  Re-enable and fix key frame
+-// expectations once we decide to either workaround it or attempt a fix
+-// upstream.  See http://crbug.com/387996.
+-TEST_F(FFmpegDemuxerTest,
+-       DISABLED_Read_AudioNegativeStartTimeAndOggDiscard_Bear) {
++// Android has no Theora support, so these tests doesn't work.
++#if !defined(OS_ANDROID)
++TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard_Bear) {
+   // Many ogg files have negative starting timestamps, so ensure demuxing and
+   // seeking work correctly with a negative start time.
+   CreateDemuxer("bear.ogv");
+@@ -711,8 +708,12 @@ TEST_F(FFmpegDemuxerTest,
+   DemuxerStream* video = GetStream(DemuxerStream::VIDEO);
+   DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
+ 
+-  // Run the test twice with a seek in between.
+-  for (int i = 0; i < 2; ++i) {
++  // Run the test once (should be twice..., see note) with a seek in between.
++  //
++  // TODO(dalecurtis): We only run the test once since FFmpeg does not currently
++  // guarantee the order of demuxed packets in OGG containers. See
++  // http://crbug.com/387996.
++  for (int i = 0; i < 1; ++i) {
+     audio->Read(
+         NewReadCBWithCheckedDiscard(FROM_HERE, 40, 0, kInfiniteDuration, true));
+     base::RunLoop().Run();
+@@ -731,10 +732,10 @@ TEST_F(FFmpegDemuxerTest,
+     video->Read(NewReadCB(FROM_HERE, 5751, 0, true));
+     base::RunLoop().Run();
+ 
+-    video->Read(NewReadCB(FROM_HERE, 846, 33367, true));
++    video->Read(NewReadCB(FROM_HERE, 846, 33367, false));
+     base::RunLoop().Run();
+ 
+-    video->Read(NewReadCB(FROM_HERE, 1255, 66733, true));
++    video->Read(NewReadCB(FROM_HERE, 1255, 66733, false));
+     base::RunLoop().Run();
+ 
+     // Seek back to the beginning and repeat the test.
+@@ -747,9 +748,6 @@ TEST_F(FFmpegDemuxerTest,
+ // Same test above, but using sync2.ogv which has video stream muxed before the
+ // audio stream, so seeking based only on start time will fail since ffmpeg is
+ // essentially just seeking based on file position.
+-//
+-// Android has no Theora support, so this test doesn't work.
+-#if !defined(OS_ANDROID)
+ TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard_Sync) {
+   // Many ogg files have negative starting timestamps, so ensure demuxing and
+   // seeking work correctly with a negative start time.
+-- 
+2.17.0
+



More information about the arch-commits mailing list