Hello community,

here is the log from the commit of package chromium for openSUSE:Factory 
checked in at 2016-01-01 19:48:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/chromium (Old)
 and      /work/SRC/openSUSE:Factory/.chromium.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "chromium"

Changes:
--------
--- /work/SRC/openSUSE:Factory/chromium/chromium.changes        2015-12-21 
12:06:27.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.chromium.new/chromium.changes   2016-01-01 
19:50:31.000000000 +0100
@@ -1,0 +2,12 @@
+Mon Dec 28 18:14:40 UTC 2015 - [email protected]
+
+- Enable SSE2 on x86_64
+
+-------------------------------------------------------------------
+Sun Dec 27 21:44:50 UTC 2015 - [email protected]
+
+- Fix crash when trying to enable chromecast extension
+  * Add patch: fix_network_api_crash.patch
+    Fix https://code.google.com/p/chromium/issues/detail?id=572539
+
+-------------------------------------------------------------------
@@ -6,0 +19,6 @@
+
+-------------------------------------------------------------------
+Mon Dec 14 04:31:08 UTC 2015 - [email protected]
+
+- Enable VA-API hardware acceleration in Linux.
+  * chromium-enable-vaapi.patch

New:
----
  chromium-enable-vaapi.patch
  fix_network_api_crash.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ chromium.spec ++++++
--- /var/tmp/diff_new_pack.C9DVxx/_old  2016-01-01 19:50:55.000000000 +0100
+++ /var/tmp/diff_new_pack.C9DVxx/_new  2016-01-01 19:50:55.000000000 +0100
@@ -18,6 +18,7 @@
 
 %define chromium_no_dlopen 1
 %define chromium_system_libs 1
+%bcond_without libva
 
 Name:           chromium
 Version:        47.0.2526.106
@@ -69,6 +70,10 @@
 Patch11:        chromium-46.0.2490.71-fix-missing-i18n_process_css_test.patch
 # PATCH-FIX-OPENSUSE fix_building_widevinecdm_with_chromium.patch - Enable 
WideVine plugin
 Patch12:        fix_building_widevinecdm_with_chromium.patch
+# PATCH-FIX-OPENSUSE chromium-enable-vaapi.patch - Enable VA-API hardware 
acceleration in Linux
+Patch13:        chromium-enable-vaapi.patch
+# PATCH-FIX-OPENSUSE fix_network_api_crash.patch - Fix crash in network API, 
e.g. when using chromecast extension
+Patch14:        fix_network_api_crash.patch
 
 # archlinux arm enhancement patches
 Patch100:       arm-webrtc-fix.patch
@@ -190,6 +195,9 @@
 BuildRequires:  libfaac-devel >= 1.28
 BuildRequires:  libmp3lame-devel
 BuildRequires:  libopencore-amr-devel
+%if %{with libva}
+BuildRequires:  libva-devel
+%endif
 BuildRequires:  libx264-devel
 BuildRequires:  libxvidcore-devel
 %endif
@@ -267,6 +275,9 @@
 Provides:       ffmpegsumo = %{version}
 Conflicts:      otherproviders(ffmpegsumo)
 Requires:       %{name} = %{version}
+%if %{with libva}
+Recommends:     Mesa-libva
+%endif
 
 %description ffmpeg
 FFMPEG library built from the chromium sources.
@@ -289,6 +300,10 @@
 %endif
 %patch11 -p1
 %patch12 -p1
+%if %{with libva}
+%patch13 -p1
+%endif
+%patch14 -p0
 
 #Upstream fixes
 
@@ -314,7 +329,6 @@
                      -Dremove_webcore_debug_symbols=1
                      -Dlogging_like_official_build=1
                      -Dlinux_fpic=1 
-                     -Ddisable_sse2=1
                      -Dcomponent=shared_library
                      -Dtoolkit_uses_gtk=0
                      -Denable_pepper_cdms=1 
@@ -329,10 +343,12 @@
 myconf+=" -Ddisable_nacl=1"
 
 %ifarch x86_64
