extra/chromium to 59.0.3071.86-1

This commit is contained in:
Kevin Mihelich 2017-06-06 23:56:10 +00:00
parent 8ac9d2ec60
commit d6fa2e6d58
8 changed files with 368 additions and 67 deletions

View file

@ -0,0 +1,118 @@
From 27bab2297187099229a1e4304d8feb866c8da55a Mon Sep 17 00:00:00 2001
From: "dongseong.hwang" <dongseong.hwang@intel.com>
Date: Tue, 18 Apr 2017 16:44:55 -0700
Subject: [PATCH] ClientNativePixmapFactoryDmabuf uses ioctl, instead of
drmIoctl.
DMA_BUF_SYNC ioctl is not drmIoctl, because it uses dma-buf fd, instead of drm
device fd.
In addition, remove LOCAL_ prefix to fix build failure >= kernel 4.6
Actually, ChromeOS doesn't need this local DMA_BUF_SYNC definition as all
verion of kernel for cros has dma-buf.h header.
https://chromium-review.googlesource.com/c/459544/
However, there is not any way to distinguish real ChromeOS build and
current_os="chromeos" build, so remain the local definition to ChromeOS as
well.
BUG=584248
R=reveman@chromium.org
Review-Url: https://codereview.chromium.org/2805503003
Cr-Commit-Position: refs/heads/master@{#465425}
---
ui/gfx/linux/client_native_pixmap_dmabuf.cc | 49 +++++++++++++----------------
1 file changed, 21 insertions(+), 28 deletions(-)
diff --git a/ui/gfx/linux/client_native_pixmap_dmabuf.cc b/ui/gfx/linux/client_native_pixmap_dmabuf.cc
index d656c338f0a6..1bb441dc25ce 100644
--- a/ui/gfx/linux/client_native_pixmap_dmabuf.cc
+++ b/ui/gfx/linux/client_native_pixmap_dmabuf.cc
@@ -7,36 +7,35 @@
#include <fcntl.h>
#include <linux/version.h>
#include <stddef.h>
+#include <sys/ioctl.h>
#include <sys/mman.h>
#include <xf86drm.h>
#include "base/debug/crash_logging.h"
#include "base/memory/ptr_util.h"
+#include "base/posix/eintr_wrapper.h"
#include "base/process/memory.h"
#include "base/process/process_metrics.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#include <linux/dma-buf.h>
+#else
#include <linux/types.h>
-struct local_dma_buf_sync {
+struct dma_buf_sync {
__u64 flags;
};
-#define LOCAL_DMA_BUF_SYNC_READ (1 << 0)
-#define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0)
-#define LOCAL_DMA_BUF_SYNC_RW \
- (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE)
-#define LOCAL_DMA_BUF_SYNC_START (0 << 2)
-#define LOCAL_DMA_BUF_SYNC_END (1 << 2)
+#define DMA_BUF_SYNC_READ (1 << 0)
+#define DMA_BUF_SYNC_WRITE (2 << 0)
+#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
+#define DMA_BUF_SYNC_START (0 << 2)
+#define DMA_BUF_SYNC_END (1 << 2)
-#define LOCAL_DMA_BUF_BASE 'b'
-#define LOCAL_DMA_BUF_IOCTL_SYNC \
- _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync)
-
-#else
-#include <linux/dma-buf.h>
+#define DMA_BUF_BASE 'b'
+#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
#endif
namespace gfx {
@@ -44,25 +43,19 @@ namespace gfx {
namespace {
void PrimeSyncStart(int dmabuf_fd) {
- struct local_dma_buf_sync sync_start = {0};
+ struct dma_buf_sync sync_start = {0};
- sync_start.flags = LOCAL_DMA_BUF_SYNC_START | LOCAL_DMA_BUF_SYNC_RW;
-#if DCHECK_IS_ON()
- int rv =
-#endif
- drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_start);
- DPLOG_IF(ERROR, rv) << "Failed DMA_BUF_SYNC_START";
+ sync_start.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
+ int rv = HANDLE_EINTR(ioctl(dmabuf_fd, DMA_BUF_IOCTL_SYNC, &sync_start));
+ PLOG_IF(ERROR, rv) << "Failed DMA_BUF_SYNC_START";
}
void PrimeSyncEnd(int dmabuf_fd) {
- struct local_dma_buf_sync sync_end = {0};
+ struct dma_buf_sync sync_end = {0};
- sync_end.flags = LOCAL_DMA_BUF_SYNC_END | LOCAL_DMA_BUF_SYNC_RW;
-#if DCHECK_IS_ON()
- int rv =
-#endif
- drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end);
- DPLOG_IF(ERROR, rv) << "Failed DMA_BUF_SYNC_END";
+ sync_end.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
+ int rv = HANDLE_EINTR(ioctl(dmabuf_fd, DMA_BUF_IOCTL_SYNC, &sync_end));
+ PLOG_IF(ERROR, rv) << "Failed DMA_BUF_SYNC_END";
}
} // namespace
--
2.13.0

View file

@ -0,0 +1,35 @@
From 63901da067e069e298595618e01c4758c7896ff5 Mon Sep 17 00:00:00 2001
From: thomasanderson <thomasanderson@google.com>
Date: Fri, 28 Apr 2017 11:56:12 -0700
Subject: [PATCH] Fix kernel version condition for including dma-buf.h
Kernel 4.11 merges the commit that added linux/dma-buf.h
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef96152e6a36e0510387cb174178b7982c1ae879
This CL increases the required kernel to include this file to 4.11.
BUG=707604
R=danakj@chromium.org
Review-Url: https://codereview.chromium.org/2851803002
Cr-Commit-Position: refs/heads/master@{#468078}
---
ui/gfx/linux/client_native_pixmap_dmabuf.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/gfx/linux/client_native_pixmap_dmabuf.cc b/ui/gfx/linux/client_native_pixmap_dmabuf.cc
index 31ff4f4395b6..4927daf3a61d 100644
--- a/ui/gfx/linux/client_native_pixmap_dmabuf.cc
+++ b/ui/gfx/linux/client_native_pixmap_dmabuf.cc
@@ -19,7 +19,7 @@
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/dma-buf.h>
#else
#include <linux/types.h>
--
2.13.0

View file

@ -10,6 +10,7 @@
buildarch=12
highmem=1
noautobuild=1
# 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
@ -18,6 +19,7 @@ declare -rgA _system_libs=(
[flac]=flac
[harfbuzz-ng]=harfbuzz-icu
#[icu]=icu # Enable again when upstream supports ICU 59
[libdrm]=
[libjpeg]=libjpeg
[libpng]=libpng
#[libvpx]=libvpx # https://bugs.gentoo.org/show_bug.cgi?id=611394
@ -31,14 +33,14 @@ declare -rgA _system_libs=(
)
pkgname=chromium
pkgver=58.0.3029.110
pkgver=59.0.3071.86
pkgrel=1
_launcher_ver=3
pkgdesc="A web browser built for speed, simplicity, and security"
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://www.chromium.org/Home"
license=('BSD')
depends=('gtk2' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libexif' 'libgcrypt'
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
'ttf-font' 'systemd' 'dbus' 'libpulse' 'perl' 'perl-file-basedir'
'pciutils' 'desktop-file-utils' 'hicolor-icon-theme')
depends+=(${_system_libs[@]})
@ -50,8 +52,11 @@ 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.desktop
chromium-system-ffmpeg-r4.patch
chromium-gn-bootstrap-r2.patch
chromium-system-ffmpeg-r6.patch
0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
chromium-blink-gcc7.patch
chromium-v8-gcc7.patch
chromium-widevine.patch
0001-ARM-toolchain-fixes.patch)
sha256sums=('f24cef3dd2acf9dd5ccdeeca47fea42d1c1ddff32b7375dc9e0cd35a4e8d78ff'
@ -85,8 +90,18 @@ prepare() {
sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch |
patch -Np1
# https://bugs.chromium.org/p/chromium/issues/detail?id=707604
patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347
patch -Np1 -i ../chromium-blink-gcc7.patch
# https://bugs.chromium.org/p/chromium/issues/detail?id=614289
patch -Np1 -i ../chromium-v8-gcc7.patch
# Fixes from Gentoo
patch -Np1 -i ../chromium-system-ffmpeg-r4.patch
patch -Np1 -i ../chromium-system-ffmpeg-r6.patch
patch -Np1 -i ../chromium-gn-bootstrap-r2.patch
@ -120,7 +135,7 @@ prepare() {
}
build() {
make -C "$srcdir/chromium-launcher-$_launcher_ver" PREFIX=/usr
make -C "$srcdir/chromium-launcher-$_launcher_ver" PREFIX=/usr GTK=3
cd "$srcdir/$pkgname-$pkgver"
@ -140,6 +155,7 @@ build() {
'proprietary_codecs=true'
'link_pulseaudio=true'
'linux_use_bundled_binutils=false'
'use_gtk3=true'
'use_gconf=false'
'use_gnome_keyring=false'
'use_gold=false'
@ -147,6 +163,7 @@ build() {
'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}\""

View file

@ -0,0 +1,76 @@
--- chromium-59.0.3071.86/third_party/WebKit/Source/platform/wtf/LinkedHashSet.h.orig 2017-06-06 15:05:38.145247996 +0300
+++ chromium-59.0.3071.86/third_party/WebKit/Source/platform/wtf/LinkedHashSet.h 2017-06-06 15:06:13.866246667 +0300
@@ -685,6 +685,31 @@ inline LinkedHashSet<T, U, V, W>& Linked
return *this;
}
+inline void SwapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) {
+ DCHECK(a.prev_);
+ DCHECK(a.next_);
+ DCHECK(b.prev_);
+ DCHECK(b.next_);
+ swap(a.prev_, b.prev_);
+ swap(a.next_, b.next_);
+ if (b.next_ == &a) {
+ DCHECK_EQ(b.prev_, &a);
+ b.next_ = &b;
+ b.prev_ = &b;
+ } else {
+ b.next_->prev_ = &b;
+ b.prev_->next_ = &b;
+ }
+ if (a.next_ == &b) {
+ DCHECK_EQ(a.prev_, &b);
+ a.next_ = &a;
+ a.prev_ = &a;
+ } else {
+ a.next_->prev_ = &a;
+ a.prev_->next_ = &a;
+ }
+}
+
template <typename T, typename U, typename V, typename W>
inline void LinkedHashSet<T, U, V, W>::Swap(LinkedHashSet& other) {
impl_.Swap(other.impl_);
@@ -877,31 +902,6 @@ inline void LinkedHashSet<T, U, V, W>::e
erase(Find(value));
}
-inline void SwapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) {
- DCHECK(a.prev_);
- DCHECK(a.next_);
- DCHECK(b.prev_);
- DCHECK(b.next_);
- swap(a.prev_, b.prev_);
- swap(a.next_, b.next_);
- if (b.next_ == &a) {
- DCHECK_EQ(b.prev_, &a);
- b.next_ = &b;
- b.prev_ = &b;
- } else {
- b.next_->prev_ = &b;
- b.prev_->next_ = &b;
- }
- if (a.next_ == &b) {
- DCHECK_EQ(a.prev_, &b);
- a.next_ = &a;
- a.prev_ = &a;
- } else {
- a.next_->prev_ = &a;
- a.prev_->next_ = &a;
- }
-}
-
inline void swap(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) {
DCHECK_NE(a.next_, &a);
DCHECK_NE(b.next_, &b);
--- chromium-59.0.3071.86/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h.orig 2017-06-06 16:16:43.657661313 +0300
+++ chromium-59.0.3071.86/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h 2017-06-06 16:16:50.911198032 +0300
@@ -5,6 +5,7 @@
#include "platform/PlatformExport.h"
#include "platform/wtf/ThreadSpecific.h"
+#include <functional>
#include <memory>
namespace gpu {

View file

@ -1,13 +0,0 @@
Index: tools/gn/bootstrap/bootstrap.py
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
index 38cfb117d29c3895291379f00d8dc8c8b0727474..679170e610f8292bcbeb76508fd247d322a69c79 100755
--- a/tools/gn/bootstrap/bootstrap.py
+++ b/tools/gn/bootstrap/bootstrap.py
@@ -385,6 +385,7 @@ def write_gn_ninja(path, root_gen_dir, options):
'base/base_switches.cc',
'base/build_time.cc',
'base/callback_internal.cc',
+ 'base/callback_helpers.cc',
'base/command_line.cc',
'base/debug/activity_tracker.cc',
'base/debug/alias.cc',

View file

@ -1,48 +0,0 @@
--- a/media/ffmpeg/ffmpeg_common.h.orig 2016-09-09 13:16:07.757294768 +0000
+++ b/media/ffmpeg/ffmpeg_common.h 2016-09-09 13:16:41.705989273 +0000
@@ -22,10 +22,6 @@
// Include FFmpeg header files.
extern "C" {
-// Disable deprecated features which result in spammy compile warnings. This
-// list of defines must mirror those in the 'defines' section of FFmpeg's
-// BUILD.gn file or the headers below will generate different structures!
-#define FF_API_CONVERGENCE_DURATION 0
// Upstream libavcodec/utils.c still uses the deprecated
// av_dup_packet(), causing deprecation warnings.
// The normal fix for such things is to disable the feature as below,
@@ -35,7 +35,6 @@
MSVC_PUSH_DISABLE_WARNING(4244);
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
-#include <libavformat/internal.h>
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
--- a/media/filters/ffmpeg_demuxer.cc.orig 2016-09-09 14:21:40.185828912 +0000
+++ b/media/filters/ffmpeg_demuxer.cc 2016-09-09 14:21:52.894089352 +0000
@@ -1185,24 +1185,6 @@
// If no estimate is found, the stream entry will be kInfiniteDuration.
std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
kInfiniteDuration);
- 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);
- if (packet_pts < start_time_estimates[stream->index])
- start_time_estimates[stream->index] = packet_pts;
- }
- packet_buffer = packet_buffer->next;
- }
- }
std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());

View file

@ -0,0 +1,43 @@
--- a/media/ffmpeg/ffmpeg_common.h.orig 2017-04-07 18:17:22.623538889 +0000
+++ b/media/ffmpeg/ffmpeg_common.h 2017-04-07 18:18:16.780656283 +0000
@@ -23,10 +23,12 @@
// Include FFmpeg header files.
extern "C" {
+#if !defined(USE_SYSTEM_FFMPEG)
// Disable deprecated features which result in spammy compile warnings. This
// list of defines must mirror those in the 'defines' section of FFmpeg's
// BUILD.gn file or the headers below will generate different structures!
#define FF_API_CONVERGENCE_DURATION 0
+#endif // !defined(USE_SYSTEM_FFMPEG)
// Upstream libavcodec/utils.c still uses the deprecated
// av_dup_packet(), causing deprecation warnings.
// The normal fix for such things is to disable the feature as below,
@@ -40,7 +42,9 @@
MSVC_PUSH_DISABLE_WARNING(4244);
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
+#if !defined(USE_SYSTEM_FFMPEG)
#include <libavformat/internal.h>
+#endif // !defined(USE_SYSTEM_FFMPEG)
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
--- a/media/filters/ffmpeg_demuxer.cc.orig 2017-04-07 18:15:14.776901183 +0000
+++ b/media/filters/ffmpeg_demuxer.cc 2017-04-07 18:15:54.813727201 +0000
@@ -1223,6 +1223,7 @@
// If no estimate is found, the stream entry will be kInfiniteDuration.
std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
kInfiniteDuration);
+#if !defined(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)) {
@@ -1246,6 +1247,7 @@
packet_buffer = packet_buffer->next;
}
}
+#endif // !defined(USE_SYSTEM_FFMPEG)
std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());