-myconf+=" -Dtarget_arch=x64"
+myconf+=" -Dtarget_arch=x64
+          -Ddisable_sse2=0"
 %else
 myconf+=" -Dbinutils_dir=third_party/binutils/Linux_ia32/Release/bin
-         -Ddisable_fatal_linker_warnings=1"
+         -Ddisable_fatal_linker_warnings=1
+          -Ddisable_sse2=1"
 %endif
 
 %ifarch %arm



++++++ chromium-enable-vaapi.patch ++++++
>From ba4616cfd95abf13d911adde82b3d120b1b760ee Mon Sep 17 00:00:00 2001
From: Jimmy Berry <[email protected]>
Date: Mon, 14 Dec 2015 00:19:46 -0600
Subject: [PATCH] Enable VA-API hardware acceleration in Linux.

Original source:
  http://www.kelvinblog.tk/enable-chromium-vaapi-hardware-acceleration-linux/
  
https://raw.githubusercontent.com/Kelvin-Ng/Kelvin-Gentoo-Overlay/master/www-client/chromium/files/enable_vaapi_on_linux_48.0.2564.23.patch

Merged in changes to support non-intel hybrid graphics.
  
http://bazaar.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.trusty.beta/view/head:/debian/patches/enable_vaapi_on_linux.diff

Patch has since been rerolled for openSUSE version of chromium.
---
 chrome/browser/about_flags.cc                      |  2 +-
 .../gpu/media/gpu_jpeg_decode_accelerator.cc       |  6 +--
 .../gpu/media/gpu_video_decode_accelerator.cc      | 10 ++--
 .../gpu/media/gpu_video_encode_accelerator.cc      |  6 +--
 .../gpu/media/jpeg_decode_accelerator_unittest.cc  |  6 +--
 content/common/gpu/media/vaapi_wrapper.cc          |  4 +-
 .../gpu/media/video_decode_accelerator_unittest.cc |  8 +--
 .../gpu/media/video_encode_accelerator_unittest.cc |  8 +--
 .../common/sandbox_linux/bpf_gpu_policy_linux.cc   | 63 +++++++++++++++-------
 content/content_common.gypi                        | 10 ++--
 content/content_gpu.gypi                           |  2 +-
 content/content_tests.gypi                         |  8 +--
 content/gpu/gpu_main.cc                            |  4 +-
 content/public/common/content_switches.cc          |  2 +
 content/public/common/content_switches.h           |  2 +
 gpu/config/software_rendering_list_json.cc         | 16 ++----
 media/media.gyp                                    |  4 +-
 17 files changed, 92 insertions(+), 69 deletions(-)

diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index adce315..1c4d188 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1003,7 +1003,7 @@ const Experiment kExperiments[] = {
      "disable-accelerated-video-decode",
      IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
      IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
-     kOsMac | kOsWin | kOsCrOS,
+     kOsMac | kOsWin | kOsCrOS | kOsLinux,
      SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
     },
 #if defined(USE_ASH)
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc 
b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
index de0f587..2d899ad 100644
--- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
@@ -20,7 +20,7 @@
 #include "media/filters/jpeg_parser.h"
 #include "ui/gfx/geometry/size.h"
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
 #if defined(ARCH_CPU_X86_FAMILY)
 #include "content/common/gpu/media/vaapi_jpeg_decode_accelerator.h"
 #endif
@@ -402,7 +402,7 @@ scoped_ptr<media::JpegDecodeAccelerator>
 GpuJpegDecodeAccelerator::CreateV4L2JDA(
     const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) {
   scoped_ptr<media::JpegDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_V4L2_CODEC)
   scoped_refptr<V4L2Device> device = V4L2Device::Create(
       V4L2Device::kJpegDecoder);
   if (device)
@@ -416,7 +416,7 @@ scoped_ptr<media::JpegDecodeAccelerator>
 GpuJpegDecodeAccelerator::CreateVaapiJDA(
     const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) {
   scoped_ptr<media::JpegDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   decoder.reset(new VaapiJpegDecodeAccelerator(io_task_runner));
 #endif
   return decoder.Pass();
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc 
b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index 5205404..06d3452 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -33,7 +33,7 @@
 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
 #elif defined(OS_MACOSX)
 #include "content/common/gpu/media/vt_video_decode_accelerator.h"
-#elif defined(OS_CHROMEOS)
+#elif defined(OS_CHROMEOS) || defined(OS_LINUX)
 #if defined(USE_V4L2_CODEC)
 #include "content/common/gpu/media/v4l2_device.h"
 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h"
@@ -300,7 +300,7 @@ GpuVideoDecodeAccelerator::CreateDXVAVDA() {
 scoped_ptr<media::VideoDecodeAccelerator>
 GpuVideoDecodeAccelerator::CreateV4L2VDA() {
   scoped_ptr<media::VideoDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_V4L2_CODEC)
   scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
   if (device.get()) {
     decoder.reset(new V4L2VideoDecodeAccelerator(
@@ -318,7 +318,7 @@ GpuVideoDecodeAccelerator::CreateV4L2VDA() {
 scoped_ptr<media::VideoDecodeAccelerator>
 GpuVideoDecodeAccelerator::CreateV4L2SliceVDA() {
   scoped_ptr<media::VideoDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_V4L2_CODEC)
   scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
   if (device.get()) {
     decoder.reset(new V4L2SliceVideoDecodeAccelerator(
@@ -347,7 +347,7 @@ void GpuVideoDecodeAccelerator::BindImage(uint32 
client_texture_id,
 scoped_ptr<media::VideoDecodeAccelerator>
 GpuVideoDecodeAccelerator::CreateVaapiVDA() {
   scoped_ptr<media::VideoDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   decoder.reset(new VaapiVideoDecodeAccelerator(
       make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage,
                                         base::Unretained(this))));
@@ -401,7 +401,7 @@ GpuVideoDecodeAccelerator::GetSupportedProfiles() {
   // can be initialized by corresponding VDA successfully.
 #if defined(OS_WIN)
   profiles = DXVAVideoDecodeAccelerator::GetSupportedProfiles();
-#elif defined(OS_CHROMEOS)
+#elif defined(OS_CHROMEOS) || defined(OS_LINUX)
   media::VideoDecodeAccelerator::SupportedProfiles vda_profiles;
 #if defined(USE_V4L2_CODEC)
   vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles();
diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc 
b/content/common/gpu/media/gpu_video_encode_accelerator.cc
index ef14060..d6fcf77 100644
--- a/content/common/gpu/media/gpu_video_encode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc
@@ -20,7 +20,7 @@
 #include "media/base/limits.h"
 #include "media/base/video_frame.h"
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
 #if defined(USE_V4L2_CODEC)
 #include "content/common/gpu/media/v4l2_video_encode_accelerator.h"
 #endif
@@ -197,7 +197,7 @@ GpuVideoEncodeAccelerator::CreateVEAFps() {
 scoped_ptr<media::VideoEncodeAccelerator>
 GpuVideoEncodeAccelerator::CreateV4L2VEA() {
   scoped_ptr<media::VideoEncodeAccelerator> encoder;
-#if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_V4L2_CODEC)
   scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kEncoder);
   if (device)
     encoder.reset(new V4L2VideoEncodeAccelerator(device));
@@ -209,7 +209,7 @@ GpuVideoEncodeAccelerator::CreateV4L2VEA() {
 scoped_ptr<media::VideoEncodeAccelerator>
 GpuVideoEncodeAccelerator::CreateVaapiVEA() {
   scoped_ptr<media::VideoEncodeAccelerator> encoder;
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
   if (!cmd_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode))
     encoder.reset(new VaapiVideoEncodeAccelerator());
diff --git a/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc 
b/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
index fa640b1..8026753 100644
--- a/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
@@ -23,7 +23,7 @@
 #include "third_party/libyuv/include/libyuv.h"
 #include "ui/gfx/codec/jpeg_codec.h"
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
 #if defined(USE_V4L2_CODEC)
 #include "content/common/gpu/media/v4l2_device.h"
 #include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h"
@@ -129,7 +129,7 @@ JpegClient::~JpegClient() {
 }
 
 void JpegClient::CreateJpegDecoder() {
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   decoder_.reset(
       new VaapiJpegDecodeAccelerator(base::ThreadTaskRunnerHandle::Get()));
 #elif defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
@@ -568,7 +568,7 @@ int main(int argc, char** argv) {
       continue;
     LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
   }
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   content::VaapiWrapper::PreSandboxInitialization();
 #endif
 
diff --git a/content/common/gpu/media/vaapi_wrapper.cc 
b/content/common/gpu/media/vaapi_wrapper.cc
index e85293a..368d793 100644
--- a/content/common/gpu/media/vaapi_wrapper.cc
+++ b/content/common/gpu/media/vaapi_wrapper.cc
@@ -307,7 +307,9 @@ bool VaapiWrapper::VaInitialize(const base::Closure& 
report_error_to_uma_cb) {
   static bool vaapi_functions_initialized = PostSandboxInitialization();
   if (!vaapi_functions_initialized) {
     bool running_on_chromeos = false;
-#if defined(OS_CHROMEOS)
+#if defined(OS_LINUX)
+    running_on_chromeos = true;
+#elif defined(OS_CHROMEOS)
     // When chrome runs on linux with chromeos=1, do not log error message
     // without VAAPI libraries.
     running_on_chromeos = base::SysInfo::IsRunningOnChromeOS();
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc 
b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index 493ced7..1ebde42 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -532,7 +532,7 @@ GLRenderingVDAClient::CreateDXVAVDA() {
 scoped_ptr<media::VideoDecodeAccelerator>
 GLRenderingVDAClient::CreateV4L2VDA() {
   scoped_ptr<media::VideoDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_V4L2_CODEC)
   scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
   if (device.get()) {
     base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
@@ -549,7 +549,7 @@ GLRenderingVDAClient::CreateV4L2VDA() {
 scoped_ptr<media::VideoDecodeAccelerator>
 GLRenderingVDAClient::CreateV4L2SliceVDA() {
   scoped_ptr<media::VideoDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_V4L2_CODEC)
   scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
   if (device.get()) {
     base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
@@ -566,7 +566,7 @@ GLRenderingVDAClient::CreateV4L2SliceVDA() {
 scoped_ptr<media::VideoDecodeAccelerator>
 GLRenderingVDAClient::CreateVaapiVDA() {
   scoped_ptr<media::VideoDecodeAccelerator> decoder;
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   decoder.reset(new VaapiVideoDecodeAccelerator(
       base::Bind(&DoNothingReturnTrue),
       base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this))));
@@ -1651,7 +1651,7 @@ int main(int argc, char **argv) {
   ui::OzonePlatform::InitializeForUI();
 #endif
 
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   content::VaapiWrapper::PreSandboxInitialization();
 #endif
 
diff --git a/content/common/gpu/media/video_encode_accelerator_unittest.cc 
b/content/common/gpu/media/video_encode_accelerator_unittest.cc
index e22bd42..5f114aa 100644
--- a/content/common/gpu/media/video_encode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc
@@ -40,7 +40,7 @@
 #include "media/video/video_encode_accelerator.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC))
 #include "content/common/gpu/media/v4l2_video_encode_accelerator.h"
 #endif
@@ -1043,7 +1043,7 @@ scoped_ptr<media::VideoEncodeAccelerator> 
VEAClient::CreateFakeVEA() {
 
 scoped_ptr<media::VideoEncodeAccelerator> VEAClient::CreateV4L2VEA() {
   scoped_ptr<media::VideoEncodeAccelerator> encoder;
-#if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && (defined(ARCH_CPU_ARMEL) || 
\
     (defined(USE_OZONE) && defined(USE_V4L2_CODEC)))
   scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kEncoder);
   if (device)
@@ -1054,7 +1054,7 @@ scoped_ptr<media::VideoEncodeAccelerator> 
VEAClient::CreateV4L2VEA() {
 
 scoped_ptr<media::VideoEncodeAccelerator> VEAClient::CreateVaapiVEA() {
   scoped_ptr<media::VideoEncodeAccelerator> encoder;
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   encoder.reset(new VaapiVideoEncodeAccelerator());
 #endif
   return encoder.Pass();
@@ -1760,7 +1760,7 @@ int main(int argc, char** argv) {
     LOG(FATAL) << "--measure_latency requires --run_at_fps enabled to work.";
   }
 
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   content::VaapiWrapper::PreSandboxInitialization();
 #endif
 
diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc 
b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
index 8f7fd64d..8911527 100644
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
@@ -21,6 +21,8 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "build/build_config.h"
+// Auto-generated for dlopen libva libraries
+#include "content/common/gpu/media/va_stubs.h"
 #include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h"
 #include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h"
 #include "content/common/set_process_title.h"
@@ -31,6 +33,8 @@
 #include "sandbox/linux/syscall_broker/broker_file_permission.h"
 #include "sandbox/linux/syscall_broker/broker_process.h"
 #include "sandbox/linux/system_headers/linux_syscalls.h"
+#include "third_party/libva/va/va.h"
+#include "third_party/libva/va/va_x11.h"
 
 using sandbox::arch_seccomp_data;
 using sandbox::bpf_dsl::Allow;
@@ -40,6 +44,11 @@ using sandbox::syscall_broker::BrokerFilePermission;
 using sandbox::syscall_broker::BrokerProcess;
 using sandbox::SyscallSets;
 
+using content_common_gpu_media::kModuleVa;
+using content_common_gpu_media::kModuleVa_x11;
+using content_common_gpu_media::InitializeStubs;
+using content_common_gpu_media::StubPathMap;
+
 namespace content {
 
 namespace {
@@ -94,7 +103,7 @@ inline bool UseLibV4L2() {
 
 bool IsAcceleratedVaapiVideoEncodeEnabled() {
   bool accelerated_encode_enabled = false;
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
   const base::CommandLine& command_line =
       *base::CommandLine::ForCurrentProcess();
   accelerated_encode_enabled =
@@ -299,27 +308,41 @@ bool GpuProcessPolicy::PreSandboxHook() {
     // inside the sandbox, so preload them now.
     if (IsAcceleratedVaapiVideoEncodeEnabled() ||
         IsAcceleratedVideoDecodeEnabled()) {
-      const char* I965DrvVideoPath = NULL;
-      const char* I965HybridDrvVideoPath = NULL;
-
-      if (IsArchitectureX86_64()) {
-        I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so";
-        I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so";
-      } else if (IsArchitectureI386()) {
-        I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so";
+      DVLOG(1) << "Attempting to enable hardware video acceleration.";
+      StubPathMap paths;
+      paths[kModuleVa].push_back("libva.so.1");
+      paths[kModuleVa_x11].push_back("libva-x11.so.1");
+      if (!InitializeStubs(paths)) {
+        DVLOG(1) << "Failed to initialize stubs";
+        return false;
       }
 
-      dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
-      if (I965HybridDrvVideoPath)
-        dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
-      dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
-#if defined(USE_OZONE)
-      dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
-#elif defined(USE_X11)
-      dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
-#endif
-    }
-  }
+      // libva drivers won't get loaded even above two libraries get dlopened.
+      // Thus, libva calls will fail after post sandbox stage.
+      //
+      // To get the va driver loaded before sandboxing, upstream simply dlopen
+      // the hard-coded va driver path because ChromeOS is the only platform
+      // that Google want to support libva.
+      //
+      // While generic linux distros ship va driver as anywhere they want.
+      // Fortunately, the va driver will be loadded when vaInitialize() get
+      // called.
+      // So the following code is to call vaInitialize() before sandboxing.
+      Display* x_display = XOpenDisplay(NULL);
+      VADisplay va_display = vaGetDisplay(x_display);
+      if (!vaDisplayIsValid(va_display)) {
+        DVLOG(1) << "Failed to call vaGetDisplay()";
+        return false;
+      }
+
+      int major_version, minor_version;
+      if (vaInitialize(va_display, &major_version, &minor_version)
+          != VA_STATUS_SUCCESS) {
+        DVLOG(1) << "Failed to call vaInitialize()";
+        return false;
+      }
+    }  // end of IsAcceleratedVaapiVideoEncodeEnabled() || 
IsAcceleratedVideoDecodeEnabled()
+  }  // end of IsArchitectureX86_64() || IsArchitectureI386()
 
   return true;
 }
diff --git a/content/content_common.gypi b/content/content_common.gypi
index c54f367..9179cc0 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -818,7 +818,7 @@
         '../third_party/libjingle/libjingle.gyp:libjingle',
       ],
     }],
-    ['use_v4lplugin==1 and chromeos==1', {
+    ['use_v4lplugin==1 and (chromeos==1 or desktop_linux==1)', {
       'defines': [
         'USE_LIBV4L2'
       ],
@@ -862,7 +862,7 @@
         },
       ],
     }],
-    ['chromeos==1', {
+    ['chromeos==1 or desktop_linux==1', {
       'sources': [
         'common/gpu/media/accelerated_video_decoder.h',
         'common/gpu/media/h264_decoder.cc',
@@ -879,7 +879,7 @@
         'common/gpu/media/vp9_picture.h',
       ],
     }],
-    ['chromeos==1 and use_v4l2_codec==1', {
+    ['(chromeos==1 or desktop_linux==1) and use_v4l2_codec==1', {
       'direct_dependent_settings': {
         'defines': [
           'USE_V4L2_CODEC'
@@ -912,13 +912,13 @@
         '<(DEPTH)/third_party/khronos',
       ],
     }],
-    ['target_arch == "arm" and chromeos == 1', {
+    ['target_arch == "arm" and (chromeos == 1 or desktop_linux == 1)', {
       'sources': [
         'common/gpu/media/tegra_v4l2_device.cc',
         'common/gpu/media/tegra_v4l2_device.h',
       ],
     }],
-    ['target_arch != "arm" and chromeos == 1', {
+    ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1)', {
       'dependencies': [
         '../media/media.gyp:media',
         '../third_party/libyuv/libyuv.gyp:libyuv',
diff --git a/content/content_gpu.gypi b/content/content_gpu.gypi
index 1c2121d..9dfb370 100644
--- a/content/content_gpu.gypi
+++ b/content/content_gpu.gypi
@@ -36,7 +36,7 @@
         ],
       },
     }],
-    ['target_arch!="arm" and chromeos == 1', {
+    ['target_arch!="arm" and (chromeos == 1 or desktop_linux == 1)', {
       'include_dirs': [
         '<(DEPTH)/third_party/libva',
       ],
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 5c477ff..8d3b13b 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -1662,7 +1662,7 @@
         },
       ],
     }],
-    ['chromeos==1 or OS=="win" or OS=="android"', {
+    ['(chromeos==1 or desktop_linux==1) or OS=="win" or OS=="android"', {
       'targets': [
           {
             'target_name': 'video_decode_accelerator_unittest',
@@ -1731,7 +1731,7 @@
                   '../ui/gfx/x/gfx_x11.gyp:gfx_x11',
                 ],
               }],
-              ['use_ozone==1 and chromeos==1', {
+              ['use_ozone==1 and (chromeos==1 or desktop_linux == 1)', {
                 'dependencies': [
                   '../ui/display/display.gyp:display',  # Used by 
rendering_helper.cc
                   '../ui/ozone/ozone.gyp:ozone',  # Used by rendering_helper.cc
@@ -1743,7 +1743,7 @@
           },
         ]
     }],
-    ['chromeos==1 and target_arch != "arm"', {
+    ['(chromeos==1 or desktop_linux==1) and target_arch != "arm"', {
       'targets': [
           {
             'target_name': 'vaapi_jpeg_decoder_unittest',
@@ -1775,7 +1775,7 @@
           }
         ]
     }],
-    ['chromeos==1', {
+    ['chromeos==1 or desktop_linux==1', {
       'targets': [
         {
           'target_name': 'video_encode_accelerator_unittest',
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index e7ce06e..1fff198 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -66,7 +66,7 @@
 #include "content/common/sandbox_mac.h"
 #endif
 
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
 #include "content/common/gpu/media/vaapi_wrapper.h"
 #endif
 
@@ -231,7 +231,7 @@ int GpuMain(const MainFunctionParams& parameters) {
   GetGpuInfoFromCommandLine(gpu_info, command_line);
   gpu_info.in_process_gpu = false;
 
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY)
   VaapiWrapper::PreSandboxInitialization();
 #endif
 
diff --git a/content/public/common/content_switches.cc 
b/content/public/common/content_switches.cc
index a685f47..7814456 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -908,7 +908,9 @@ const char kDisableWebAudio[]               = 
"disable-webaudio";
 #if defined(OS_CHROMEOS)
 // Disables panel fitting (used for mirror mode).
 const char kDisablePanelFitting[]           = "disable-panel-fitting";
+#endif
 
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
 // Disables VA-API accelerated video encode.
 const char kDisableVaapiAcceleratedVideoEncode[] =
     "disable-vaapi-accelerated-video-encode";
diff --git a/content/public/common/content_switches.h 
b/content/public/common/content_switches.h
index 2d13186..9ecd6e0 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -269,6 +269,8 @@ CONTENT_EXPORT extern const char kDisableWebAudio[];
 
 #if defined(OS_CHROMEOS)
 CONTENT_EXPORT extern const char kDisablePanelFitting[];
+#endif
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
 CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[];
 #endif
 
diff --git a/gpu/config/software_rendering_list_json.cc 
b/gpu/config/software_rendering_list_json.cc
index eaabfe6..efe775d 100644
--- a/gpu/config/software_rendering_list_json.cc
+++ b/gpu/config/software_rendering_list_json.cc
@@ -481,17 +481,6 @@ const char kSoftwareRenderingListJson[] = 
LONG_STRING_CONST(
       ]
     },
     {
-      "id": 48,
-      "description": "Accelerated video decode is unavailable on Linux",
-      "cr_bugs": [137247],
-      "os": {
-        "type": "linux"
-      },
-      "features": [
-        "accelerated_video_decode"
-      ]
-    },
-    {
       "id": 49,
       "description": "NVidia GeForce GT 650M can cause the system to hang with 
flash 3D",
       "cr_bugs": [140175],
@@ -1039,6 +1028,11 @@ LONG_STRING_CONST(
             "op": ">=",
             "value": "3.0"
           }
+        },
+        {
+          "os": {
+            "type": "linux"
+          }
         }
       ],
       "features": [
diff --git a/media/media.gyp b/media/media.gyp
index a842881..063c3d1 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -761,7 +761,7 @@
           ],
         }],
         # For VaapiVideoEncodeAccelerator.
-        ['target_arch != "arm" and chromeos == 1', {
+        ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1)', {
           'sources': [
             'filters/h264_bitstream_buffer.cc',
             'filters/h264_bitstream_buffer.h',
@@ -1381,7 +1381,7 @@
             'player_android',
           ],
         }],
-        ['target_arch != "arm" and chromeos == 1 and use_x11 == 1', {
+        ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1) and 
use_x11 == 1', {
           'sources': [
             'filters/h264_bitstream_buffer_unittest.cc',
           ],
-- 
2.6.3

++++++ fix_network_api_crash.patch ++++++
--- extensions/browser/api/networking_private/networking_private_linux.cc_      
2015-12-26 20:26:42.386838036 +0100
+++ extensions/browser/api/networking_private/networking_private_linux.cc       
2015-12-27 02:15:56.848713761 +0100
@@ -215,12 +215,14 @@
   scoped_ptr<base::DictionaryValue> network_properties(
       new base::DictionaryValue);
 
+  std::string* erp = error.get();
+  base::DictionaryValue* npp = network_properties.get();
   // Runs GetCachedNetworkProperties on |dbus_thread|.
   dbus_thread_.task_runner()->PostTaskAndReply(
       FROM_HERE, 
base::Bind(&NetworkingPrivateLinux::GetCachedNetworkProperties,
                             base::Unretained(this), guid,
-                            base::Unretained(network_properties.get()),
-                            base::Unretained(error.get())),
+                            base::Unretained(npp),
+                            base::Unretained(erp)),
       base::Bind(&GetCachedNetworkPropertiesCallback, base::Passed(&error),
                  base::Passed(&network_properties), success_callback,
                  failure_callback));
@@ -301,11 +303,12 @@
 
   // Runs GetAllWiFiAccessPoints on the dbus_thread and returns the
   // results back to OnAccessPointsFound where the callback is fired.
+  NetworkMap* nmp = network_map.get();
   dbus_thread_.task_runner()->PostTaskAndReply(
       FROM_HERE,
       base::Bind(&NetworkingPrivateLinux::GetAllWiFiAccessPoints,
                  base::Unretained(this), configured_only, visible_only, limit,
-                 base::Unretained(network_map.get())),
+                 base::Unretained(nmp)),
       base::Bind(&NetworkingPrivateLinux::OnAccessPointsFound,
                  base::Unretained(this), base::Passed(&network_map),
                  success_callback, failure_callback));
@@ -321,11 +324,12 @@
   // Runs GetAllWiFiAccessPoints on the dbus_thread and returns the
   // results back to SendNetworkListChangedEvent to fire the event. No
   // callbacks are used in this case.
+  NetworkMap* nmp = network_map.get();
   dbus_thread_.task_runner()->PostTaskAndReply(
       FROM_HERE, base::Bind(&NetworkingPrivateLinux::GetAllWiFiAccessPoints,
                             base::Unretained(this), false /* configured_only 
*/,
                             false /* visible_only */, 0 /* limit */,
-                            base::Unretained(network_map.get())),
+                            base::Unretained(nmp)),
       base::Bind(&NetworkingPrivateLinux::OnAccessPointsFoundViaScan,
                  base::Unretained(this), base::Passed(&network_map)));
 
@@ -506,11 +510,12 @@
 
   scoped_ptr<std::string> error(new std::string);
 
+  std::string* erp = error.get();
   // Runs ConnectToNetwork on |dbus_thread|.
   dbus_thread_.task_runner()->PostTaskAndReply(
       FROM_HERE,
       base::Bind(&NetworkingPrivateLinux::ConnectToNetwork,
-                 base::Unretained(this), guid, base::Unretained(error.get())),
+                 base::Unretained(this), guid, base::Unretained(erp)),
       base::Bind(&OnNetworkConnectOperationCompleted, base::Passed(&error),
                  success_callback, failure_callback));
 }
@@ -524,11 +529,12 @@
 
   scoped_ptr<std::string> error(new std::string);
 
+  std::string* erp = error.get();
   // Runs DisconnectFromNetwork on |dbus_thread|.
   dbus_thread_.task_runner()->PostTaskAndReply(
       FROM_HERE,
       base::Bind(&NetworkingPrivateLinux::DisconnectFromNetwork,
-                 base::Unretained(this), guid, base::Unretained(error.get())),
+                 base::Unretained(this), guid, base::Unretained(erp)),
       base::Bind(&OnNetworkConnectOperationCompleted, base::Passed(&error),
                  success_callback, failure_callback));
 }

Reply via email to