View file

@ -0,0 +1,73 @@
diff -upr chromium-59.0.3071.86.orig/v8/src/objects/hash-table.h chromium-59.0.3071.86/v8/src/objects/hash-table.h
--- chromium-59.0.3071.86.orig/v8/src/objects/hash-table.h 2017-06-05 22:04:29.000000000 +0300
+++ chromium-59.0.3071.86/v8/src/objects/hash-table.h 2017-06-06 14:35:41.558245559 +0300
@@ -135,22 +135,10 @@ class HashTable : public HashTableBase {
public:
typedef Shape ShapeT;
- // Wrapper methods
- inline uint32_t Hash(Key key) {
- if (Shape::UsesSeed) {
- return Shape::SeededHash(key, GetHeap()->HashSeed());
- } else {
- return Shape::Hash(key);
- }
- }
-
- inline uint32_t HashForObject(Key key, Object* object) {
- if (Shape::UsesSeed) {
- return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
- } else {
- return Shape::HashForObject(key, object);
- }
- }
+ // Wrapper methods. Defined in src/objects-inl.h
+ // to break a cycle with src/heap/heap.h.
+ inline uint32_t Hash(Key key);
+ inline uint32_t HashForObject(Key key, Object* object);
// Returns a new HashTable object.
MUST_USE_RESULT static Handle<Derived> New(
diff -upr chromium-59.0.3071.86.orig/v8/src/objects-body-descriptors.h chromium-59.0.3071.86/v8/src/objects-body-descriptors.h
--- chromium-59.0.3071.86.orig/v8/src/objects-body-descriptors.h 2017-06-05 22:04:29.000000000 +0300
+++ chromium-59.0.3071.86/v8/src/objects-body-descriptors.h 2017-06-06 14:35:41.554912132 +0300
@@ -99,7 +99,7 @@ class FixedBodyDescriptor final : public
template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
- IterateBody(obj);
+ IterateBody<StaticVisitor>(obj);
}
};
diff -upr chromium-59.0.3071.86.orig/v8/src/objects-inl.h chromium-59.0.3071.86/v8/src/objects-inl.h
--- chromium-59.0.3071.86.orig/v8/src/objects-inl.h 2017-06-05 22:04:29.000000000 +0300
+++ chromium-59.0.3071.86/v8/src/objects-inl.h 2017-06-06 14:35:41.558245559 +0300
@@ -46,6 +46,27 @@
namespace v8 {
namespace internal {
+template <typename Derived, typename Shape, typename Key>
+uint32_t HashTable<Derived, Shape, Key>::Hash(Key key) {
+ if (Shape::UsesSeed) {
+ return Shape::SeededHash(key, GetHeap()->HashSeed());
+ } else {
+ return Shape::Hash(key);
+ }
+}
+
+
+template <typename Derived, typename Shape, typename Key>
+uint32_t HashTable<Derived, Shape, Key>::HashForObject(Key key,
+ Object* object) {
+ if (Shape::UsesSeed) {
+ return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
+ } else {
+ return Shape::HashForObject(key, object);
+ }
+}
+
+
PropertyDetails::PropertyDetails(Smi* smi) {
value_ = smi->value();
}